6
votes

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 := ...
Statistics
|
Visits by Source |
User Actions |