--- El vie 8-oct-10, Alexander Klenin <[email protected]> escribió:

> De: Alexander Klenin <[email protected]>
> Asunto: [Lazarus] ComponentEditors.pas: editor form procedures should work 
> with TForm
> A: "Lazarus mailing list" <[email protected]>
> 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.


      

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to