mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 01:19:37 +02:00
(Qt): changes in GetWindowRelativePosition (now GetBounds is right after form loading)
git-svn-id: trunk@11678 -
This commit is contained in:
parent
dd8ccf2773
commit
d476d654ea
@ -3144,38 +3144,16 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
function TQtWidgetSet.GetWindowRelativePosition(Handle: HWND; var Left, Top: integer): boolean;
|
||||
var
|
||||
//LeftTop:TPoint;
|
||||
R: TRect;
|
||||
//ParentHandle: THandle;
|
||||
//WindowInfo: PWindowInfo;
|
||||
begin
|
||||
{$ifdef VerboseQtWinAPI}
|
||||
WriteLn('[WinAPI GetWindowRelativePosition]');
|
||||
{$endif}
|
||||
|
||||
QWidget_geometry(TQtMainWindow(Handle).Widget, @R);
|
||||
R := TQtWidget(Handle).getFrameGeometry;
|
||||
Left := R.Left;
|
||||
Top := R.Top;
|
||||
Result := True;
|
||||
|
||||
{ WindowInfo := GetWindowInfo(Handle);
|
||||
if (WindowInfo^.WinControl is TCustomFloatSpinEdit) then
|
||||
Handle := Windows.SendMessage(Handle, UDM_GETBUDDY, 0, 0);
|
||||
if not Windows.GetWindowRect(Handle,@R) then exit;
|
||||
LeftTop.X:=R.Left;
|
||||
LeftTop.Y:=R.Top;
|
||||
ParentHandle:=Windows.GetParent(Handle);
|
||||
if ParentHandle<>0 then
|
||||
begin
|
||||
if not Windows.ScreenToClient(ParentHandle,@LeftTop) then exit;
|
||||
if not GetLCLClientBoundsOffset(ParentHandle, R) then
|
||||
exit;
|
||||
dec(LeftTop.X, R.Left);
|
||||
dec(LeftTop.Y, R.Top);
|
||||
end;
|
||||
Left:=LeftTop.X;
|
||||
Top:=LeftTop.Y;
|
||||
Result := True;}
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user