X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7b82d78291036d3abb54f5ae259f5dfb958b9c0c..19e30148e18cc99296b26503c155e5cef59045f4:/src/generic/logg.cpp diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index fd60b1f972..345cb33530 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -52,6 +52,7 @@ #include "wx/file.h" #include "wx/textfile.h" #include "wx/statline.h" +#include "wx/artprov.h" #ifdef __WXMSW__ // for OutputDebugString() @@ -734,8 +735,19 @@ wxLogDialog::wxLogDialog(wxWindow *parent, sizerButtons->Add(m_btnDetails, 0, wxCENTRE | wxTOP, MARGIN/2 - 1); #ifndef __WIN16__ - wxIcon icon = wxTheApp->GetStdIcon((int)(style & wxICON_MASK)); - sizerAll->Add(new wxStaticBitmap(this, -1, icon), 0); + wxBitmap bitmap; + switch ( style & wxICON_MASK ) + { + case wxICON_ERROR: + bitmap = wxArtProvider::GetIcon(wxART_ERROR, wxART_MESSAGE_BOX); break; + case wxICON_INFORMATION: + bitmap = wxArtProvider::GetIcon(wxART_INFORMATION, wxART_MESSAGE_BOX); break; + case wxICON_WARNING: + bitmap = wxArtProvider::GetIcon(wxART_WARNING, wxART_MESSAGE_BOX); break; + default: + wxFAIL_MSG(_T("incorrect log style")); + } + sizerAll->Add(new wxStaticBitmap(this, -1, bitmap), 0); #endif // !Win16 const wxString& message = messages.Last(); @@ -795,11 +807,11 @@ void wxLogDialog::CreateDetailsControls() wxImageList *imageList = new wxImageList(ICON_SIZE, ICON_SIZE); // order should be the same as in the switch below! - static const int icons[] = + static const wxChar* icons[] = { - wxICON_ERROR, - wxICON_EXCLAMATION, - wxICON_INFORMATION + wxART_ERROR, + wxART_WARNING, + wxART_INFORMATION }; bool loadedIcons = TRUE; @@ -807,7 +819,8 @@ void wxLogDialog::CreateDetailsControls() #ifndef __WIN16__ for ( size_t icon = 0; icon < WXSIZEOF(icons); icon++ ) { - wxBitmap bmp = wxTheApp->GetStdIcon(icons[icon]); + wxBitmap bmp = wxArtProvider::GetBitmap(icons[icon], wxART_MESSAGE_BOX, + wxSize(ICON_SIZE, ICON_SIZE)); // This may very well fail if there are insufficient colours available. // Degrade gracefully. @@ -818,8 +831,7 @@ void wxLogDialog::CreateDetailsControls() break; } - wxImage img(bmp); - imageList->Add(img.Rescale(ICON_SIZE, ICON_SIZE).ConvertToBitmap()); + imageList->Add(bmp); } m_listctrl->SetImageList(imageList, wxIMAGE_LIST_SMALL);