From c48d0d37c22b74ce0ff9f324c7426892b5d57332 Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Sun, 21 Sep 2008 21:09:36 +0000 Subject: [PATCH] complete rev55777 with some icon.h modifications which I missed in the first place git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55779 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/cocoa/icon.h | 10 ++++------ include/wx/icon.h | 28 ++++++++++++++++------------ include/wx/motif/icon.h | 13 +++---------- include/wx/os2/icon.h | 4 ++-- 4 files changed, 25 insertions(+), 30 deletions(-) diff --git a/include/wx/cocoa/icon.h b/include/wx/cocoa/icon.h index f054181a9a..ebeb2975f8 100644 --- a/include/wx/cocoa/icon.h +++ b/include/wx/cocoa/icon.h @@ -25,18 +25,16 @@ public: wxIcon(const char* const* data) { CreateFromXpm(data); } wxIcon(const char bits[], int width , int height ); - wxIcon(const wxString& name, int flags = wxBITMAP_TYPE_ICON_RESOURCE, - int desiredWidth = -1, int desiredHeight = -1); + wxIcon(const wxString& name, int flags = wxICON_DEFAULT_TYPE, + int desiredWidth = -1, int desiredHeight = -1); wxIcon(const wxIconLocation& loc) { LoadFile(loc.GetFileName(), wxBITMAP_TYPE_ICON); } virtual ~wxIcon(); - bool LoadFile(const wxString& name, wxBitmapType flags /* = wxBITMAP_TYPE_ICON_RESOURCE */ , - int desiredWidth /* = -1 */ , int desiredHeight = -1); - bool LoadFile(const wxString& name, wxBitmapType flags = wxBITMAP_TYPE_ICON_RESOURCE ) - { return LoadFile( name , flags , -1 , -1 ) ; } + bool LoadFile(const wxString& name, wxBitmapType flags = wxICON_DEFAULT_TYPE, + int desiredWidth=-1, int desiredHeight=-1); bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; } diff --git a/include/wx/icon.h b/include/wx/icon.h index bc4a80ad7e..5dca8e8b13 100644 --- a/include/wx/icon.h +++ b/include/wx/icon.h @@ -15,47 +15,51 @@ #include "wx/iconloc.h" +// a more readable way to tell +#define wxICON_SCREEN_DEPTH (-1) + + // the wxICON_DEFAULT_TYPE (the wxIcon equivalent of wxBITMAP_DEFAULT_TYPE) // constant defines the default argument value for wxIcon ctor and wxIcon::LoadFile() // functions. -#if defined(__WXMSW__) - #define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_ICO_RESOURCE -#elif defined(__WXMGL__) - #define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_ICO_RESOURCE -#elif defined(__WXMAC__) && wxOSX_USE_COCOA_OR_CARBON - #define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_ICON_RESOURCE -#else - #define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_XPM -#endif - -// a more readable way to tell -#define wxICON_SCREEN_DEPTH (-1) #if defined(__WXPALMOS__) + #define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_XPM #include "wx/generic/icon.h" #elif defined(__WXMSW__) + #define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_ICO_RESOURCE #include "wx/msw/icon.h" #elif defined(__WXMOTIF__) + #define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_XPM #include "wx/motif/icon.h" #elif defined(__WXGTK20__) + #define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_XPM #include "wx/generic/icon.h" #elif defined(__WXGTK__) + #define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_XPM #include "wx/generic/icon.h" #elif defined(__WXX11__) + #define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_XPM #include "wx/generic/icon.h" #elif defined(__WXMGL__) + #define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_ICO_RESOURCE #include "wx/generic/icon.h" #elif defined(__WXDFB__) + #define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_XPM #include "wx/generic/icon.h" #elif defined(__WXMAC__) #if wxOSX_USE_COCOA_OR_CARBON + #define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_ICON_RESOURCE #include "wx/osx/icon.h" #else + #define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_XPM #include "wx/generic/icon.h" #endif #elif defined(__WXCOCOA__) + #define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_ICON_RESOURCE #include "wx/cocoa/icon.h" #elif defined(__WXPM__) + #define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_ICO_RESOURCE #include "wx/os2/icon.h" #endif diff --git a/include/wx/motif/icon.h b/include/wx/motif/icon.h index e2aef577cb..4b9e089fba 100644 --- a/include/wx/motif/icon.h +++ b/include/wx/motif/icon.h @@ -29,7 +29,7 @@ public: wxIcon(char **data); #endif - wxIcon(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_XPM, + wxIcon(const wxString& name, wxBitmapType type = wxICON_DEFAULT_TYPE, int desiredWidth = -1, int desiredHeight = -1) { LoadFile(name, type, desiredWidth, desiredHeight); @@ -42,15 +42,8 @@ public: virtual ~wxIcon(); - bool LoadFile(const wxString& name, wxBitmapType type, - int desiredWidth, int desiredHeight = -1); - - // unhide base class LoadFile() - virtual bool LoadFile(const wxString& name, - wxBitmapType type = wxBITMAP_TYPE_XPM) - { - return LoadFile(name, type, -1, -1); - } + bool LoadFile(const wxString& name, wxBitmapType type = wxICON_DEFAULT_TYPE, + int desiredWidth = -1, int desiredHeight = -1); // create from bitmap (which should have a mask unless it's monochrome): // there shouldn't be any implicit bitmap -> icon conversion (i.e. no diff --git a/include/wx/os2/icon.h b/include/wx/os2/icon.h index 7ed62517f6..a67359aac8 100644 --- a/include/wx/os2/icon.h +++ b/include/wx/os2/icon.h @@ -49,7 +49,7 @@ public: wxIcon(char** ppData) { CreateIconFromXpm(wx_const_cast(const char* const*, ppData)); } #endif wxIcon( const wxString& rName - ,wxBitmapType lFlags = wxBITMAP_TYPE_ICO_RESOURCE + ,wxBitmapType lFlags = wxICON_DEFAULT_TYPE ,int nDesiredWidth = -1 ,int nDesiredHeight = -1 ); @@ -61,7 +61,7 @@ public: virtual ~wxIcon(); bool LoadFile( const wxString& rName - ,wxBitmapType lFlags = wxBITMAP_TYPE_ICO_RESOURCE + ,wxBitmapType lFlags = wxICON_DEFAULT_TYPE ,int nDesiredWidth = -1 ,int nDesiredHeight = -1 ); -- 2.47.2