[Lazarus] ComponentEditors.pas: editor form procedures should work with TForm
Jesus Reyes
jesusrmx at yahoo.com.mx
Fri Oct 8 19:35:17 CEST 2010
--- El vie 8-oct-10, Alexander Klenin <klenin at gmail.com> escribió:
> De: Alexander Klenin <klenin at gmail.com>
> Asunto: [Lazarus] ComponentEditors.pas: editor form procedures should work with TForm
> A: "Lazarus mailing list" <lazarus at lists.lazarus.freepascal.org>
> Fecha: viernes, 8 de octubre de 2010, 6:43
> I did a review of changes made by
> Jesus to fix
> http://bugs.freepascal.org/view.php?id=17572 and
> http://bugs.freepascal.org/view.php?id=17077
> (Thanks again, btw, this was a messy problem)
>
> I think that FindEditorForm, RegisterEditorForm and
> UnregisterEditorForm
> should take/return editor as TForm instead of TObject,
> on the principle that strong typing is better than weak
> one.
>
> --
> Alexander S. Klenin
It was made the way it is by considering at least three things, one, most times there will be a type cast to the new TForm class is being used to create an instance and the component or property editor is well aware of the right class to be used, two, FindEditorForm allows access to other component or property editors forms, and the more isolated are they the better.
At the same time it opens the door to other kinds of 'form' editors which are not descendants of forms. Btw, what if somebody uses TCustomForm as parent class instead of TForm?, So the way was planned accounted also flexibility.
Jesus Reyes A.
More information about the Lazarus
mailing list