git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2407 8e941d3f-bd1b-0410-a28a-d453659cc2b4

This commit is contained in:
dopi
2012-04-25 00:18:19 +00:00
parent 05760e281c
commit 8a7eabb7e2

View File

@ -61,7 +61,6 @@ type
fsFormOldClientRect : TRect; fsFormOldClientRect : TRect;
fsFormOldBorderStyle : TFormBorderStyle; fsFormOldBorderStyle : TFormBorderStyle;
fsLastActiveControl: TWinControl; fsLastActiveControl: TWinControl;
fsFormCloseAction: TCloseAction;
procedure OnResizeTDIPage(Sender : TObject) ; procedure OnResizeTDIPage(Sender : TObject) ;
procedure OnFormClose(Sender: TObject; var CloseAction: TCloseAction); procedure OnFormClose(Sender: TObject; var CloseAction: TCloseAction);
@ -238,7 +237,6 @@ begin
Self.OnResize := @OnResizeTDIPage ; Self.OnResize := @OnResizeTDIPage ;
fsLastActiveControl := nil ; fsLastActiveControl := nil ;
fsFormCloseAction := caNone;
end ; end ;
procedure TTDIPage.RestoreLastFocusedControl ; procedure TTDIPage.RestoreLastFocusedControl ;
@ -345,18 +343,14 @@ begin
if Assigned( fsFormOldCloseEvent ) then if Assigned( fsFormOldCloseEvent ) then
fsFormOldCloseEvent( Sender, CloseAction ); fsFormOldCloseEvent( Sender, CloseAction );
fsFormCloseAction := CloseAction; if (CloseAction <> caFree) and Assigned( fsFormInPage ) then
if Assigned( fsFormInPage ) then
begin
RestoreFormProperties; RestoreFormProperties;
fsFormInPage := nil; fsFormInPage := nil;
// This will force this page be killed by TTDINoteBook.Notification(); // This will force this page be killed by TTDINoteBook.Notification();
if Assigned( Parent ) then if Assigned( Parent ) then
Parent.RemoveComponent( Self ); Parent.RemoveComponent( Self );
end ;
end ; end ;
procedure TTDIPage.SaveFormProperties ; procedure TTDIPage.SaveFormProperties ;
@ -377,14 +371,11 @@ procedure TTDIPage.RestoreFormProperties ;
begin begin
if not Assigned( fsFormInPage ) then exit ; if not Assigned( fsFormInPage ) then exit ;
if ([csDesigning, csDestroying] * fsFormInPage.ComponentState <> []) then
if (fsFormCloseAction = caFree) or // Form will be destroyed ?
([csDesigning, csDestroying] * fsFormInPage.ComponentState <> []) then
exit ; exit ;
fsFormInPage.Visible := False; // This prevent OnFormShow be fired
fsFormInPage.Parent := fsFormOldParent; fsFormInPage.Parent := fsFormOldParent;
fsFormInPage.Visible := False; // Setting new Parent for Visible = True ;
fsFormInPage.Align := fsFormOldAlign; fsFormInPage.Align := fsFormOldAlign;
fsFormInPage.BorderStyle := fsFormOldBorderStyle; fsFormInPage.BorderStyle := fsFormOldBorderStyle;
fsFormInPage.Top := fsFormOldClientRect.Top; fsFormInPage.Top := fsFormOldClientRect.Top;