mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 23:30:30 +02:00
fixed GetWindowRelativePosition
git-svn-id: trunk@4412 -
This commit is contained in:
parent
7a24ee840a
commit
413480e395
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user