X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/19abd352e88f9ae4bd41ee41dbce86212015ce8f..357d2b88cb15fa0ad97b1676fdbc88c2abc85451:/src/common/artprov.cpp diff --git a/src/common/artprov.cpp b/src/common/artprov.cpp index d871eea0ec..267b1c2c3b 100644 --- a/src/common/artprov.cpp +++ b/src/common/artprov.cpp @@ -160,7 +160,7 @@ wxArtProvider::~wxArtProvider() sm_providers->Insert(provider); } -/*static*/ void wxArtProvider::Insert(wxArtProvider *provider) +/*static*/ void wxArtProvider::PushBack(wxArtProvider *provider) { CommonAddingProvider(); sm_providers->Append(provider); @@ -303,6 +303,36 @@ wxArtProvider::~wxArtProvider() return icon; } +/* static */ +wxIcon wxArtProvider::GetMessageBoxIcon(int flags) +{ + wxIcon icon; + switch ( flags & wxICON_MASK ) + { + default: + wxFAIL_MSG(_T("incorrect message box icon flags")); + // fall through + + case wxICON_ERROR: + icon = wxArtProvider::GetIcon(wxART_ERROR, wxART_MESSAGE_BOX); + break; + + case wxICON_INFORMATION: + icon = wxArtProvider::GetIcon(wxART_INFORMATION, wxART_MESSAGE_BOX); + break; + + case wxICON_WARNING: + icon = wxArtProvider::GetIcon(wxART_WARNING, wxART_MESSAGE_BOX); + break; + + case wxICON_QUESTION: + icon = wxArtProvider::GetIcon(wxART_QUESTION, wxART_MESSAGE_BOX); + break; + } + + return icon; +} + #if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__) #include extern GtkIconSize wxArtClientToIconSize(const wxArtClient& client); @@ -348,6 +378,16 @@ wxArtProvider::~wxArtProvider() #endif // GTK+ 2/else } +/* static */ +bool wxArtProvider::HasNativeProvider() +{ +#ifdef __WXGTK20__ + return true; +#else + return false; +#endif +} + // ---------------------------------------------------------------------------- // deprecated wxArtProvider methods // ---------------------------------------------------------------------------- @@ -378,6 +418,13 @@ wxArtProvider::~wxArtProvider() #endif // WXWIN_COMPATIBILITY_2_6 +#if WXWIN_COMPATIBILITY_2_8 +/* static */ void wxArtProvider::Insert(wxArtProvider *provider) +{ + PushBack(provider); +} +#endif // WXWIN_COMPATIBILITY_2_8 + // ============================================================================ // wxArtProviderModule // ============================================================================