remove usage of fcompstyle

git-svn-id: trunk@6186 -
This commit is contained in:
micha 2004-11-02 17:48:19 +00:00
parent d4ce99fba2
commit 4a54d8d57f
3 changed files with 30 additions and 21 deletions

View File

@ -421,7 +421,7 @@ var
AWinControl: TWinControl;
begin
AMenu := AMenuObject as TMenu;
if AMenu.FCompStyle = csMainMenu then
if AMenu is TMainMenu then
begin
AWinControl := TWinControl(AMenu.Owner);
Windows.SetMenu(AWinControl.Handle, AMenu.Handle);
@ -736,6 +736,9 @@ end;
{
$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
set default icon instead of lcl icon which actually is a bitmap

View File

@ -291,27 +291,8 @@ begin
end;
procedure TWin32WSWinControl.SetBounds(const AWinControl: TWinControl; const ALeft, ATop, AWidth, AHeight: Integer);
var
SizeRect: Windows.RECT;
begin
with SizeRect do
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);
TWin32WidgetSet(InterfaceObject).ResizeChild(AWinControl, ALeft, ATop, AWidth, AHeight);
end;
procedure TWin32WSWinControl.SetColor(const AWinControl: TWinControl);

View File

@ -84,6 +84,8 @@ type
const ABorderIcons: TBorderIcons); override;
class function CreateHandle(const AWinControl: TWinControl;
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 ShowModal(const ACustomForm: TCustomForm); override;
end;
@ -235,6 +237,29 @@ begin
WS_SYSMENU or WS_MINIMIZEBOX or WS_MAXIMIZEBOX);
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);
begin
SendMessage(AForm.Handle, WM_SETICON, ICON_BIG, Windows.LoadIcon(MainInstance, 'MAINICON'));