diff --git a/lcl/graphics.pp b/lcl/graphics.pp index a9f99ed9e9..9aa95d0e90 100644 --- a/lcl/graphics.pp +++ b/lcl/graphics.pp @@ -39,27 +39,28 @@ uses const // The follow colors match the predefined Delphi Colors - clBlack = TColor($000000); - clMaroon = TColor($000080); - clGreen = TColor($008000); - clOlive = TColor($008080); - clNavy = TColor($800000); - clPurple = TColor($800080); - clTeal = TColor($808000); - clGray = TColor($808080); - clSilver = TColor($C0C0C0); - clRed = TColor($0000FF); - clLime = TColor($00FF00); - clYellow = TColor($00FFFF); - clBlue = TColor($FF0000); + clBlack = TColor($000000); + clMaroon = TColor($000080); + clGreen = TColor($008000); + clOlive = TColor($008080); + clNavy = TColor($800000); + clPurple = TColor($800080); + clTeal = TColor($808000); + clGray = TColor($808080); + clSilver = TColor($C0C0C0); + clRed = TColor($0000FF); + clLime = TColor($00FF00); + clYellow = TColor($00FFFF); + clBlue = TColor($FF0000); clFuchsia = TColor($FF00FF); - clAqua = TColor($FFFF00); - clLtGray = TColor($C0C0C0); - clDkGray = TColor($808080); - clWhite = TColor($FFFFFF); - clNone = TColor($1FFFFFFF); + clAqua = TColor($FFFF00); + clLtGray = TColor($C0C0C0); + clDkGray = TColor($808080); + clWhite = TColor($FFFFFF); + clNone = TColor($1FFFFFFF); clDefault = TColor($20000000); - + clCream = TColor($F0FBFF); + //System colors clScrollBar = TColor(SYS_COLOR_BASE or COLOR_SCROLLBAR); clBackground = TColor(SYS_COLOR_BASE or COLOR_BACKGROUND); @@ -1027,6 +1028,9 @@ end. { ============================================================================= $Log$ + Revision 1.79 2003/07/20 06:27:19 mattias + fixed GetWindowRelativePosition + Revision 1.78 2003/07/04 22:06:49 mattias implemented interface graphics diff --git a/lcl/include/interfacebase.inc b/lcl/include/interfacebase.inc index 3f2d0d3915..cea352855d 100644 --- a/lcl/include/interfacebase.inc +++ b/lcl/include/interfacebase.inc @@ -1068,7 +1068,7 @@ function TInterfaceBase.GetWindowRelativePosition(Handle : hwnd; var Left, Top: integer): boolean; // return the position of the left, top coordinate relative to the clientorigin // of its parent. This is normally the Left, Top of a TWinControl. But not -// during moving/sizing +// during moving/sizing. var ChildRect: TRect; ParentLeftTop: TPoint; @@ -1080,6 +1080,8 @@ begin Top:=ChildRect.Top; ParentHandle:=GetParent(Handle); if ParentHandle<>0 then begin + ParentLeftTop.X:=0; + ParentLeftTop.Y:=0; if not ClientToScreen(ParentHandle,ParentLeftTop) then exit; dec(Left,ParentLeftTop.X); dec(Top,ParentLeftTop.Y); @@ -1803,6 +1805,9 @@ end; { ============================================================================= $Log$ + Revision 1.97 2003/07/20 06:27:19 mattias + fixed GetWindowRelativePosition + Revision 1.96 2003/07/06 20:40:34 mattias TWinControl.WmSize/Move now updates interface messages smarter diff --git a/lcl/interfaces/win32/win32callback.inc b/lcl/interfaces/win32/win32callback.inc index d61bf39b99..8070ce6ccc 100644 --- a/lcl/interfaces/win32/win32callback.inc +++ b/lcl/interfaces/win32/win32callback.inc @@ -336,14 +336,21 @@ Begin End; WM_MOVE: Begin - Windows.GetWindowRect(Window, @R); With TLMMove(LMessage) Do Begin Msg := LM_MOVE; // MoveType := WParam; WParam is not defined! MoveType := Move_SourceIsInterface; - XPos := R.Left; - YPos := R.Top; + //If OwnerObject Is TCustomForm then begin + If Windows.GetParent(Window) = 0 then begin + Windows.GetWindowRect(Window,@R); + XPos := R.Left; + YPos := R.Top; + end + Else begin + XPos := LoWord(LParam); + YPos := HiWord(LParam); + end; End; End; //TODO:LM_MOVEPAGE,LM_MOVETOROW,LM_MOVETOCOLUMN @@ -561,6 +568,9 @@ end; { $Log$ + Revision 1.41 2003/07/20 06:27:19 mattias + fixed GetWindowRelativePosition + Revision 1.40 2003/07/07 08:31:54 mattias added an InvalidateClientRectCache to WM_SIZE diff --git a/lcl/interfaces/win32/win32winapi.inc b/lcl/interfaces/win32/win32winapi.inc index e448a67358..74f74e5266 100644 --- a/lcl/interfaces/win32/win32winapi.inc +++ b/lcl/interfaces/win32/win32winapi.inc @@ -1392,10 +1392,21 @@ End; returns the current widget Left, Top, relative to the client origin of its parent ------------------------------------------------------------------------------} -Function TWin32Object.GetWindowRelativePosition(Handle : HWND; - var Left, Top:integer): boolean; +Function TWin32Object.GetWindowRelativePosition(Handle : HWND; var Left, Top:integer): boolean; +var + LeftTop:TPoint; + R: TRect; + ParentHandle: THandle; begin - Result := inherited GetWindowRelativePosition(Handle,Left,Top); + Result:=Windows.GetWindowRect(Handle,@R); + LeftTop.X:=R.Left; + LeftTop.Y:=R.Top; + ParentHandle:=Windows.GetParent(Handle); + if ParentHandle<>0 then + if not Windows.ScreenToClient(ParentHandle,@LeftTop) then + Result:=False; + Left:=LeftTop.X; + Top:=LeftTop.Y; end; Function TWin32Object.GetWindowSize(Handle : hwnd; var Width, Height: integer): boolean; @@ -2352,6 +2363,9 @@ end; { ============================================================================= $Log$ + Revision 1.45 2003/07/20 06:27:19 mattias + fixed GetWindowRelativePosition + Revision 1.44 2003/07/07 07:59:34 mattias made Size_SourceIsInterface a flag