]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/msgdlgg.cpp
wxMenu compile fix
[wxWidgets.git] / src / generic / msgdlgg.cpp
index 54882a12937c11ddad5273f344d018b31c68d0e0..18bd2ba2ba42323dbcf3a971575bcd9fa9888ba1 100644 (file)
@@ -29,6 +29,7 @@
     #include "wx/layout.h"
     #include "wx/intl.h"
     #include "wx/icon.h"
+#   include "wx/app.h"
 #endif
 
 #include <stdio.h>
 // icons
 // ----------------------------------------------------------------------------
 
-// MSW icons are in the ressources, for all other platforms - in XPM files
-#ifndef __WXMSW__
-    #include "wx/generic/info.xpm"
-    #include "wx/generic/question.xpm"
-    #include "wx/generic/warning.xpm"
-    #include "wx/generic/error.xpm"
-#endif // __WXMSW__
-
-
 #if !USE_SHARED_LIBRARY
 BEGIN_EVENT_TABLE(wxGenericMessageDialog, wxDialog)
         EVT_BUTTON(wxID_YES, wxGenericMessageDialog::OnYes)
@@ -77,43 +69,8 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent,
     wxLayoutConstraints *c;
     SetAutoLayout(TRUE);
 
-    // create an icon
-    enum
-    {
-        Icon_Information,
-        Icon_Question,
-        Icon_Warning,
-        Icon_Error
-    } which;
-
-#ifdef __WXMSW__
-    static char *icons[] =
-    {
-        "wxICON_INFO",
-        "wxICON_QUESTION",
-        "wxICON_WARNING",
-        "wxICON_ERROR",
-    };
-#else // XPM icons
-    static char **icons[] =
-    {
-        info,
-        question,
-        warning,
-        error,
-    };
-#endif // !XPM/XPM
-
-    if ( style & wxICON_EXCLAMATION )
-        which = Icon_Warning;
-    else if ( style & wxICON_HAND )
-        which = Icon_Error;
-    else if ( style & wxICON_QUESTION )
-        which = Icon_Question;
-    else
-        which = Icon_Information;
-
-    wxStaticBitmap *icon = new wxStaticBitmap(this, -1, wxIcon(icons[which]));
+    wxStaticBitmap *icon = new wxStaticBitmap(this, -1,
+                                              wxTheApp->GetStdIcon(style & wxICON_MASK));
     const int iconSize = icon->GetBitmap().GetWidth();
 
     // split the message in lines