On 28.01.2016 16:23, Anthony Walter wrote:
Here is a preferable solution:

    property Controls: IControlEnumerator read GetItems;

You are already the third person suggesting it :)

Yes, it is possible. You can do it with your code. I still don't know if there is a will to modify:

  TWinControl = class(TControl)
    // ...
    property Controls[Index: Integer]: TControl read GetControl;

to

  TWinControl = class(TControl)
    // ...
    property Controls: IWinControlControls read GetControls;


Something like
  TWinControl = class(TControl)
    // ...
property Controls[Index: Integer]: TControl read GetControl enumerator GetControlEnumerator;

or
  TWinControl = class(TControl)
    // ...
    property Controls[Index: Integer]: TControl read GetControl;
    property Controls: TControlEnumerator read GetControlEnumerator;

seems better suited from my POV.

(The same for TStrings.Objects etc.)

Ondrej
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to