X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c50f1fb9226d9260454ccb9c8a67d0be23c2827f..e3e717ecc5add075cd53a04cf24fe27e24170944:/src/generic/msgdlgg.cpp diff --git a/src/generic/msgdlgg.cpp b/src/generic/msgdlgg.cpp index 968cd11290..18bd2ba2ba 100644 --- a/src/generic/msgdlgg.cpp +++ b/src/generic/msgdlgg.cpp @@ -28,8 +28,8 @@ #include "wx/statbmp.h" #include "wx/layout.h" #include "wx/intl.h" - #include "wx/dcclient.h" - #include "wx/settings.h" + #include "wx/icon.h" +# include "wx/app.h" #endif #include @@ -45,15 +45,6 @@ // 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) @@ -78,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 @@ -169,11 +125,11 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, // get the longest caption and also calc the number of buttons size_t nBtn, nButtons = 0; - long width, widthBtnMax = 0; + int width, widthBtnMax = 0; for ( nBtn = 0; nBtn < Btn_Max; nBtn++ ) { if ( buttons[nBtn] ) { nButtons++; - dc.GetTextExtent(buttons[nBtn]->GetLabel(), &width, NULL); + GetTextExtent(buttons[nBtn]->GetLabel(), &width, NULL); if ( width > widthBtnMax ) widthBtnMax = width; }