From 5773a8736c49923c75370082f69b2f20ee2053cd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 21 Oct 2021 18:14:01 +0100 Subject: [PATCH] Define wxICON_IS_BITMAP when this is indeed the case This symbol is useful for testing if wxIcon can be just converted to wxBitmap, as is the case in all ports except for wxMSW currently. --- docs/doxygen/mainpages/const_cpp.h | 3 +++ include/wx/icon.h | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/docs/doxygen/mainpages/const_cpp.h b/docs/doxygen/mainpages/const_cpp.h index cf3bacf7ab..919e0c54c4 100644 --- a/docs/doxygen/mainpages/const_cpp.h +++ b/docs/doxygen/mainpages/const_cpp.h @@ -401,6 +401,9 @@ more details. defined when compiling code which uses wxWidgets as a DLL/shared library} @itemdef{WXBUILDING, defined when building wxWidgets itself, whether as a static or shared library} +@itemdef{wxICON_IS_BITMAP, + defined in the ports where wxIcon inherits from wxBitmap (all but + wxMSW currently)} @endDefList */ diff --git a/include/wx/icon.h b/include/wx/icon.h index 0849ab98b8..27dc369141 100644 --- a/include/wx/icon.h +++ b/include/wx/icon.h @@ -25,6 +25,8 @@ #if defined(__WXMSW__) #define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_ICO_RESOURCE #include "wx/msw/icon.h" + + #define wxICON_DIFFERENT_FROM_BITMAP #elif defined(__WXMOTIF__) #define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_XPM #include "wx/motif/icon.h" @@ -58,6 +60,10 @@ #include "wx/generic/icon.h" #endif +#ifndef wxICON_DIFFERENT_FROM_BITMAP + #define wxICON_IS_BITMAP +#endif + //----------------------------------------------------------------------------- // wxVariant support //-----------------------------------------------------------------------------