[Lazarus] Own component - problem with default published property

Krzysztof dibo20 at wp.pl
Wed May 16 16:35:56 CEST 2012


But what if this is subproperty?

For example:

TMyProperty = class(TPersistent)
published
  property SomeValue: TSomeType read FSomeValue write SetSomeValue default sv1
end;

Can I do something like that:

TMyControl1 = class(TControl)
published
  MyProperty.SomeValue default sv2
end;

TMyControl2 = class(TControl)
published
  MyProperty.SomeValue default sv3
end;

Or must I create new descendant of TMyProperty for each control and
then change default value of SomeValue property?

2012/5/16 cobines <cobines at gmail.com>:
> If you changed the default you should publish it with:
>
> property Style default csDropDownList;
>
> If property has default value it is not written to LFM, in that case
> the value is whatever you set in constructor.
>
> --
> cobines
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>




More information about the Lazarus mailing list