From 062f7c413721a9260ce8116e16b0f538a1c4f6d6 Mon Sep 17 00:00:00 2001 From: pbfordev Date: Thu, 18 May 2017 22:51:01 +0200 Subject: [PATCH 1/5] Add support for loading wxIconBundle from MS Windows resource --- include/wx/iconbndl.h | 10 +++++ interface/wx/iconbndl.h | 21 +++++++++++ src/common/iconbndl.cpp | 83 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 114 insertions(+) diff --git a/include/wx/iconbndl.h b/include/wx/iconbndl.h index 704c58f248..dee50a4de8 100644 --- a/include/wx/iconbndl.h +++ b/include/wx/iconbndl.h @@ -58,6 +58,11 @@ public: // initializes the bundle with a single icon wxIconBundle(const wxIcon& icon); +#ifdef __WINDOWS__ + // initializes the bundle with the icons from a group icon stored as an MS Windows resource + wxIconBundle(const wxString& resourceName, WXHINSTANCE module); +#endif + // default copy ctor and assignment operator are OK // adds all the icons contained in the file to the collection, @@ -70,6 +75,11 @@ public: void AddIcon(wxInputStream& stream, wxBitmapType type = wxBITMAP_TYPE_ANY); #endif // wxUSE_STREAMS && wxUSE_IMAGE +#ifdef __WINDOWS__ + // loads all the icons from a group icon stored in an MS Windows resource + void AddIcon(const wxString& resourceName, WXHINSTANCE module); +#endif + // adds the icon to the collection, if the collection already // contains an icon with the same width and height, it is // replaced diff --git a/interface/wx/iconbndl.h b/interface/wx/iconbndl.h index 217adb464a..3433663158 100644 --- a/interface/wx/iconbndl.h +++ b/interface/wx/iconbndl.h @@ -68,6 +68,18 @@ public: */ wxIconBundle(const wxIcon& icon); + /** + Initializes the bundle with all sizes of a group icon with @a resourceName + stored as an MS Windows resource in @a module. When @a module is 0, the current + instance is used. + + @see AddIcon(const wxString&, WXHINSTANCE) + + @onlyfor{wxmsw} + @since 3.1.1 + */ + wxIconBundle(const wxString& resourceName, WXHINSTANCE module); + /** Copy constructor. */ @@ -98,6 +110,15 @@ public: */ void AddIcon(wxInputStream& stream, wxBitmapType type = wxBITMAP_TYPE_ANY); + /** + Loads all sizes of a group icon with @a resourceName stored as an MS Windows + resource in @a module. When @a module is 0, the current instance is used. + + @onlyfor{wxmsw} + @since 3.1.1 + */ + void AddIcon(const wxString& resourceName, WXHINSTANCE module); + /** Adds the icon to the collection; if the collection already contains an icon with the same width and height, it is diff --git a/src/common/iconbndl.cpp b/src/common/iconbndl.cpp index 566f1ae813..a51ee3bc52 100644 --- a/src/common/iconbndl.cpp +++ b/src/common/iconbndl.cpp @@ -17,12 +17,16 @@ #include "wx/iconbndl.h" #ifndef WX_PRECOMP + #ifdef __WINDOWS__ + #include "wx/msw/wrapwin.h" + #endif #include "wx/settings.h" #include "wx/log.h" #include "wx/intl.h" #include "wx/bitmap.h" #include "wx/image.h" #include "wx/stream.h" + #include "wx/utils.h" #endif #include "wx/wfstream.h" @@ -89,6 +93,16 @@ wxIconBundle::wxIconBundle(const wxIcon& icon) AddIcon(icon); } +#ifdef __WINDOWS__ + +wxIconBundle::wxIconBundle(const wxString& resourceName, WXHINSTANCE module) + : wxGDIObject() +{ + AddIcon(resourceName, module); +} + +#endif + wxGDIRefData *wxIconBundle::CreateGDIRefData() const { return new wxIconBundleRefData; @@ -192,6 +206,75 @@ void wxIconBundle::AddIcon(wxInputStream& stream, wxBitmapType type) #endif // wxUSE_STREAMS && wxUSE_IMAGE + +#ifdef __WINDOWS__ + +namespace { + +// struct declarations taken from https://msdn.microsoft.com/en-us/library/ms997538.aspx +#pragma pack(push) +#pragma pack(2) + +// individual icon entry in the icon directory resource +typedef struct +{ + BYTE bWidth; // Width, in pixels, of the image + BYTE bHeight; // Height, in pixels, of the image + BYTE bColorCount; // Number of colors in image (0 if >=8bpp) + BYTE bReserved; // Reserved + WORD wPlanes; // Color Planes + WORD wBitCount; // Bits per pixel + DWORD dwBytesInRes; // how many bytes in this resource? + WORD nID; // the ID +} GRPICONDIRENTRY, *LPGRPICONDIRENTRY; + +// icon directory resource +typedef struct +{ + WORD idReserved; // Reserved (must be 0) + WORD idType; // Resource type (1 for icons) + WORD idCount; // How many images? + GRPICONDIRENTRY idEntries[1]; // The entries for each image +} GRPICONDIR, *LPGRPICONDIR; + +#pragma pack(pop) + +} // anonymous namespace + +// Loads all the icons for an icon group (i.e., different sizes of one icon) +// stored as an MS Windows resource. +void wxIconBundle::AddIcon(const wxString& resourceName, WXHINSTANCE module) +{ + const void* data = NULL; + size_t outLen = 0; + + // load the icon directory resource + if ( !wxLoadUserResource(&data, &outLen, resourceName, RT_GROUP_ICON, module) ) + return; + + // load the individual icons referred from the icon directory + const GRPICONDIR* grpIconDir = static_cast(data); + + for ( WORD i = 0; i < grpIconDir->idCount; i++ ) + { + const WORD iconID = grpIconDir->idEntries[i].nID; + + if ( wxLoadUserResource(&data, &outLen, wxString::Format(wxS("#%u"), iconID), RT_ICON, module) ) + { + HICON hIcon = ::CreateIconFromResourceEx(static_cast(const_cast(data)), + static_cast(outLen), TRUE, 0x00030000, 0, 0, LR_DEFAULTCOLOR); + wxIcon icon; + + if ( hIcon && icon.CreateFromHICON(hIcon) ) + AddIcon(icon); + else + wxLogDebug(wxS("Could not create icon from resource with id %u."), iconID); + } + } +} + +#endif + wxIcon wxIconBundle::GetIcon(const wxSize& size, int flags) const { wxASSERT( size == wxDefaultSize || (size.x >= 0 && size.y > 0) ); From 944f3dffd2e49da7097ff8ba3ac0df4f3b400905 Mon Sep 17 00:00:00 2001 From: pbfordev Date: Sat, 20 May 2017 08:43:50 +0200 Subject: [PATCH 2/5] Refactored the previous commit regarding wxIconBundle support for icons stored MS Windows resources. --- include/wx/iconbndl.h | 4 +- include/wx/private/icondir.h | 94 ++++++++++++++++++++++++++++++++++++ src/common/iconbndl.cpp | 54 ++++++--------------- src/common/imagbmp.cpp | 25 +--------- 4 files changed, 113 insertions(+), 64 deletions(-) create mode 100644 include/wx/private/icondir.h diff --git a/include/wx/iconbndl.h b/include/wx/iconbndl.h index dee50a4de8..6fe7eaf9b9 100644 --- a/include/wx/iconbndl.h +++ b/include/wx/iconbndl.h @@ -58,7 +58,7 @@ public: // initializes the bundle with a single icon wxIconBundle(const wxIcon& icon); -#ifdef __WINDOWS__ +#if defined( __WINDOWS__) && wxUSE_ICO_CUR // initializes the bundle with the icons from a group icon stored as an MS Windows resource wxIconBundle(const wxString& resourceName, WXHINSTANCE module); #endif @@ -75,7 +75,7 @@ public: void AddIcon(wxInputStream& stream, wxBitmapType type = wxBITMAP_TYPE_ANY); #endif // wxUSE_STREAMS && wxUSE_IMAGE -#ifdef __WINDOWS__ +#if defined( __WINDOWS__) && wxUSE_ICO_CUR // loads all the icons from a group icon stored in an MS Windows resource void AddIcon(const wxString& resourceName, WXHINSTANCE module); #endif diff --git a/include/wx/private/icondir.h b/include/wx/private/icondir.h new file mode 100644 index 0000000000..00856429f6 --- /dev/null +++ b/include/wx/private/icondir.h @@ -0,0 +1,94 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/private/icondir.h +// Purpose: Declarations of structs used for loading MS icons +// Author: wxWidgets team +// Created: 2017-05-19 +// Copyright: (c) 2017 wxWidgets team +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_PRIVATE_ICONDIR_H_ +#define _WX_PRIVATE_ICONDIR_H_ + +#include "wx/defs.h" // wxUint* declarations + + +// Structs declared here are used for loading group icons from +// .ICO files or MS Windows resources. +// Icon entry and directory structs for .ICO files and +// MS Windows resources are very similar but not identical. + + +#if wxUSE_ICO_CUR + + +#if wxUSE_STREAMS + +// icon entry in .ICO files +struct ICONDIRENTRY +{ + wxUint8 bWidth; // Width of the image + wxUint8 bHeight; // Height of the image (times 2) + wxUint8 bColorCount; // Number of colors in image (0 if >=8bpp) + wxUint8 bReserved; // Reserved + + // these two are different in icons and cursors: + // icon or cursor + wxUint16 wPlanes; // Color Planes or XHotSpot + wxUint16 wBitCount; // Bits per pixel or YHotSpot + + wxUint32 dwBytesInRes; // how many bytes in this resource? + wxUint32 dwImageOffset; // where in the file is this image +}; + +// icon directory in .ICO files +struct ICONDIR +{ + wxUint16 idReserved; // Reserved + wxUint16 idType; // resource type (1 for icons, 2 for cursors) + wxUint16 idCount; // how many images? +}; + +#endif // #if wxUSE_STREAMS + + +#ifdef __WINDOWS__ + +#pragma pack(push) +#pragma pack(2) + +// icon entry in MS Windows resources +struct GRPICONDIRENTRY +{ + wxUint8 bWidth; // Width of the image + wxUint8 bHeight; // Height of the image (times 2) + wxUint8 bColorCount; // Number of colors in image (0 if >=8bpp) + wxUint8 bReserved; // Reserved + + // these two are different in icons and cursors: + // icon or cursor + wxUint16 wPlanes; // Color Planes or XHotSpot + wxUint16 wBitCount; // Bits per pixel or YHotSpot + + wxUint32 dwBytesInRes; // how many bytes in this resource? + + wxUint16 nID; // actual icon resource ID +}; + +// icon directory in MS Windows resources +struct GRPICONDIR +{ + wxUint16 idReserved; // Reserved + wxUint16 idType; // resource type (1 for icons, 2 for cursors) + wxUint16 idCount; // how many images? + GRPICONDIRENTRY idEntries[1]; // The entries for each image +}; + +#pragma pack(pop) + +#endif // #ifdef __WINDOWS__ + + +#endif // #if wxUSE_ICO_CUR + +#endif // #ifndef _WX_PRIVATE_ICONDIR_H_ \ No newline at end of file diff --git a/src/common/iconbndl.cpp b/src/common/iconbndl.cpp index a51ee3bc52..fba7bd8f5d 100644 --- a/src/common/iconbndl.cpp +++ b/src/common/iconbndl.cpp @@ -31,6 +31,10 @@ #include "wx/wfstream.h" +#ifdef __WINDOWS__ + #include "wx/private/icondir.h" +#endif + #include "wx/arrimpl.cpp" WX_DEFINE_OBJARRAY(wxIconArray) @@ -93,7 +97,7 @@ wxIconBundle::wxIconBundle(const wxIcon& icon) AddIcon(icon); } -#ifdef __WINDOWS__ +#if defined( __WINDOWS__) && wxUSE_ICO_CUR wxIconBundle::wxIconBundle(const wxString& resourceName, WXHINSTANCE module) : wxGDIObject() @@ -101,7 +105,7 @@ wxIconBundle::wxIconBundle(const wxString& resourceName, WXHINSTANCE module) AddIcon(resourceName, module); } -#endif +#endif #if defined( __WINDOWS__) && wxUSE_ICO_CUR wxGDIRefData *wxIconBundle::CreateGDIRefData() const { @@ -206,40 +210,7 @@ void wxIconBundle::AddIcon(wxInputStream& stream, wxBitmapType type) #endif // wxUSE_STREAMS && wxUSE_IMAGE - -#ifdef __WINDOWS__ - -namespace { - -// struct declarations taken from https://msdn.microsoft.com/en-us/library/ms997538.aspx -#pragma pack(push) -#pragma pack(2) - -// individual icon entry in the icon directory resource -typedef struct -{ - BYTE bWidth; // Width, in pixels, of the image - BYTE bHeight; // Height, in pixels, of the image - BYTE bColorCount; // Number of colors in image (0 if >=8bpp) - BYTE bReserved; // Reserved - WORD wPlanes; // Color Planes - WORD wBitCount; // Bits per pixel - DWORD dwBytesInRes; // how many bytes in this resource? - WORD nID; // the ID -} GRPICONDIRENTRY, *LPGRPICONDIRENTRY; - -// icon directory resource -typedef struct -{ - WORD idReserved; // Reserved (must be 0) - WORD idType; // Resource type (1 for icons) - WORD idCount; // How many images? - GRPICONDIRENTRY idEntries[1]; // The entries for each image -} GRPICONDIR, *LPGRPICONDIR; - -#pragma pack(pop) - -} // anonymous namespace +#if defined( __WINDOWS__) && wxUSE_ICO_CUR // Loads all the icons for an icon group (i.e., different sizes of one icon) // stored as an MS Windows resource. @@ -250,7 +221,10 @@ void wxIconBundle::AddIcon(const wxString& resourceName, WXHINSTANCE module) // load the icon directory resource if ( !wxLoadUserResource(&data, &outLen, resourceName, RT_GROUP_ICON, module) ) + { + wxLogError(_("Failed to load icons from resource '%s'."), resourceName); return; + } // load the individual icons referred from the icon directory const GRPICONDIR* grpIconDir = static_cast(data); @@ -268,12 +242,16 @@ void wxIconBundle::AddIcon(const wxString& resourceName, WXHINSTANCE module) if ( hIcon && icon.CreateFromHICON(hIcon) ) AddIcon(icon); else - wxLogDebug(wxS("Could not create icon from resource with id %u."), iconID); + wxLogDebug(wxS("Failed to create icon from resource with id %u."), iconID); + } + else + { + wxLogDebug(wxS("Failed to load icon with id %u for group icon resource '%s'."), iconID, resourceName); } } } -#endif +#endif // #if defined( __WINDOWS__) && wxUSE_ICO_CUR wxIcon wxIconBundle::GetIcon(const wxSize& size, int flags) const { diff --git a/src/common/imagbmp.cpp b/src/common/imagbmp.cpp index fd129e47e1..ff2d8976a2 100644 --- a/src/common/imagbmp.cpp +++ b/src/common/imagbmp.cpp @@ -36,6 +36,7 @@ #include "wx/scopedarray.h" #include "wx/scopedptr.h" #include "wx/anidecod.h" +#include "wx/private/icondir.h" // For memcpy #include @@ -1241,30 +1242,6 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxICOHandler, wxBMPHandler); #if wxUSE_STREAMS -struct ICONDIRENTRY -{ - wxUint8 bWidth; // Width of the image - wxUint8 bHeight; // Height of the image (times 2) - wxUint8 bColorCount; // Number of colors in image (0 if >=8bpp) - wxUint8 bReserved; // Reserved - - // these two are different in icons and cursors: - // icon or cursor - wxUint16 wPlanes; // Color Planes or XHotSpot - wxUint16 wBitCount; // Bits per pixel or YHotSpot - - wxUint32 dwBytesInRes; // how many bytes in this resource? - wxUint32 dwImageOffset; // where in the file is this image -}; - -struct ICONDIR -{ - wxUint16 idReserved; // Reserved - wxUint16 idType; // resource type (1 for icons, 2 for cursors) - wxUint16 idCount; // how many images? -}; - - bool wxICOHandler::SaveFile(wxImage *image, wxOutputStream& stream, bool verbose) From 86a2b6eb28ca56cdb3853db1a7deb955b7096635 Mon Sep 17 00:00:00 2001 From: PB Date: Sat, 20 May 2017 09:25:20 +0200 Subject: [PATCH 3/5] Just added a missing start comment token after an #endif --- src/common/iconbndl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/iconbndl.cpp b/src/common/iconbndl.cpp index fba7bd8f5d..c5aa48bdf4 100644 --- a/src/common/iconbndl.cpp +++ b/src/common/iconbndl.cpp @@ -105,7 +105,7 @@ wxIconBundle::wxIconBundle(const wxString& resourceName, WXHINSTANCE module) AddIcon(resourceName, module); } -#endif #if defined( __WINDOWS__) && wxUSE_ICO_CUR +#endif // #if defined( __WINDOWS__) && wxUSE_ICO_CUR wxGDIRefData *wxIconBundle::CreateGDIRefData() const { From 5353bfc963184911e03b4bb763eaf9c2192a2349 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 20 May 2017 17:01:25 +0200 Subject: [PATCH 4/5] Minor whitespace/style fixes Remove extra spaces, harmonize the style of "#endif" comments. --- include/wx/iconbndl.h | 4 ++-- include/wx/private/icondir.h | 15 ++++++--------- interface/wx/iconbndl.h | 29 ++++++++++++++++------------- src/common/iconbndl.cpp | 14 +++++++------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/include/wx/iconbndl.h b/include/wx/iconbndl.h index 6fe7eaf9b9..1fa02a84ff 100644 --- a/include/wx/iconbndl.h +++ b/include/wx/iconbndl.h @@ -58,7 +58,7 @@ public: // initializes the bundle with a single icon wxIconBundle(const wxIcon& icon); -#if defined( __WINDOWS__) && wxUSE_ICO_CUR +#if defined(__WINDOWS__) && wxUSE_ICO_CUR // initializes the bundle with the icons from a group icon stored as an MS Windows resource wxIconBundle(const wxString& resourceName, WXHINSTANCE module); #endif @@ -75,7 +75,7 @@ public: void AddIcon(wxInputStream& stream, wxBitmapType type = wxBITMAP_TYPE_ANY); #endif // wxUSE_STREAMS && wxUSE_IMAGE -#if defined( __WINDOWS__) && wxUSE_ICO_CUR +#if defined(__WINDOWS__) && wxUSE_ICO_CUR // loads all the icons from a group icon stored in an MS Windows resource void AddIcon(const wxString& resourceName, WXHINSTANCE module); #endif diff --git a/include/wx/private/icondir.h b/include/wx/private/icondir.h index 00856429f6..30cba3ae10 100644 --- a/include/wx/private/icondir.h +++ b/include/wx/private/icondir.h @@ -13,15 +13,13 @@ #include "wx/defs.h" // wxUint* declarations -// Structs declared here are used for loading group icons from +// Structs declared here are used for loading group icons from // .ICO files or MS Windows resources. // Icon entry and directory structs for .ICO files and // MS Windows resources are very similar but not identical. - #if wxUSE_ICO_CUR - #if wxUSE_STREAMS // icon entry in .ICO files @@ -49,7 +47,7 @@ struct ICONDIR wxUint16 idCount; // how many images? }; -#endif // #if wxUSE_STREAMS +#endif // wxUSE_STREAMS #ifdef __WINDOWS__ @@ -71,7 +69,7 @@ struct GRPICONDIRENTRY wxUint16 wBitCount; // Bits per pixel or YHotSpot wxUint32 dwBytesInRes; // how many bytes in this resource? - + wxUint16 nID; // actual icon resource ID }; @@ -86,9 +84,8 @@ struct GRPICONDIR #pragma pack(pop) -#endif // #ifdef __WINDOWS__ +#endif // __WINDOWS__ +#endif // wxUSE_ICO_CUR -#endif // #if wxUSE_ICO_CUR - -#endif // #ifndef _WX_PRIVATE_ICONDIR_H_ \ No newline at end of file +#endif // _WX_PRIVATE_ICONDIR_H_ diff --git a/interface/wx/iconbndl.h b/interface/wx/iconbndl.h index 3433663158..ef1fdd9023 100644 --- a/interface/wx/iconbndl.h +++ b/interface/wx/iconbndl.h @@ -69,14 +69,15 @@ public: wxIconBundle(const wxIcon& icon); /** - Initializes the bundle with all sizes of a group icon with @a resourceName - stored as an MS Windows resource in @a module. When @a module is 0, the current - instance is used. - - @see AddIcon(const wxString&, WXHINSTANCE) - - @onlyfor{wxmsw} - @since 3.1.1 + Initializes the bundle with all sizes of a group icon with @a + resourceName stored as an MS Windows resource in @a module. + + When @a module is 0, the current instance is used. + + @see AddIcon(const wxString&, WXHINSTANCE) + + @onlyfor{wxmsw} + @since 3.1.1 */ wxIconBundle(const wxString& resourceName, WXHINSTANCE module); @@ -111,11 +112,13 @@ public: void AddIcon(wxInputStream& stream, wxBitmapType type = wxBITMAP_TYPE_ANY); /** - Loads all sizes of a group icon with @a resourceName stored as an MS Windows - resource in @a module. When @a module is 0, the current instance is used. - - @onlyfor{wxmsw} - @since 3.1.1 + Loads all sizes of a group icon with @a resourceName stored as an MS + Windows resource in @a module. + + When @a module is 0, the current instance is used. + + @onlyfor{wxmsw} + @since 3.1.1 */ void AddIcon(const wxString& resourceName, WXHINSTANCE module); diff --git a/src/common/iconbndl.cpp b/src/common/iconbndl.cpp index c5aa48bdf4..0cb757dc60 100644 --- a/src/common/iconbndl.cpp +++ b/src/common/iconbndl.cpp @@ -19,7 +19,7 @@ #ifndef WX_PRECOMP #ifdef __WINDOWS__ #include "wx/msw/wrapwin.h" - #endif + #endif #include "wx/settings.h" #include "wx/log.h" #include "wx/intl.h" @@ -33,7 +33,7 @@ #ifdef __WINDOWS__ #include "wx/private/icondir.h" -#endif +#endif #include "wx/arrimpl.cpp" WX_DEFINE_OBJARRAY(wxIconArray) @@ -97,7 +97,7 @@ wxIconBundle::wxIconBundle(const wxIcon& icon) AddIcon(icon); } -#if defined( __WINDOWS__) && wxUSE_ICO_CUR +#if defined(__WINDOWS__) && wxUSE_ICO_CUR wxIconBundle::wxIconBundle(const wxString& resourceName, WXHINSTANCE module) : wxGDIObject() @@ -105,7 +105,7 @@ wxIconBundle::wxIconBundle(const wxString& resourceName, WXHINSTANCE module) AddIcon(resourceName, module); } -#endif // #if defined( __WINDOWS__) && wxUSE_ICO_CUR +#endif // defined(__WINDOWS__) && wxUSE_ICO_CUR wxGDIRefData *wxIconBundle::CreateGDIRefData() const { @@ -210,7 +210,7 @@ void wxIconBundle::AddIcon(wxInputStream& stream, wxBitmapType type) #endif // wxUSE_STREAMS && wxUSE_IMAGE -#if defined( __WINDOWS__) && wxUSE_ICO_CUR +#if defined(__WINDOWS__) && wxUSE_ICO_CUR // Loads all the icons for an icon group (i.e., different sizes of one icon) // stored as an MS Windows resource. @@ -228,7 +228,7 @@ void wxIconBundle::AddIcon(const wxString& resourceName, WXHINSTANCE module) // load the individual icons referred from the icon directory const GRPICONDIR* grpIconDir = static_cast(data); - + for ( WORD i = 0; i < grpIconDir->idCount; i++ ) { const WORD iconID = grpIconDir->idEntries[i].nID; @@ -251,7 +251,7 @@ void wxIconBundle::AddIcon(const wxString& resourceName, WXHINSTANCE module) } } -#endif // #if defined( __WINDOWS__) && wxUSE_ICO_CUR +#endif // defined(__WINDOWS__) && wxUSE_ICO_CUR wxIcon wxIconBundle::GetIcon(const wxSize& size, int flags) const { From f5a0893ee9256c4dd8400db3e309ae3117731669 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 20 May 2017 16:58:57 +0200 Subject: [PATCH 5/5] Update comment and change log after MSW wxIconBundle improvements It is now possible to load icons from a bundle too. --- docs/changes.txt | 1 + include/wx/iconbndl.h | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 9fb88e28ad..fda8bba530 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -154,6 +154,7 @@ wxGTK: wxMSW: - Add support for building with Microsoft Visual Studio 2017 (Tobias Taschner). +- Allow loading icons from resources in wxIconBundle (PB). - Enable wxStackWalker in MinGW64 builds. - Fix crash when using wxCHMHelpController() in 64 bit builds (Xlord2). - Fix wxSpinCtrl appearance: show arrows inside the control (Catalin Raceanu). diff --git a/include/wx/iconbndl.h b/include/wx/iconbndl.h index 1fa02a84ff..b1501c324f 100644 --- a/include/wx/iconbndl.h +++ b/include/wx/iconbndl.h @@ -21,9 +21,7 @@ class WXDLLIMPEXP_FWD_BASE wxInputStream; WX_DECLARE_EXPORTED_OBJARRAY(wxIcon, wxIconArray); -// this class can't load bitmaps of type wxBITMAP_TYPE_ICO_RESOURCE, -// if you need them, you have to load them manually and call -// wxIconCollection::AddIcon +// Load icons of multiple sizes from files or resources (MSW-only). class WXDLLIMPEXP_CORE wxIconBundle : public wxGDIObject { public: