lcl, win32: fix icon for dialog forms (#0012395)

git-svn-id: trunk@17031 -
This commit is contained in:
paul 2008-10-17 08:58:52 +00:00
parent a510f1af3c
commit 3de03aa7ba
5 changed files with 30 additions and 7 deletions

View File

@ -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;
{------------------------------------------------------------------------------

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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;