Re: TSplitter Persistence problem
- From: Rob Kennedy <me3@xxxxxxxxxxx>
- Date: Tue, 23 Aug 2005 11:07:04 -0500
samjones wrote:
Store each Panel's Top property and Height property.
Restore each Panel's Top property in sequence from bottom up. Restore each Splitter's Top property using: Splitter1.Top := Panel1.Top-1; //thanks again Rob Restore each Panels Height property.
Using the DisableAlign and EnableAlign methods might make things easier.
So to find say the control above a splitter, would you loop through Controls looking for the control whose Top property is closest to, but still above (smaller value) splitter.Top? Is this the preferred way to maneuover around a Delphi(win32) control container?
Yes, I think that's the way to do it. The control-alignment code is a little convoluted, trying to balance the Align, Anchors, and Constraints properties of many controls at once.
Delphi aligns controls in a certain order. First, it aligns all top-aligned controls. Then bottom, left, right, client, and custom. Finally, it handles non-aligned anchored controls.
For each set of aligned controls, Delphi goes through the Controls array, filtering for controls with the given alignment. In that loop, it inserts the matching controls into a separate list. The order of that list is determined by the coordinates of the controls in the TWinControl.AlignControls.InsertBefore function.
Custom alignment calls CustomAlignInsertBefore to determine where in the alignment list the control should appear. Come to think of it, that might be a solution for you. Handle the parent control's OnAlignInsertBefore event. I've never used that event before; I didn't even know about it before five minutes ago.
-- Rob .
- References:
- Re: TSplitter Persistence problem
- From: Rob Kennedy
- Re: TSplitter Persistence problem
- From: samjones
- Re: TSplitter Persistence problem
- Prev by Date: Re: Looping thru components
- Next by Date: Re: A better file copy function (was Re: copying files )
- Previous by thread: Re: TSplitter Persistence problem
- Next by thread: listbox question
- Index(es):
Relevant Pages
|