On Wed, 21 Nov 2007 00:14:30 +0100
Giuliano Colla <[EMAIL PROTECTED]> wrote:

> Mattias Gaertner ha scritto:
> > On Tue, 20 Nov 2007 15:55:45 +0100
> > Giuliano Colla <[EMAIL PROTECTED]> wrote:
> >
> >   
> >> Recently the anchors behavior has changed.
> >> I have a form with a control anchored to another one.
> >> With the latest revisions it happens that when the second control
> >> is hidden, the visible one changes its place, inheriting the
> >> anchors of the hidden control.
> >> Is it an intended change or a bug?
> >>     
> >
> > Something changed. See
> >
> > http://wiki.lazarus.freepascal.org/Anchor_Sides#Anchoring_to_invisible_controls
> >
> >
> >   
> Well this has pro's and con's. It can make sense if the control is 
> hidden since the beginning, much less if the control is hidden
> run-time, because it causes other controls jump around.
> 
> In my case a label prompts the user to enter something in an edit.
> The label is anchored to the form, and the edit to the label. When
> the user enters what requested, the label is hidden, and suddenly the
> edit jumps to the top of the form!
> 
> Moreover this inhibits the trick of using a hidden control to perform 
> some special purpose anchoring (e.g. when you need more than 100
> pixels, because of layout requirements).
> 
> I'd be strongly in favor of reconsidering this feature.

Edit.Top is anchored to Label.Bottom. 
Label is invisible so the LCL goes to the anchor of Label.Bottom.
Probably you did not set a Label.Bottom anchor, so the LCL found a dead
end and just did nothing. 
Now assumes the label.top is anchored to another control A. If A is
moved then the Label and Edit should move too. With old behavior the
Edit is not moved when the Label is invisible. With new behavior it
will move.


You can get the old behavior by doing:

Edit1.AnchorSide[akTop].Control:=nil;
Label1.Visible:=false;


Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to