From 8a7eabb7e2bd53e4be8f614fa1b012ee3640d36c Mon Sep 17 00:00:00 2001 From: dopi Date: Wed, 25 Apr 2012 00:18:19 +0000 Subject: [PATCH] git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2407 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/tdi/tdiclass.pas | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/components/tdi/tdiclass.pas b/components/tdi/tdiclass.pas index 4c5001836..4d3727954 100644 --- a/components/tdi/tdiclass.pas +++ b/components/tdi/tdiclass.pas @@ -61,7 +61,6 @@ type fsFormOldClientRect : TRect; fsFormOldBorderStyle : TFormBorderStyle; fsLastActiveControl: TWinControl; - fsFormCloseAction: TCloseAction; procedure OnResizeTDIPage(Sender : TObject) ; procedure OnFormClose(Sender: TObject; var CloseAction: TCloseAction); @@ -238,7 +237,6 @@ begin Self.OnResize := @OnResizeTDIPage ; fsLastActiveControl := nil ; - fsFormCloseAction := caNone; end ; procedure TTDIPage.RestoreLastFocusedControl ; @@ -345,18 +343,14 @@ begin if Assigned( fsFormOldCloseEvent ) then fsFormOldCloseEvent( Sender, CloseAction ); - fsFormCloseAction := CloseAction; - - if Assigned( fsFormInPage ) then - begin + if (CloseAction <> caFree) and Assigned( fsFormInPage ) then RestoreFormProperties; - fsFormInPage := nil; + fsFormInPage := nil; - // This will force this page be killed by TTDINoteBook.Notification(); - if Assigned( Parent ) then - Parent.RemoveComponent( Self ); - end ; + // This will force this page be killed by TTDINoteBook.Notification(); + if Assigned( Parent ) then + Parent.RemoveComponent( Self ); end ; procedure TTDIPage.SaveFormProperties ; @@ -377,14 +371,11 @@ procedure TTDIPage.RestoreFormProperties ; begin if not Assigned( fsFormInPage ) then exit ; - - if (fsFormCloseAction = caFree) or // Form will be destroyed ? - ([csDesigning, csDestroying] * fsFormInPage.ComponentState <> []) then + if ([csDesigning, csDestroying] * fsFormInPage.ComponentState <> []) then exit ; + fsFormInPage.Visible := False; // This prevent OnFormShow be fired fsFormInPage.Parent := fsFormOldParent; - fsFormInPage.Visible := False; // Setting new Parent for Visible = True ; - fsFormInPage.Align := fsFormOldAlign; fsFormInPage.BorderStyle := fsFormOldBorderStyle; fsFormInPage.Top := fsFormOldClientRect.Top;