Re: TSplitter Persistence problem



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
.



Relevant Pages

  • Re: ALSA problems with 2.6.18-rc3
    ... restore it to a 'default' condition always. ... if new controls are added by a driver update. ... It's impossible to predict the effect of some mixer controls across the ... This is policy and policy belongs in userspace. ...
    (Linux-Kernel)
  • Re: recover exchange 2000 databse with only .edb files
    ... Controls. ... Be warned though, it is quite expensive (circa US$1,000). ... > able to restore from backup so have performed a fresh install on the same ... I am trying to replace the new mdbdata folder that has ...
    (microsoft.public.exchange2000.admin)
  • Re: How does this work? Picking up a dropped wing with opposite rudder...
    ... >> Point well-taken Dudley... ... >> Of course,, restore the angle of attack by lowering the nose as part of ... the controls at the proper time in a smoothly coordinated use of those ...
    (rec.aviation.student)
  • Re: ALSA problems with 2.6.18-rc3
    ... harm in just adding the -F to that invocation, or will that just restore ... anything you have done & then did an 'alsactl store' to save.. ... new controls are added by a driver update. ... It's impossible to predict the effect of some mixer controls across the ...
    (Linux-Kernel)
  • Re: ALSA problems with 2.6.18-rc3
    ... harm in just adding the -F to that invocation, or will that just restore ... anything you have done & then did an 'alsactl store' to save.. ... new controls are added by a driver update. ... analogue output on emu10k1, and has no effect on digital output, seems rather ...
    (Linux-Kernel)