]> git.saurik.com Git - wxWidgets.git/commitdiff
move wxApp::GetStdIcon to wxArtProvider
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 24 Mar 2002 00:19:01 +0000 (00:19 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 24 Mar 2002 00:19:01 +0000 (00:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14746 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

19 files changed:
include/wx/app.h
include/wx/artprov.h
include/wx/gtk/app.h
include/wx/gtk1/app.h
include/wx/mac/app.h
include/wx/mgl/app.h
include/wx/motif/app.h
include/wx/msw/app.h
include/wx/os2/app.h
include/wx/x11/app.h
src/gtk/app.cpp
src/gtk1/app.cpp
src/mac/app.cpp
src/mac/carbon/app.cpp
src/mgl/app.cpp
src/motif/app.cpp
src/msw/app.cpp
src/os2/app.cpp
src/x11/app.cpp

index 96f284a7e2c2137c05759f2bb305547cc4bfceee..226be5346fe3ef330bec37e4be7d84914a4fdc3c 100644 (file)
@@ -47,6 +47,10 @@ class WXDLLEXPORT wxCmdLineParser;
     #include "wx/log.h"
 #endif
 
+#if WXWIN_COMPATIBILITY_2_2
+    #include "wx/icon.h"
+#endif
+
 // ----------------------------------------------------------------------------
 // constants
 // ----------------------------------------------------------------------------
@@ -275,10 +279,13 @@ public:
 #endif // wxUSE_LOG
 
 #if wxUSE_GUI
+
+  #if WXWIN_COMPATIBILITY_2_2
         // get the standard icon used by wxWin dialogs - this allows the user
         // to customize the standard dialogs. The 'which' parameter is one of
         // wxICON_XXX values
-    virtual wxIcon GetStdIcon(int which) const = 0;
+    virtual wxIcon GetStdIcon(int WXUNUSED(which)) const { return wxNullIcon; }
+  #endif
 
         // Get display mode that is used use. This is only used in framebuffer wxWin ports
         // (such as wxMGL).
index 01cb255a9a61463476565f60fac08ad351ba59ca..2b1a62b774cd7e329dc50c51969a0341fbd4c8ef 100644 (file)
@@ -34,14 +34,15 @@ typedef wxString wxArtID;
 // Art clients
 // ----------------------------------------------------------------------------
 
-#define wxART_TOOLBAR                       _T("toolbar_C")
-#define wxART_MENU                          _T("menu_C")
-#define wxART_FRAME_ICON                    _T("frame_icon_C")
+#define wxART_TOOLBAR                  _T("toolbar_C")
+#define wxART_MENU                     _T("menu_C")
+#define wxART_FRAME_ICON               _T("frame_icon_C")
 
-#define wxART_CMN_DIALOG                    _T("cmn_dialog_C")
-#define wxART_HELP_BROWSER                  _T("help_browser_C")
+#define wxART_CMN_DIALOG               _T("cmn_dialog_C")
+#define wxART_HELP_BROWSER             _T("help_browser_C")
+#define wxART_MESSAGE_BOX              _T("message_box_C")
 
-#define wxART_OTHER                         _T("other_C")
+#define wxART_OTHER                    _T("other_C")
 
 // ----------------------------------------------------------------------------
 // Art IDs
@@ -73,6 +74,10 @@ typedef wxString wxArtID;
 #define wxART_NORMAL_FILE              _T("normal_file")
 #define wxART_TICK_MARK                _T("tick")
 #define wxART_CROSS_MARK               _T("cross")
+#define wxART_ERROR                    _T("error")
+#define wxART_QUESTION                 _T("question")
+#define wxART_WARNING                  _T("warning")
+#define wxART_INFORMATION              _T("information")
 
 // ----------------------------------------------------------------------------
 // wxArtProvider class
index 3e3d10661e01fe49c54055264de12c207f38427e..f8b359a39f27a58b02dfce21dbd122c39cbfd7ee 100644 (file)
@@ -48,8 +48,6 @@ public:
     virtual void Dispatch();
     virtual bool Yield(bool onlyIfNeeded = FALSE);
 
-    virtual wxIcon GetStdIcon(int which) const;
-
     // implementation only from now on
     void OnIdle( wxIdleEvent &event );
     bool SendIdleEvents();
index 3e3d10661e01fe49c54055264de12c207f38427e..f8b359a39f27a58b02dfce21dbd122c39cbfd7ee 100644 (file)
@@ -48,8 +48,6 @@ public:
     virtual void Dispatch();
     virtual bool Yield(bool onlyIfNeeded = FALSE);
 
-    virtual wxIcon GetStdIcon(int which) const;
-
     // implementation only from now on
     void OnIdle( wxIdleEvent &event );
     bool SendIdleEvents();
index c82ec80f85545c40e129f678c9d0b16d98d74a93..272f7b5ef5dff14b0d7519140d877968d594e249 100644 (file)
@@ -53,7 +53,6 @@ class WXDLLEXPORT wxApp: public wxAppBase
   virtual void Dispatch() ;
   virtual bool Yield(bool onlyIfNeeded = FALSE);
 
-  virtual wxIcon GetStdIcon(int which) const;
   virtual void SetPrintMode(int mode) { m_printMode = mode; }
   virtual int GetPrintMode() const { return m_printMode; }
 
index 0afeceeb9761e92d2624f64eefcbdb1d075729ae..ec6c5a703f64d6623d7d4bf7ec5b207068d86413 100644 (file)
@@ -48,8 +48,6 @@ public:
     virtual bool Pending();
     virtual void Dispatch();
 
-    virtual wxIcon GetStdIcon(int which) const;
-
     // implementation only from now on
     void OnIdle(wxIdleEvent &event);
     bool SendIdleEvents();
index d3bc19d40b8441bc48959658c1024291854fdb3f..f80b97c121a07ab74f5308fdf3f3cd3e940e0eb3 100644 (file)
@@ -57,8 +57,6 @@ public:
     
     virtual bool OnInitGui();
     
-    virtual wxIcon GetStdIcon(int which) const;
-    
     // implementation from now on
     // --------------------------
     
index c6e1348015ff006f8b9d87f0a8306ba66f122892..852a5b50e7fedc71f0bdd74383e4065b25d1847e 100644 (file)
@@ -43,8 +43,6 @@ public:
     virtual void Dispatch();
     virtual bool Yield(bool onlyIfNeeded = FALSE);
 
-    virtual wxIcon GetStdIcon(int which) const;
-
     virtual void SetPrintMode(int mode) { m_printMode = mode; }
     virtual int GetPrintMode() const { return m_printMode; }
 
index 2c631f549436135da974b3873152dec514a0cc7a..b1981405099c4ef3da0d15633489841b9349bd22 100644 (file)
@@ -78,8 +78,6 @@ public:
     virtual void Dispatch(void);
     virtual bool Yield(bool onlyIfNeeded = FALSE);
 
-    virtual wxIcon GetStdIcon(int which) const;
-
     virtual void SetPrintMode(int mode) { m_nPrintMode = mode; }
     virtual int  GetPrintMode(void) const { return m_nPrintMode; }
 
index 74a3eb0e59a1ca08c8e81c7947773f947cf8f97b..aec0f3e3675af7a35a2b3b29adddd5dd29f80cfd 100644 (file)
@@ -58,8 +58,6 @@ public:
     
     virtual bool OnInitGui();
     
-    virtual wxIcon GetStdIcon(int which) const;
-    
     // implementation from now on
     // --------------------------
     
index 65710bb24dccd17b3d952cbcc99b9e22ab6e898b..20050e11b609230f04ae803efd256a6699c72b11 100644 (file)
@@ -821,47 +821,6 @@ int wxEntry( int argc, char *argv[] )
     return retValue;
 }
 
-#ifndef __WXUNIVERSAL__
-
-// XPM hack: make the arrays const
-#define static static const
-
-#include "wx/gtk/info.xpm"
-#include "wx/gtk/error.xpm"
-#include "wx/gtk/question.xpm"
-#include "wx/gtk/warning.xpm"
-
-#undef static
-
-wxIcon wxApp::GetStdIcon(int which) const
-{
-    switch(which)
-    {
-        case wxICON_INFORMATION:
-            return wxIcon(info_xpm);
-
-        case wxICON_QUESTION:
-            return wxIcon(question_xpm);
-
-        case wxICON_EXCLAMATION:
-            return wxIcon(warning_xpm);
-
-        default:
-            wxFAIL_MSG(wxT("requested non existent standard icon"));
-            // still fall through
-
-        case wxICON_HAND:
-            return wxIcon(error_xpm);
-    }
-}
-#else
-wxIcon wxApp::GetStdIcon(int which) const
-{
-    return wxTheme::Get()->GetRenderer()->GetStdIcon(which);
-}
-#endif // !__WXUNIVERSAL__
-
-
 #ifdef __WXDEBUG__
 
 void wxApp::OnAssert(const wxChar *file, int line, const wxChar *msg)
index 65710bb24dccd17b3d952cbcc99b9e22ab6e898b..20050e11b609230f04ae803efd256a6699c72b11 100644 (file)
@@ -821,47 +821,6 @@ int wxEntry( int argc, char *argv[] )
     return retValue;
 }
 
