6
votes
Vote UpVote

The FMX enumeration anti-pattern

Delphi Haven – Checking up on DelphiFeeds.com, I see a member of Embarcadero Developer Relations (Stephen Ball) has just blogged some example code. In it, he demonstrates a class helper that adds methods for enumerating a FireMonkey control, doing so in a way that just picks out nested objects of a certain class. Here’s the gist of it: function TFMXObjectHelper.ChildrenCountOfType(aType: TClass): Integer; var Idx: Integer; Obj: TFmxObject; begin Result := 0; for Idx := 0 to Pred(Self.ChildrenCount) do begin Obj := Self.Children[Idx]; if Obj is aType then Inc(Result); Result := ...
Favorite? Off-Topic? Chris Rolliston @ 2012-07-02 23:13

Statistics

Visits: 712
Votes: 6
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Ericc
Primoz Gabrijelcic
TOndrej
Wouter
Zzzzz
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)