[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi] Skeleton::InitIcon() cleanup
From: |
Vadim Zeitlin |
Subject: |
[lmi] Skeleton::InitIcon() cleanup |
Date: |
Thu, 7 Aug 2008 22:57:05 +0200 |
Hello,
I'd like to submit a very simple patch removing another "WX !!" marker,
this time from Skeleton::InitIcon():
--- lmi.rc 2008-01-01 18:30:08 +0000
+++ lmi.rc 2008-08-07 20:38:30 +0000
@@ -31,6 +31,9 @@
// binary. Other icons are treated the same way here, not because they
// must be, but simply as a matter of consistency and convenience.
+// Also allow referring to the icon by its normal name in the code:
+lmi ICON "lmi.ico"
+
// Get stock cursors etc. Unconventionally, write this #include
// directive at the end of this file, to prevent any ICON statements
// in the included file from preceding the application's icon--which
--- main_wx.cpp 2008-08-02 03:47:24 +0000
+++ main_wx.cpp 2008-08-07 20:54:16 +0000
@@ -481,20 +481,7 @@
void Skeleton::InitIcon()
{
-#ifdef LMI_MSW
- // If a wxIcon rather than a wxIconBundle were used here, then
- // lossy shrinkage of a large icon could occur on msw; this
- // approach uses a smaller icon in the '.ico' file instead.
- //
- // WX !! However, this method:
-// frame_->SetIcons(wxIconBundle("mondrian.ico", wxBITMAP_TYPE_ICO));
- // displays a black-and-white icon in the alt-tab task switcher
- // on msw, even though the 256-color 32x32 icon comes first in the
- // '.ico' file; but this shows the color icon:
- frame_->SetIcons(wxICON(AAAAAAAA));
-#else // Not defined LMI_MSW.
frame_->SetIcon(wxICON(lmi));
-#endif // Not defined LMI_MSW.
}
void Skeleton::InitMenuBar()
As you can see I simply removed the comments because just setting the icon
works exactly as expected with any recent wx version, i.e. the 16*16
version is used in the title bar while the 32*32 one in the Alt-Tab dialog
and no downscaling occurs.
The only potentially discussable thing this patch does is to embed the
icon twice in the .rc file but I think that the few extra bytes in a
multi-megabyte file are worth the ability to refer to the icon in the code
by its real name, thus avoid #ifdefs.
Thanks,
VZ
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi] Skeleton::InitIcon() cleanup,
Vadim Zeitlin <=