[Lazarus] AlignTop/AlignBottom issue

K. P. platysternon at hotmail.com
Mon May 25 21:33:09 CEST 2015


I assume you are speaking of controls being created at run time?
If so, then I have seen this behaviour (and I believe I had encountered it in Delphi as well).I deal with it by simply setting the Top property to some value higher than "used", i.e.
NewPanel.Top := 10000;
for top aligning controls - there is no need for painful calculations or switching alignments.
Just setting top (while control is top aligned) puts it in the proper sequence, i.e. at the bottom of the "stack"
Cheers,Kai



> Date: Mon, 25 May 2015 19:13:27 +0200
> From: giuliano.colla at fastwebnet.it
> To: lazarus at lists.lazarus.freepascal.org
> Subject: [Lazarus] AlignTop/AlignBottom issue
> 
> AlignTop and AlignBottom do not appear to behave as they should.
> 
> When you have several controls contained in another control, you would 
> expect that each AlignTop or AlignBottom would stack the control in the 
> first free position: with AlignBottom on top of the stack of the other 
> bottom aligned components, with AlignTop at the bottom of the stack of 
> the other top aligned components.
> 
> On the contrary, it happens that "sometimes", in an unpredictable but 
> reproducible way, the control which should go in one place goes to a 
> different one, either becoming topmost or bottommost, or being inserted 
> between other components.
> 
> This occurs both at design time, making it sometimes very difficult to 
> lay out the components as desired, and at runtime, disrupting the 
> desired order of the components.
> The only workaround I've found is to set Align to alNone, and to 
> painfully calculate the Top property of each component from the Top and 
> Height properties of the others.
> 
> This, besides not being Delphi compatible, is quite annoying.
> 
> Should I open an issue in the bugtracker, with the usual small example 
> to demonstrate the issue?
> 
> Giuliano
> 
> 
> 
> 
> 
> 
> 
> 
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150525/cb9a3189/attachment-0003.html>


More information about the Lazarus mailing list