mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 22:37:28 +02:00
lcl, win32: fix icon for dialog forms (#0012395)
git-svn-id: trunk@17031 -
This commit is contained in:
parent
a510f1af3c
commit
3de03aa7ba
@ -180,7 +180,10 @@ begin
|
||||
if HandleAllocated then
|
||||
begin
|
||||
FreeIconHandles;
|
||||
TWSCustomFormClass(WidgetSetClass).SetIcon(Self, SmallIconHandle, BigIconHandle);
|
||||
if BorderStyle <> bsDialog then
|
||||
TWSCustomFormClass(WidgetSetClass).SetIcon(Self, SmallIconHandle, BigIconHandle)
|
||||
else
|
||||
TWSCustomFormClass(WidgetSetClass).SetIcon(Self, 0, 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1260,7 +1263,10 @@ begin
|
||||
// We can not use inherited SetBorderStyle(NewStyle),
|
||||
// because TBorderStyle <> TFormBorderStyle;
|
||||
if HandleAllocated then
|
||||
begin
|
||||
TWSCustomFormClass(WidgetSetClass).SetFormBorderStyle(Self, NewStyle);
|
||||
TWSCustomFormClass(WidgetSetClass).SetIcon(Self, 0, 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -641,8 +641,16 @@ begin
|
||||
end;
|
||||
if (Sender is TCustomForm) then
|
||||
begin
|
||||
SetClassLong(Handle, GCL_HICONSM, LONG(TCustomForm(Sender).SmallIconHandle));
|
||||
SetClassLong(Handle, GCL_HICON, LONG(TCustomForm(Sender).BigIconHandle));
|
||||
if TCustomForm(Sender).BorderStyle <> bsDialog then
|
||||
begin
|
||||
SetClassLong(Handle, GCL_HICONSM, LONG(TCustomForm(Sender).SmallIconHandle));
|
||||
SetClassLong(Handle, GCL_HICON, LONG(TCustomForm(Sender).BigIconHandle));
|
||||
end
|
||||
else
|
||||
begin
|
||||
SetClassLong(Handle, GCL_HICONSM, 0);
|
||||
SetClassLong(Handle, GCL_HICON, 0);
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else
|
||||
|
@ -355,7 +355,6 @@ class procedure TWin32WSCustomForm.SetBorderIcons(const AForm: TCustomForm;
|
||||
begin
|
||||
UpdateWindowStyle(AForm.Handle, CalcBorderIconsFlags(AForm),
|
||||
WS_SYSMENU or WS_MINIMIZEBOX or WS_MAXIMIZEBOX);
|
||||
SetIcon(AForm, 0, 0);
|
||||
end;
|
||||
|
||||
class procedure TWin32WSCustomForm.SetFormBorderStyle(const AForm: TCustomForm;
|
||||
|
@ -589,8 +589,19 @@ begin
|
||||
if Flags = SW_SHOWMAXIMIZED then
|
||||
Windows.SendMessage(Handle, WM_SHOWWINDOW, 1, 0);
|
||||
end;
|
||||
if (Sender Is TCustomForm) then
|
||||
SetClassLong(Handle, GCL_HICON, LONG(TCustomForm(Sender).GetIconHandle));
|
||||
if (Sender is TCustomForm) then
|
||||
begin
|
||||
if TCustomForm(Sender).BorderStyle <> bsDialog then
|
||||
begin
|
||||
SetClassLong(Handle, GCL_HICONSM, LONG(TCustomForm(Sender).SmallIconHandle));
|
||||
SetClassLong(Handle, GCL_HICON, LONG(TCustomForm(Sender).BigIconHandle));
|
||||
end
|
||||
else
|
||||
begin
|
||||
SetClassLong(Handle, GCL_HICONSM, 0);
|
||||
SetClassLong(Handle, GCL_HICON, 0);
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
@ -355,7 +355,6 @@ class procedure TWinCEWSCustomForm.SetBorderIcons(const AForm: TCustomForm;
|
||||
begin
|
||||
UpdateWindowStyle(AForm.Handle, CalcBorderIconsFlags(AForm),
|
||||
WS_SYSMENU or WS_MINIMIZEBOX or WS_MAXIMIZEBOX);
|
||||
SetIcon(AForm, 0, 0);
|
||||
end;
|
||||
|
||||
class procedure TWinCEWSCustomForm.SetFormBorderStyle(const AForm: TCustomForm;
|
||||
|
Loading…
Reference in New Issue
Block a user