From 0e04ef47f695b057dfe4c907e63497ae7ff05572 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 24 Mar 2002 00:19:01 +0000 Subject: [PATCH] move wxApp::GetStdIcon to wxArtProvider git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14746 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/app.h | 9 ++++++++- include/wx/artprov.h | 17 +++++++++++------ include/wx/gtk/app.h | 2 -- include/wx/gtk1/app.h | 2 -- include/wx/mac/app.h | 1 - include/wx/mgl/app.h | 2 -- include/wx/motif/app.h | 2 -- include/wx/msw/app.h | 2 -- include/wx/os2/app.h | 2 -- include/wx/x11/app.h | 2 -- src/gtk/app.cpp | 41 ----------------------------------------- src/gtk1/app.cpp | 41 ----------------------------------------- src/mac/app.cpp | 23 ----------------------- src/mac/carbon/app.cpp | 23 ----------------------- src/mgl/app.cpp | 5 ----- src/motif/app.cpp | 35 ----------------------------------- src/msw/app.cpp | 23 ----------------------- src/os2/app.cpp | 25 ------------------------- src/x11/app.cpp | 5 ----- 19 files changed, 19 insertions(+), 243 deletions(-) diff --git a/include/wx/app.h b/include/wx/app.h index 96f284a7e2..226be5346f 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -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). diff --git a/include/wx/artprov.h b/include/wx/artprov.h index 01cb255a9a..2b1a62b774 100644 --- a/include/wx/artprov.h +++ b/include/wx/artprov.h @@ -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 diff --git a/include/wx/gtk/app.h b/include/wx/gtk/app.h index 3e3d10661e..f8b359a39f 100644 --- a/include/wx/gtk/app.h +++ b/include/wx/gtk/app.h @@ -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(); diff --git a/include/wx/gtk1/app.h b/include/wx/gtk1/app.h index 3e3d10661e..f8b359a39f 100644 --- a/include/wx/gtk1/app.h +++ b/include/wx/gtk1/app.h @@ -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(); diff --git a/include/wx/mac/app.h b/include/wx/mac/app.h index c82ec80f85..272f7b5ef5 100644 --- a/include/wx/mac/app.h +++ b/include/wx/mac/app.h @@ -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; } diff --git a/include/wx/mgl/app.h b/include/wx/mgl/app.h index 0afeceeb97..ec6c5a703f 100644 --- a/include/wx/mgl/app.h +++ b/include/wx/mgl/app.h @@ -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(); diff --git a/include/wx/motif/app.h b/include/wx/motif/app.h index d3bc19d40b..f80b97c121 100644 --- a/include/wx/motif/app.h +++ b/include/wx/motif/app.h @@ -57,8 +57,6 @@ public: virtual bool OnInitGui(); - virtual wxIcon GetStdIcon(int which) const; - // implementation from now on // -------------------------- diff --git a/include/wx/msw/app.h b/include/wx/msw/app.h index c6e1348015..852a5b50e7 100644 --- a/include/wx/msw/app.h +++ b/include/wx/msw/app.h @@ -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; } diff --git a/include/wx/os2/app.h b/include/wx/os2/app.h index 2c631f5494..b198140509 100644 --- a/include/wx/os2/app.h +++ b/include/wx/os2/app.h @@ -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; } diff --git a/include/wx/x11/app.h b/include/wx/x11/app.h index 74a3eb0e59..aec0f3e367 100644 --- a/include/wx/x11/app.h +++ b/include/wx/x11/app.h @@ -58,8 +58,6 @@ public: virtual bool OnInitGui(); - virtual wxIcon GetStdIcon(int which) const; - // implementation from now on // -------------------------- diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index 65710bb24d..20050e11b6 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -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) diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp index 65710bb24d..20050e11b6 100644 --- a/src/gtk1/app.cpp +++ b/src/gtk1/app.cpp @@ -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) diff --git a/src/mac/app.cpp b/src/mac/app.cpp index d662578090..6a0e5292e5 100644 --- a/src/mac/app.cpp +++ b/src/mac/app.cpp @@ -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")); diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index d662578090..6a0e5292e5 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -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")); diff --git a/src/mgl/app.cpp b/src/mgl/app.cpp index 3eea2d9844..089ea11ad0 100644 --- a/src/mgl/app.cpp +++ b/src/mgl/app.cpp @@ -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 diff --git a/src/motif/app.cpp b/src/motif/app.cpp index 9a09d850b4..17699b8d08 100644 --- a/src/motif/app.cpp +++ b/src/motif/app.cpp @@ -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 // ---------------------------------------------------------------------------- diff --git a/src/msw/app.cpp b/src/msw/app.cpp index e77f69dd65..0a9940008a 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -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)) diff --git a/src/os2/app.cpp b/src/os2/app.cpp index 80790f9f67..f48fa2d453 100644 --- a/src/os2/app.cpp +++ b/src/os2/app.cpp @@ -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) { diff --git a/src/x11/app.cpp b/src/x11/app.cpp index 165942382a..b41f8955e7 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -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 -- 2.47.2