[Lazarus] 2 questions about Component properties

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Dec 3 13:04:19 CET 2009


On Wed, 2 Dec 2009 09:38:58 +0100
wile64 <wile64 at gmail.com> wrote:

>[...]
> > It's a custom panel.
> >
> > > I make solution like this, Height stored = false and I save Height in
> > other
> > > variable!
> >
> > Height is stored by the LCL. You can not set stored = false (unless
> > you change the LCL source code).
> >
> >
> > > I'm not sure is good solution ?
> >
> > Can you give some more details, what you want to do?
> >
> > Roll up panel with title
> 
> 
> >
> > > > > 2) How to define region for accept client into Tpanel ?
> > > >
> > > > Maybe you mean the properties listed in the object
> > > > inspector under ChildSizing? For example LeftRightSpacing.
> > > >
> > > >
> > > AdjustClientRect work with anchoring, but in designer is not respected.
> > > It is possible to restrict area for client in design and run time too ?
> >
> > AdjustClientRect work the same under designtime and runtime. Under
> > designtime you can drag the controls to some invalid positions, same as
> > at runtime. The only difference is that at runtime the autosizing is
> > done immediately, so you can not see the invalid positions. Same for
> > Anchors.
> >
> > Yes, but when add button for exemple, is possible to put out of marging
> defined in AdjustClientRect

Yes, even negative coordinates are allowed for controls. This is for
example needed when right aligning controls and the panel has not
enough width for all it's children.
You can override
    procedure AlignControls(AControl: TControl; var ARect: TRect); override;
This is called whenever the children were changed.

Mattias




More information about the Lazarus mailing list