-#ifndef __WXUNIVERSAL__
-
-// XPM hack: make the arrays const
-#define static static const
-
-#include "wx/gtk/info.xpm"
-#include "wx/gtk/error.xpm"
-#include "wx/gtk/question.xpm"
-#include "wx/gtk/warning.xpm"
-
-#undef static
-
-wxIcon wxApp::GetStdIcon(int which) const
-{
-    switch(which)
-    {
-        case wxICON_INFORMATION:
-            return wxIcon(info_xpm);
-
-        case wxICON_QUESTION:
-            return wxIcon(question_xpm);
-
-        case wxICON_EXCLAMATION:
-            return wxIcon(warning_xpm);
-
-        default:
-            wxFAIL_MSG(wxT("requested non existent standard icon"));
-            // still fall through
-
-        case wxICON_HAND:
-            return wxIcon(error_xpm);
-    }
-}
-#else
-wxIcon wxApp::GetStdIcon(int which) const
-{
-    return wxTheme::Get()->GetRenderer()->GetStdIcon(which);
-}
-#endif // !__WXUNIVERSAL__
-
-
 #ifdef __WXDEBUG__
 
 void wxApp::OnAssert(const wxChar *file, int line, const wxChar *msg)
index d662578090cd44373d2e0356c3c90019370bc91f..6a0e5292e574fd88941559121bfa4b9b40fb2491 100644 (file)
@@ -953,29 +953,6 @@ void wxApp::DeletePendingObjects()
   }
 }
 
