2
votes
Vote UpVote

Enumerating Controls the Easy Way

The Delphi Geek – Yesterday I had to write a mapping from a set of radio buttons to an integer (and back). I couldn’t use TRadioGroup and so I had to iterate over controls to find out which one is checked. To do that, I used an enumeration helper which I wrote long time ago.function TfrmColorRemappingDlg.GetMapping: integer;var ctrl: TControl;begin Result := 0; for ctrl in EnumControls(Self, TRadioButton) do if TRadioButton(ctrl).Checked then Exit(ctrl.Tag);end;At that point I decided that this old-way enumeration is not good enough for the modern times. What I particularly dislike about it is that I ...
Favorite? Off-Topic? gabr @ 2014-06-19 15:22

Statistics

Visits: 690
Votes: 2
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Jørn E. Angeltveit
SimaWB
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)