mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-08 05:58:14 +02:00
win32: also put Icon flags into AdjustWindowRectEx calls, cleanup
git-svn-id: trunk@29757 -
This commit is contained in:
parent
786385251f
commit
412dc4ecc9
@ -291,27 +291,21 @@ begin
|
|||||||
// -> adjust size according to BorderStyle
|
// -> adjust size according to BorderStyle
|
||||||
SizeRect := AForm.BoundsRect;
|
SizeRect := AForm.BoundsRect;
|
||||||
BorderStyle := GetDesigningBorderStyle(AForm);
|
BorderStyle := GetDesigningBorderStyle(AForm);
|
||||||
Windows.AdjustWindowRectEx(@SizeRect, BorderStyleToWin32Flags(
|
Windows.AdjustWindowRectEx(@SizeRect, BorderStyleToWin32Flags(BorderStyle) or CalcBorderIconsFlags(AForm),
|
||||||
BorderStyle), false, BorderStyleToWin32FlagsEx(BorderStyle));
|
False, BorderStyleToWin32FlagsEx(BorderStyle) or CalcBorderIconsFlagsEx(AForm));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CustomFormWndProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam; LParam: Windows.LParam): LResult; stdcall;
|
function CustomFormWndProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam; LParam: Windows.LParam): LResult; stdcall;
|
||||||
|
|
||||||
procedure LCLFormSizeToWin32Size(Form: TCustomForm; var AWidth, AHeight: Integer);
|
procedure LCLFormSizeToWin32Size(AForm: TCustomForm; var AWidth, AHeight: Integer);
|
||||||
var
|
var
|
||||||
SizeRect: Windows.RECT;
|
SizeRect: Windows.RECT;
|
||||||
BorderStyle: TFormBorderStyle;
|
BorderStyle: TFormBorderStyle;
|
||||||
begin
|
begin
|
||||||
with SizeRect do
|
SizeRect := Classes.Rect(0, 0, AWidth, AHeight);
|
||||||
begin
|
BorderStyle := GetDesigningBorderStyle(AForm);
|
||||||
Left := 0;
|
Windows.AdjustWindowRectEx(@SizeRect, BorderStyleToWin32Flags(BorderStyle) or CalcBorderIconsFlags(AForm),
|
||||||
Top := 0;
|
False, BorderStyleToWin32FlagsEx(BorderStyle) or CalcBorderIconsFlagsEx(AForm));
|
||||||
Right := AWidth;
|
|
||||||
Bottom := AHeight;
|
|
||||||
end;
|
|
||||||
BorderStyle := GetDesigningBorderStyle(Form);
|
|
||||||
Windows.AdjustWindowRectEx(@SizeRect, BorderStyleToWin32Flags(
|
|
||||||
BorderStyle), false, BorderStyleToWin32FlagsEx(BorderStyle));
|
|
||||||
AWidth := SizeRect.Right - SizeRect.Left;
|
AWidth := SizeRect.Right - SizeRect.Left;
|
||||||
AHeight := SizeRect.Bottom - SizeRect.Top;
|
AHeight := SizeRect.Bottom - SizeRect.Top;
|
||||||
end;
|
end;
|
||||||
@ -551,16 +545,12 @@ var
|
|||||||
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
|
||||||
with SizeRect do
|
SizeRect := Bounds(ALeft, ATop, AWidth, AHeight);
|
||||||
begin
|
|
||||||
Left := ALeft;
|
|
||||||
Top := ATop;
|
|
||||||
Right := ALeft + AWidth;
|
|
||||||
Bottom := ATop + AHeight;
|
|
||||||
end;
|
|
||||||
BorderStyle := GetDesigningBorderStyle(TCustomForm(AWinControl));
|
BorderStyle := GetDesigningBorderStyle(TCustomForm(AWinControl));
|
||||||
Windows.AdjustWindowRectEx(@SizeRect, BorderStyleToWin32Flags(
|
Windows.AdjustWindowRectEx(@SizeRect, BorderStyleToWin32Flags(BorderStyle) or CalcBorderIconsFlags(AForm),
|
||||||
BorderStyle), false, BorderStyleToWin32FlagsEx(BorderStyle));
|
False, BorderStyleToWin32FlagsEx(BorderStyle) or CalcBorderIconsFlagsEx(AForm));
|
||||||
|
|
||||||
|
|
||||||
L := ALeft;
|
L := ALeft;
|
||||||
T := ATop;
|
T := ATop;
|
||||||
|
Loading…
Reference in New Issue
Block a user