-wxIcon
-wxApp::GetStdIcon(int which) const
-{
-    switch(which)
-    {
-        case wxICON_INFORMATION:
-            return wxIcon("wxICON_INFO");
-
-        case wxICON_QUESTION:
-            return wxIcon("wxICON_QUESTION");
-
-        case wxICON_EXCLAMATION:
-            return wxIcon("wxICON_WARNING");
-
-        default:
-            wxFAIL_MSG(wxT("requested non existent standard icon"));
-            // still fall through
-
-        case wxICON_HAND:
-            return wxIcon("wxICON_ERROR");
-    }
-}
-
 void wxExit()
 {
     wxLogError(_("Fatal error: exiting"));
index d662578090cd44373d2e0356c3c90019370bc91f..6a0e5292e574fd88941559121bfa4b9b40fb2491 100644 (file)
@@ -953,29 +953,6 @@ void wxApp::DeletePendingObjects()
   }
 }
 
-wxIcon
-wxApp::GetStdIcon(int which) const
-{
-    switch(which)
-    {
-        case wxICON_INFORMATION:
-            return wxIcon("wxICON_INFO");
-
-        case wxICON_QUESTION:
-            return wxIcon("wxICON_QUESTION");
-
-        case wxICON_EXCLAMATION:
-            return wxIcon("wxICON_WARNING");
-
-        default:
-            wxFAIL_MSG(wxT("requested non existent standard icon"));
-            // still fall through
-
-        case wxICON_HAND:
-            return wxIcon("wxICON_ERROR");
-    }
-}
-
 void wxExit()
 {
     wxLogError(_("Fatal error: exiting"));
index 3eea2d98449b069b90dda001a4e5c0d84fcce61c..089ea11ad09b0509d2d74dde3440f459b57f3506 100644 (file)
@@ -444,11 +444,6 @@ bool wxApp::Initialize()
     return TRUE;
 }
 
