]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/logg.cpp
added missing wxListItem copy ctor to wxMSW, moved wxListItem to the header
[wxWidgets.git] / src / generic / logg.cpp
index fd60b1f97223c4937c6e0eedfbf70e46939f2009..254439bfc4b600ccffcf93810d946fd949163767 100644 (file)
@@ -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);
@@ -1092,7 +1104,7 @@ void wxLogTextCtrl::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
     wxString msg;
     TimeStamp(&msg);
 
-#if defined(__WXMAC__) && !defined(__DARWIN__)
+#if defined(__WXMAC__)
     // VZ: this is a bug in wxMac, it *must* accept '\n' as new line, the
     //     translation must be done in wxTextCtrl, not here! (FIXME)
     msg << szString << wxT('\r');