mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 23:59:07 +02:00
dockmanager example: save/restore true Orientation for layout
git-svn-id: trunk@25042 -
This commit is contained in:
parent
0e85fb36ac
commit
e317411db1
@ -45,7 +45,7 @@ uses
|
|||||||
|
|
||||||
procedure TMasterSite.buCreateFormClick(Sender: TObject);
|
procedure TMasterSite.buCreateFormClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
DockMaster.CreateDockable('', True, True);
|
DockMaster.CreateDockable('', True, True, True);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMasterSite.buDumpClick(Sender: TObject);
|
procedure TMasterSite.buDumpClick(Sender: TObject);
|
||||||
|
@ -237,7 +237,7 @@ begin
|
|||||||
//name it
|
//name it
|
||||||
Client.Caption := cap;
|
Client.Caption := cap;
|
||||||
TryRename(Client, n);
|
TryRename(Client, n);
|
||||||
DockMaster.MakeDockable(Client, fWrap);
|
DockMaster.MakeDockable(Client, fWrap, True);
|
||||||
Result := Client;
|
Result := Client;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -1218,6 +1218,11 @@ procedure TEasyTree.LoadFromStream(Stream: TStream);
|
|||||||
NewCtl.Width := ZoneRec.BottomRight.x;
|
NewCtl.Width := ZoneRec.BottomRight.x;
|
||||||
NewCtl.Height := ZoneRec.BottomRight.y;
|
NewCtl.Height := ZoneRec.BottomRight.y;
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF oldOrient}
|
||||||
|
{$ELSE}
|
||||||
|
NewZone.Orientation := doNoOrient;
|
||||||
|
NewCtl.DockOrientation := ZoneRec.Orientation;
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
while NewLvl < PrevLvl do begin
|
while NewLvl < PrevLvl do begin
|
||||||
PrevZone := PrevZone.Parent;
|
PrevZone := PrevZone.Parent;
|
||||||
@ -1280,8 +1285,13 @@ procedure TEasyTree.SaveToStream(Stream: TStream);
|
|||||||
child := Zone.ChildControl;
|
child := Zone.ChildControl;
|
||||||
if child = nil then
|
if child = nil then
|
||||||
ZoneName := ''
|
ZoneName := ''
|
||||||
else
|
else begin
|
||||||
ZoneName := SaveDockedControl(child); //ctrl or entire site
|
ZoneName := SaveDockedControl(child); //ctrl or entire site
|
||||||
|
{$IFDEF oldOrient}
|
||||||
|
{$ELSE}
|
||||||
|
ZoneRec.Orientation := child.DockOrientation;
|
||||||
|
{$ENDIF}
|
||||||
|
end;
|
||||||
//write descriptor
|
//write descriptor
|
||||||
Stream.Write(ZoneRec, sizeof(ZoneRec));
|
Stream.Write(ZoneRec, sizeof(ZoneRec));
|
||||||
Stream.WriteAnsiString(ZoneName);
|
Stream.WriteAnsiString(ZoneName);
|
||||||
@ -2106,12 +2116,6 @@ var
|
|||||||
begin
|
begin
|
||||||
(* Save typename and clients.
|
(* Save typename and clients.
|
||||||
*)
|
*)
|
||||||
{
|
|
||||||
if DockManager <> nil then
|
|
||||||
Result := Name //reload by name
|
|
||||||
else
|
|
||||||
}
|
|
||||||
begin
|
|
||||||
ss := TStringStream.Create('');
|
ss := TStringStream.Create('');
|
||||||
try
|
try
|
||||||
ss.WriteByte(CustomDockSiteID);
|
ss.WriteByte(CustomDockSiteID);
|
||||||
@ -2121,7 +2125,6 @@ begin
|
|||||||
finally
|
finally
|
||||||
ss.Free;
|
ss.Free;
|
||||||
end;
|
end;
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomDockSite.SaveToStream(strm: TStream);
|
procedure TCustomDockSite.SaveToStream(strm: TStream);
|
||||||
@ -2153,7 +2156,7 @@ begin
|
|||||||
cn := strm.ReadAnsiString;
|
cn := strm.ReadAnsiString;
|
||||||
ctl := DockLoader.ReloadControl(cn, self);
|
ctl := DockLoader.ReloadControl(cn, self);
|
||||||
if ctl <> nil then
|
if ctl <> nil then
|
||||||
ctl.ManualDock(self);
|
ctl.ManualDock(self); //orientation???
|
||||||
//make visible?
|
//make visible?
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user