AlignTop-AlignBottom do not behave as expected
Original Reporter info from Mantis: giuliano
-
Reporter name: G. Colla
Original Reporter info from Mantis: giuliano
- Reporter name: G. Colla
Description:
When several controls are stacked within another control with AlignTop/AlignBottom, the next control whose align property is set should go in the first available position, i.e. below other controls with AlignTop, above other controls with AlignBottom.
This is not always true. It would appear that the position taken by the control is somehow dependent on its previous Top value, which should be irrelevant.
Steps to reproduce:
A small sample program is attached.
At start 7 buttons are bottom aligned in a Panel. Their OnClick event toggles the align property AlignTop/AlignBottom.
By clicking them in order (Button1, Button2, etc.) they become Top Aligned in the proper order.
By clicking again in the same order (i.e. Button1,Button2, etc.) they're set at bottom completely out of order: 4-3-5-2-6-1-7
By toggling the Workaround toggle Box, a workaround is activated, which changes the Top property before changing the Align property. If activated, controls are always stacked in the proper order.
Additional information:
The kind of control is irrelevant. TPanel, TButton, and several others I tested do behave the same.
The same problem occurs also at design time, making it sometimes difficult to put a control in the proper position. Moreover, changing the Align property from alTop/alBottom to alNone, the control goes back to the position it had before, instead of keeping the position given by the previous align.
Mantis conversion info:
- Mantis ID: 28183
- Build: 49167
- Platform: any
- Version: 1.4.1 (SVN)