-wxIcon wxApp::GetStdIcon(int which) const
-{
-    return wxTheme::Get()->GetRenderer()->GetStdIcon(which);
-}
-
 void wxApp::CleanUp()
 {
 #if wxUSE_LOG
index 9a09d850b4309233d57784b9ea36db5c1fffb5fa..17699b8d08ef42918dfca16ba7a5dffa0fdadea3 100644 (file)
@@ -745,41 +745,6 @@ bool wxApp::Yield(bool onlyIfNeeded)
     return TRUE;
 }
 
-// TODO use XmGetPixmap (?) to get the really standard icons!
-
-// XPM hack: make the arrays const
-#define static static const
-
-#include "wx/generic/info.xpm"
-#include "wx/generic/error.xpm"
-#include "wx/generic/question.xpm"
-#include "wx/generic/warning.xpm"
-
-#undef static
-
-wxIcon
-wxApp::GetStdIcon(int which) const
-{
-    switch(which)
-    {
-        case wxICON_INFORMATION:
-            return wxIcon(info_xpm);
-
-        case wxICON_QUESTION:
-            return wxIcon(question_xpm);
-
-        case wxICON_EXCLAMATION:
-            return wxIcon(warning_xpm);
-
-        default:
-            wxFAIL_MSG("requested non existent standard icon");
-            // still fall through
-
-        case wxICON_HAND:
-            return wxIcon(error_xpm);
-    }
-}
-
 // ----------------------------------------------------------------------------
 // accessors for C modules
 // ----------------------------------------------------------------------------
index e77f69dd6518234b5e776f3796d4e182753fd1eb..0a9940008afdbe707b044d9ea1e6c10cd448cfa5 100644 (file)
@@ -1481,29 +1481,6 @@ void wxWakeUpIdle()
 
 //-----------------------------------------------------------------------------
 
-wxIcon
-wxApp::GetStdIcon(int which) const
-{
-    switch(which)
-    {
-        case wxICON_INFORMATION:
-            return wxIcon("wxICON_INFO");
-
-        case wxICON_QUESTION:
-            return wxIcon("wxICON_QUESTION");
-
-        case wxICON_EXCLAMATION:
-            return wxIcon("wxICON_WARNING");
-
-        default:
-            wxFAIL_MSG(wxT("requested non existent standard icon"));
-            // still fall through
-
-        case wxICON_HAND:
-            return wxIcon("wxICON_ERROR");
-    }
-}
-
 // For some reason, with MSVC++ 1.5, WinMain isn't linked in properly
 // if in a separate file. So include it here to ensure it's linked.
 #if (defined(__VISUALC__) && !defined(__WIN32__)) || (defined(__GNUWIN32__) && !defined(__TWIN32__) && !defined(WXMAKINGDLL))
index 80790f9f670141d552edea16f2bfa7e0e9de8dbd..f48fa2d453b4f459ba7543495927d80dee385483 100644 (file)
@@ -1175,31 +1175,6 @@ bool wxApp::Yield(bool onlyIfNeeded)
     return TRUE;
 } // end of wxYield
 
-wxIcon wxApp::GetStdIcon(
-  int                               nWhich
-) const
-{
-    switch(nWhich)
-    {
-        case wxICON_INFORMATION:
-            return wxIcon("wxICON_INFO");
-
-        case wxICON_QUESTION:
-            return wxIcon("wxICON_QUESTION");
-
-        case wxICON_EXCLAMATION:
-            return wxIcon("wxICON_WARNING");
-
-        default:
-            wxFAIL_MSG(wxT("requested non existent standard icon"));
-            // still fall through
-
-        case wxICON_HAND:
-            return wxIcon("wxICON_ERROR");
-    }
-    return wxIcon("wxICON_ERROR");
-} // end of wxApp::GetStdIcon
-
 int wxApp::AddSocketHandler(int handle, int mask,
                             void (*callback)(void*), void * gsock)
 {
index 165942382a5b571b75974d16365222476484e550..b41f8955e75124c41c6ba2441d6569a196d0b7b7 100644 (file)
@@ -1004,11 +1004,6 @@ bool wxApp::Yield(bool onlyIfNeeded)
     return TRUE;
 }
 
-wxIcon wxApp::GetStdIcon(int which) const
-{
-    return wxTheme::Get()->GetRenderer()->GetStdIcon(which);
-}
-
 void wxApp::OnAssert(const wxChar *file, int line, const wxChar *msg)
 {
     // While the GUI isn't working that well, just print out the