X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2bda0e173844e8e0f8acf4e8ad8b5c26e5c6fe5d..cbf97a6cd655d44e6f7b1ffaf35be0c392532ae7:/src/msw/msgdlg.cpp diff --git a/src/msw/msgdlg.cpp b/src/msw/msgdlg.cpp index a3f4628ae1..70a83e908b 100644 --- a/src/msw/msgdlg.cpp +++ b/src/msw/msgdlg.cpp @@ -37,9 +37,7 @@ #define wxDIALOG_DEFAULT_X 300 #define wxDIALOG_DEFAULT_Y 300 -#if !USE_SHARED_LIBRARY IMPLEMENT_CLASS(wxMessageDialog, wxDialog) -#endif wxMessageDialog::wxMessageDialog(wxWindow *parent, const wxString& message, const wxString& caption, long style, const wxPoint& pos) @@ -61,7 +59,11 @@ int wxMessageDialog::ShowModal(void) msStyle = MB_YESNOCANCEL; else msStyle = MB_YESNO; + + if (m_dialogStyle & wxNO_DEFAULT) + msStyle |= MB_DEFBUTTON2; } + if (m_dialogStyle & wxOK) { if (m_dialogStyle & wxCANCEL) @@ -82,8 +84,8 @@ int wxMessageDialog::ShowModal(void) msStyle |= MB_APPLMODAL; else msStyle |= MB_TASKMODAL; - - int msAns = MessageBox(hWnd, (LPCSTR)(const char *)m_message, (LPCSTR)(const char *)m_caption, msStyle); + + int msAns = MessageBox(hWnd, (LPCTSTR)(const wxChar *)m_message, (LPCTSTR)(const wxChar *)m_caption, msStyle); int ans = wxOK; switch (msAns) { @@ -103,36 +105,3 @@ int wxMessageDialog::ShowModal(void) return ans; } -/* - * Common dialogs - * - */ - -// Pop up a message box -int wxMessageBox(const wxString& message, const wxString& caption, const long style, - wxWindow *parent, const int x, const int y) -{ - wxMessageDialog dialog(parent, message, caption, style); - - int ans = dialog.ShowModal(); - switch ( ans ) - { - case wxID_OK: - return wxOK; - break; - case wxID_YES: - return wxYES; - break; - case wxID_NO: - return wxNO; - break; - default: - case wxID_CANCEL: - return wxCANCEL; - break; - } - - return ans; -} - -