mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 01:19:16 +02:00
Fixes setting the position of a form in wince
git-svn-id: trunk@15372 -
This commit is contained in:
parent
c80ec36fb2
commit
7f7721db71
@ -415,9 +415,12 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
suppressMove := false;
|
suppressMove := false;
|
||||||
AdaptBounds(AWinControl, IntfLeft, IntfTop, IntfWidth, IntfHeight, suppressMove);
|
AdaptBounds(AWinControl, IntfLeft, IntfTop, IntfWidth, IntfHeight, suppressMove);
|
||||||
// Don't move forms, it doesn't work (yet), I don't know why
|
|
||||||
if not suppressMove and not (AWinControl is TCustomForm) then
|
// Why would we want to supress the move?
|
||||||
MoveWindow(AWinControl.Handle, IntfLeft, IntfTop, IntfWidth, IntfHeight, true);
|
// Form moving is indispensable to have message dialogs
|
||||||
|
|
||||||
|
MoveWindow(AWinControl.Handle, IntfLeft, IntfTop, IntfWidth, IntfHeight, true);
|
||||||
|
|
||||||
LCLControlSizeNeedsUpdate(AWinControl, false);
|
LCLControlSizeNeedsUpdate(AWinControl, false);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -371,6 +371,7 @@ class procedure TWinCEWSCustomForm.SetBounds(const AWinControl: TWinControl;
|
|||||||
var
|
var
|
||||||
SizeRect: Windows.RECT;
|
SizeRect: Windows.RECT;
|
||||||
BorderStyle: TFormBorderStyle;
|
BorderStyle: TFormBorderStyle;
|
||||||
|
WR: Windows.RECT;
|
||||||
begin
|
begin
|
||||||
// the LCL defines the size of a form without border, win32 with.
|
// the LCL defines the size of a form without border, win32 with.
|
||||||
// -> adjust size according to BorderStyle
|
// -> adjust size according to BorderStyle
|
||||||
@ -384,10 +385,26 @@ begin
|
|||||||
BorderStyle := TCustomForm(AWinControl).BorderStyle;
|
BorderStyle := TCustomForm(AWinControl).BorderStyle;
|
||||||
Windows.AdjustWindowRectEx(@SizeRect, BorderStyleToWin32Flags(
|
Windows.AdjustWindowRectEx(@SizeRect, BorderStyleToWin32Flags(
|
||||||
BorderStyle), false, BorderStyleToWin32FlagsEx(BorderStyle));
|
BorderStyle), false, BorderStyleToWin32FlagsEx(BorderStyle));
|
||||||
|
|
||||||
|
if (Application.ApplicationType in [atPDA, atSmartphone, atDefault]) then
|
||||||
|
begin
|
||||||
|
{ We should never move forms which are in full-screen mode }
|
||||||
|
if (BorderStyle <> bsDialog) and (BorderStyle <> bsNone) then Exit;
|
||||||
|
|
||||||
|
{ On normal dialogs we need to take into consideration the size of
|
||||||
|
the window decoration. }
|
||||||
|
if (BorderStyle = bsDialog) then
|
||||||
|
begin
|
||||||
|
Windows.SystemParametersInfo(SPI_GETWORKAREA, 0, @WR, 0);
|
||||||
|
SizeRect.Top := WR.Top;
|
||||||
|
SizeRect.Left := WR.Left;
|
||||||
|
end;
|
||||||
|
{ On borderless Windows we allow the user full control of the window position }
|
||||||
|
end;
|
||||||
|
|
||||||
// rect adjusted, pass to inherited to do real work
|
// rect adjusted, pass to inherited to do real work
|
||||||
TWinCEWSWinControl.SetBounds(AWinControl, ALeft, ATop, SizeRect.Right - SizeRect.Left,
|
TWinCEWSWinControl.SetBounds(AWinControl, SizeRect.Left, SizeRect.Top,
|
||||||
SizeRect.Bottom - SizeRect.Top);
|
SizeRect.Right - SizeRect.Left, SizeRect.Bottom - SizeRect.Top);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TWinCEWSCustomForm.SetIcon(const AForm: TCustomForm; const AIcon: HICON);
|
class procedure TWinCEWSCustomForm.SetIcon(const AForm: TCustomForm; const AIcon: HICON);
|
||||||
|
Loading…
Reference in New Issue
Block a user