I have a docksite with 4 dockpanels side by side, like this:
-----------------------------------
| | | | |
| | | | |
| | | | |
| A | B | X | C |
| | | | |
| | | | |
|---------------------------------|
The X is my space zone.
I'm setting the zones to be Kind = zrkFixed by code, like this:
for I := 0 to LMDDockSite1.RootZone.ZoneCount - 1 do
begin
if (LMDDockSite1.RootZone.Zones[i].ResizeKind <> zrkSpace) then
LMDDockSite1.RootZone.Zones[i].ResizeKind := zrkFixed;
end;
I want to reduce the width of X by 20 pixels, like this:
LMDDockSite1.RootZone.Zones[2].Width := LMDDockSite1.RootZone.Zones[2].Width -20;
That works, but not in the way I need, because I'd like it to take away 20 pixels from Panel 'C' (RootZone.Zones[3]), but it takes away the pixels from Panel 'A' (RootZone.Zones[0]).
So, it's doing this:
---------------------------------
| | | | |
| | | | |
| | | | |
| A | B | X | C |
| | | | |
| | | | |
|---------------------------------|
But I'd like to force it to do this:
-----------------------------------
| | | | |
| | | | |
| | | | |
| A | B | X | C |
| | | | |
| | | | |
|---------------------------------|
How can I achive that? How can I force A and B not to change, only C to change when I reduce the size of X?
Is there anyway I can set all the panels (zones) Width individually but all at once, without them affecting the other's dimension, only after I'm done setting up the dimensions?
I appreciate any help
Comments
I created this function that does the trick, based on the original procedure TLMDDockZone.SetWidth:
Basically, if you pass a pSupportZone, it will take away (or add) the Value out of it, or use the classic behaviour if you pass pSupportZone = nil;
procedure TLMDDockZone.IncWidth(const Value: Integer; pSupportZone: TLMDDockZone);
begin
if Value <> 0 then
begin
Inc(FWidth,Value);
FDSize := 0;
FInserting := True;
if pSupportZone <> nil then
pSupportZone.Width := pSupportZone.Width - Value
else
FTree.FSite.UpdateLayout(True);
end;
end;
Thanks