mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 21:16:05 +02:00
remove usage of fcompstyle
git-svn-id: trunk@6186 -
This commit is contained in:
parent
d4ce99fba2
commit
4a54d8d57f
@ -421,7 +421,7 @@ var
|
|||||||
AWinControl: TWinControl;
|
AWinControl: TWinControl;
|
||||||
begin
|
begin
|
||||||
AMenu := AMenuObject as TMenu;
|
AMenu := AMenuObject as TMenu;
|
||||||
if AMenu.FCompStyle = csMainMenu then
|
if AMenu is TMainMenu then
|
||||||
begin
|
begin
|
||||||
AWinControl := TWinControl(AMenu.Owner);
|
AWinControl := TWinControl(AMenu.Owner);
|
||||||
Windows.SetMenu(AWinControl.Handle, AMenu.Handle);
|
Windows.SetMenu(AWinControl.Handle, AMenu.Handle);
|
||||||
@ -736,6 +736,9 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.297 2004/11/02 17:48:19 micha
|
||||||
|
remove usage of fcompstyle
|
||||||
|
|
||||||
Revision 1.296 2004/11/01 18:20:21 micha
|
Revision 1.296 2004/11/01 18:20:21 micha
|
||||||
set default icon instead of lcl icon which actually is a bitmap
|
set default icon instead of lcl icon which actually is a bitmap
|
||||||
|
|
||||||
|
@ -291,27 +291,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TWin32WSWinControl.SetBounds(const AWinControl: TWinControl; const ALeft, ATop, AWidth, AHeight: Integer);
|
procedure TWin32WSWinControl.SetBounds(const AWinControl: TWinControl; const ALeft, ATop, AWidth, AHeight: Integer);
|
||||||
var
|
|
||||||
SizeRect: Windows.RECT;
|
|
||||||
begin
|
begin
|
||||||
with SizeRect do
|
TWin32WidgetSet(InterfaceObject).ResizeChild(AWinControl, ALeft, ATop, AWidth, AHeight);
|
||||||
begin
|
|
||||||
Left := ALeft;
|
|
||||||
Top := ATop;
|
|
||||||
Right := ALeft + AWidth;
|
|
||||||
Bottom := ATop + AHeight;
|
|
||||||
end;
|
|
||||||
case AWinControl.FCompStyle of
|
|
||||||
csForm:
|
|
||||||
begin
|
|
||||||
// the LCL defines the size of a form without border, win32 with.
|
|
||||||
// -> adjust size according to BorderStyle
|
|
||||||
Windows.AdjustWindowRectEx(@SizeRect, BorderStyleToWin32Flags(TCustomForm(AWinControl).BorderStyle), false,
|
|
||||||
BorderStyleToWin32FlagsEx(TCustomForm(AWinControl).BorderStyle));
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
TWin32WidgetSet(InterfaceObject).ResizeChild(AWinControl, ALeft, ATop,
|
|
||||||
SizeRect.Right - SizeRect.Left, SizeRect.Bottom - SizeRect.Top);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TWin32WSWinControl.SetColor(const AWinControl: TWinControl);
|
procedure TWin32WSWinControl.SetColor(const AWinControl: TWinControl);
|
||||||
|
@ -84,6 +84,8 @@ type
|
|||||||
const ABorderIcons: TBorderIcons); override;
|
const ABorderIcons: TBorderIcons); override;
|
||||||
class function CreateHandle(const AWinControl: TWinControl;
|
class function CreateHandle(const AWinControl: TWinControl;
|
||||||
const AParams: TCreateParams): HWND; override;
|
const AParams: TCreateParams): HWND; override;
|
||||||
|
class procedure SetBounds(const AWinControl: TWinControl; const ALeft, ATop,
|
||||||
|
AWidth, AHeight: Integer); override;
|
||||||
class procedure SetIcon(const AForm: TCustomForm; const AIcon: HICON); override;
|
class procedure SetIcon(const AForm: TCustomForm; const AIcon: HICON); override;
|
||||||
class procedure ShowModal(const ACustomForm: TCustomForm); override;
|
class procedure ShowModal(const ACustomForm: TCustomForm); override;
|
||||||
end;
|
end;
|
||||||
@ -235,6 +237,29 @@ begin
|
|||||||
WS_SYSMENU or WS_MINIMIZEBOX or WS_MAXIMIZEBOX);
|
WS_SYSMENU or WS_MINIMIZEBOX or WS_MAXIMIZEBOX);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TWin32WSCustomForm.SetBounds(const AWinControl: TWinControl;
|
||||||
|
const ALeft, ATop, AWidth, AHeight: Integer);
|
||||||
|
var
|
||||||
|
SizeRect: Windows.RECT;
|
||||||
|
begin
|
||||||
|
// the LCL defines the size of a form without border, win32 with.
|
||||||
|
// -> adjust size according to BorderStyle
|
||||||
|
with SizeRect do
|
||||||
|
begin
|
||||||
|
Left := ALeft;
|
||||||
|
Top := ATop;
|
||||||
|
Right := ALeft + AWidth;
|
||||||
|
Bottom := ATop + AHeight;
|
||||||
|
end;
|
||||||
|
Windows.AdjustWindowRectEx(@SizeRect, BorderStyleToWin32Flags(
|
||||||
|
TCustomForm(AWinControl).BorderStyle), false,
|
||||||
|
BorderStyleToWin32FlagsEx(TCustomForm(AWinControl).BorderStyle));
|
||||||
|
|
||||||
|
// rect adjusted, pass to inherited to do real work
|
||||||
|
TWin32WSWinControl.SetBounds(AWinControl, ALeft, ATop, SizeRect.Right - SizeRect.Left,
|
||||||
|
SizeRect.Bottom - SizeRect.Top);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TWin32WSCustomForm.SetIcon(const AForm: TCustomForm; const AIcon: HICON);
|
procedure TWin32WSCustomForm.SetIcon(const AForm: TCustomForm; const AIcon: HICON);
|
||||||
begin
|
begin
|
||||||
SendMessage(AForm.Handle, WM_SETICON, ICON_BIG, Windows.LoadIcon(MainInstance, 'MAINICON'));
|
SendMessage(AForm.Handle, WM_SETICON, ICON_BIG, Windows.LoadIcon(MainInstance, 'MAINICON'));
|
||||||
|
Loading…
Reference in New Issue
Block a user