When I have a vertical zone that includes 2 panels, how can I set its width?
Doing Zone.Width := new value; has no effect.
For example, in the layout below:
<sitelist>
<site id="Form14.LMDDockSite1">
<zone kind="HORZ">
<zone kind="PANEL" id="Form14.p1" visible="1" size="159" dsize="0.1691924044841"/>
<zone kind="VERT" size="200" dsize="0.212722489132922">
<zone kind="PANEL" id="Form14.p2" visible="1" size="202" dsize="0.696356275303644"/>
<zone kind="PANEL" id="Form14.p3" visible="1" size="150" dsize="0.303643724696356"/>
</zone>
<zone kind="VERT" size="391" dsize="0.415957446808511">
<zone kind="PANEL" id="Form14.p4" visible="1" size="115" dsize="0.333333333333333"/>
<zone kind="HORZ" size="116" dsize="0.299065420560747">
<zone kind="PANEL" id="Form14.p5" visible="1" size="178" dsize="0.46304347826087"/>
<zone kind="PANEL" id="Form14.p6" visible="1" size="207" dsize="0.53695652173913"/>
</zone>
<zone kind="PANEL" id="Form14.p7" visible="1" size="115" dsize="0.367601246105919"/>
</zone>
<zone kind="PANEL" id="Form14.p8" visible="1" size="190" dsize="0.202127659574468"/>
</zone>
</site>
</sitelist>
I want to set the value of the first VERT zone in that xml, the one that contains both panels 'p2' and 'p3', so that the width of both panels are set together (and the width of the next VERT zone is automatically reduced).
How can that be achieved?
Comments
I suppose the trick is to navigate through its parent (and the parent's parent) until you find the first zone with the kind you are looking for.
In my case, this was enough:
lz := LMDDockSite1.FindZoneByClient(p2);
if Lz <> nil then
BEGIN
if lz.Kind = zkPanel then
begin
if lz.Parent <> nil then
lz := lz.Parent;
end;
Lz.Width := 300;
Thanks for the help.
Alex