dockmanager example: workaround for caHide bug in gtk2

git-svn-id: trunk@24840 -
This commit is contained in:
dodi 2010-04-23 00:56:42 +00:00
parent 7f820b7f3f
commit 81c834bc16
3 changed files with 8 additions and 18 deletions

1
.gitattributes vendored
View File

@ -2889,7 +2889,6 @@ examples/dockmanager/package/felasticsite.pas svneol=native#text/pascal
examples/dockmanager/package/ffloatingsite.lfm svneol=native#text/plain examples/dockmanager/package/ffloatingsite.lfm svneol=native#text/plain
examples/dockmanager/package/ffloatingsite.lrs svneol=native#text/plain examples/dockmanager/package/ffloatingsite.lrs svneol=native#text/plain
examples/dockmanager/package/ffloatingsite.pas svneol=native#text/pascal examples/dockmanager/package/ffloatingsite.pas svneol=native#text/pascal
examples/dockmanager/package/pin.ico -text
examples/dockmanager/package/umakesite.pas svneol=native#text/pascal examples/dockmanager/package/umakesite.pas svneol=native#text/pascal
examples/dockmanager/package/uminirestore.pas svneol=native#text/pascal examples/dockmanager/package/uminirestore.pas svneol=native#text/pascal
examples/dockmanager/package/zoneheader.inc svneol=native#text/pascal examples/dockmanager/package/zoneheader.inc svneol=native#text/pascal

View File

@ -94,42 +94,33 @@ end;
procedure TFloatingSite.FormClose(Sender: TObject; procedure TFloatingSite.FormClose(Sender: TObject;
var CloseAction: TCloseAction); var CloseAction: TCloseAction);
{$IFDEF new}
var var
i: integer; i: integer;
ctl: TControl; ctl: TControl;
frm: TCustomForm absolute ctl; //frm: TCustomForm absolute ctl;
{$ELSE}
{$ENDIF}
begin begin
(* When an empty site is closed, it shall be freed. (* When an empty site is closed, it shall be freed.
Otherwise the clients must be handled (close forms). Otherwise the clients must be handled (close forms?).
Currently closing docked forms leads to exceptions :-(
*) *)
{$IFDEF new}
//BeginFormUpdate;
for i := DockClientCount - 1 downto 0 do begin for i := DockClientCount - 1 downto 0 do begin
ctl := DockClients[i]; ctl := DockClients[i];
ctl.Visible := False; //handle rest invisibly
ctl.ManualDock(nil); ctl.ManualDock(nil);
//Application.ReleaseComponent(ctl); --- Exception! //if ctl.Owner = nil then ctl.Destroy; //seems to work, but is this okay???
{
//Application.ReleaseComponent(ctl); --- Exception!
if ctl <> nil then begin if ctl <> nil then begin
//verify that both Parent and HostDockSite are cleared //verify that both Parent and HostDockSite are cleared
DebugLn('Undocked %s P=%p H=%p', [ctl.Name, DebugLn('Undocked %s P=%p H=%p', [ctl.Name,
pointer(ctl.Parent), pointer(ctl.HostDockSite)]); pointer(ctl.Parent), pointer(ctl.HostDockSite)]);
end; end;
if ctl is TCustomForm then begin if ctl is TCustomForm then begin
//frm.Close; --- Exception! frm.Close; //--- Exception!
//frm.Release; --- also Exception! //frm.Release; --- also Exception!
//frm.Hide; //frm.Hide;
end; end;
}
end; end;
//EndFormUpdate;
{$ELSE}
if DockClientCount > 0 then
CloseAction := caHide
else
{$ENDIF}
CloseAction := caFree; CloseAction := caFree;
end; end;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B