On Mon, Jan 17, 2011 at 2:08 PM, Michael Van Canneyt <mich...@freepascal.org > wrote:
> > > TLabelDefaults = Class(TPersistent) > // Selected properties. > end; > > and > > Var > LabelDefaults : TLabelDefaults; > > Which are applied as soon as a TLabel control is created. > > I liked the idea, but to understand it correctly... You placed it in "var", isn't it supposed to be placed on a form like any other TComponent? So once it added, every existing and future TLabel on the form will get new defaults unless they're explicitly changed by the user? And if the persistent is deleted all default will be back to objects default. There are some challenges I think, for example how to behave with inheritance since in this case both component and default can be inherited and changed in the form. Also I thought that it would be useful to implement them like TField in database components. So for example make Defaults properties in the form that works like Fields in TDataSet descendants so on any placed component if there is registered corresponding TComponentDefault found, it's automatically added to Defaults designer or rather say as TField works, it simply added to form while also supported effectively by specially created designer. I know that it's more work to do in this case, but implementing this way will allow more convenient usage, since starting some number of defaults randomly placed components on the form are harder to track and use. Max Vlasov
-- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus