diff --git a/ide/ideoptiondefs.pas b/ide/ideoptiondefs.pas index fcd587a5fa..9269e5ed51 100644 --- a/ide/ideoptiondefs.pas +++ b/ide/ideoptiondefs.pas @@ -725,12 +725,14 @@ end; procedure TIDEWindowLayout.GetCurrentPosition; begin + //debugln('TIDEWindowLayout.GetCurrentPosition ',DbgSName(Self),' ',FormID,' ',IDEWindowPlacementNames[WindowPlacement]); case WindowPlacement of iwpRestoreWindowGeometry, iwpRestoreWindowSize: ReadCurrentCoordinates; end; ReadCurrentState; + //debugln('TIDEWindowLayout.GetCurrentPosition ',DbgSName(Self),' ',FormID,' Width=',dbgs(Width)); end; { TIDEWindowLayoutList } diff --git a/lcl/forms.pp b/lcl/forms.pp index 46f1e833c4..dc4f48d088 100644 --- a/lcl/forms.pp +++ b/lcl/forms.pp @@ -340,6 +340,8 @@ type fhtClose ); + { TCustomForm } + TCustomForm = class(TScrollingWinControl) private FActive: Boolean; @@ -440,6 +442,7 @@ type procedure WndProc(var TheMessage : TLMessage); override; function VisibleIsStored: boolean; function ColorIsStored: boolean; override; + procedure DoSetBounds(ALeft, ATop, AWidth, AHeight: integer); override; protected // drag and dock procedure DoDock(NewDockSite: TWinControl; var ARect: TRect); override; diff --git a/lcl/include/customform.inc b/lcl/include/customform.inc index f3b1731813..b93aa5d5a6 100644 --- a/lcl/include/customform.inc +++ b/lcl/include/customform.inc @@ -520,7 +520,7 @@ var OldState: TWindowState; begin {$IFDEF CHECK_POSITION} - DebugLn('[TCustomForm.WMSize] Name=',Name,' Class=',ClassName,' Message.Width=',Message.Width,' Message.Height=',Message.Height); + DebugLn('[TCustomForm.WMSize] ',DbgSName(Self),' Message.SizeType=',dbgs(Message.SizeType),' Message.Width=',dbgs(Message.Width),' Message.Height=',dbgs(Message.Height)); {$ENDIF} Assert(False, 'Trace:WMSIZE in TCustomForm'); if not (csDesigning in ComponentState) then begin @@ -553,6 +553,7 @@ begin FRestoredTop := Top; FRestoredWidth := Width; FRestoredHeight := Height; + //DebugLn('[TCustomForm.WMSize] saving restored bounds ',DbgSName(Self),' ',dbgs(FRestoredWidth),'x',dbgs(FRestoredHeight)); end; End; @@ -886,6 +887,17 @@ begin Result:=(Color<>clBtnFace); end; +procedure TCustomForm.DoSetBounds(ALeft, ATop, AWidth, AHeight: integer); +begin + inherited DoSetBounds(ALeft, ATop, AWidth, AHeight); + if WindowState=wsNormal then begin + FRestoredLeft:=Left; + FRestoredTop:=Top; + FRestoredWidth:=Width; + FRestoredHeight:=Height; + end; +end; + procedure TCustomForm.DoDock(NewDockSite: TWinControl; var ARect: TRect); begin if (NewDockSite<>HostDockSite) then begin @@ -1852,6 +1864,9 @@ end; { ============================================================================= $Log$ + Revision 1.173 2005/01/25 20:07:03 mattias + fixed updating restored form bounds for forms without handle + Revision 1.172 2005/01/21 22:08:11 micha implement restored size, let lazarus ide store restored size