X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6670f56440ae9209b3e2e51e06acf3bc5aaf1905..c017416682938c39547836051c0fad74db45e8a0:/src/os2/msgdlg.cpp diff --git a/src/os2/msgdlg.cpp b/src/os2/msgdlg.cpp index 003c506618..81dc82639f 100644 --- a/src/os2/msgdlg.cpp +++ b/src/os2/msgdlg.cpp @@ -9,23 +9,20 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "msgdlg.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#ifndef WX_PRECOMP -#include -#include "wx/defs.h" -#include "wx/utils.h" -#include "wx/dialog.h" -#include "wx/app.h" #include "wx/msgdlg.h" -#include "wx/math.h" + +#ifndef WX_PRECOMP + #include + #include "wx/utils.h" + #include "wx/dialog.h" + #include "wx/app.h" + #include "wx/math.h" #endif +#include "wx/testing.h" #include "wx/os2/private.h" #include @@ -36,20 +33,10 @@ IMPLEMENT_CLASS(wxMessageDialog, wxDialog) -wxMessageDialog::wxMessageDialog( wxWindow* WXUNUSED(pParent), - const wxString& rsMessage, - const wxString& rsCaption, - long lStyle, - const wxPoint& WXUNUSED(pPos) ) -{ - m_sCaption = rsCaption; - m_sMessage = rsMessage; - m_pParent = NULL; // pParent; - SetMessageDialogStyle(lStyle); -} // end of wxMessageDialog::wxMessageDialog - int wxMessageDialog::ShowModal() { + WX_TESTING_SHOW_MODAL_HOOK(); + HWND hWnd = 0; ULONG ulStyle = MB_OK; int nAns = wxOK; @@ -67,8 +54,8 @@ int wxMessageDialog::ShowModal() wxTheApp->Dispatch(); } - if (m_pParent) - hWnd = (HWND) m_pParent->GetHWND(); + if (m_parent) + hWnd = (HWND) m_parent->GetHWND(); else hWnd = HWND_DESKTOP; if (lStyle & wxYES_NO) @@ -89,14 +76,25 @@ int wxMessageDialog::ShowModal() else ulStyle = MB_OK; } - if (lStyle & wxICON_EXCLAMATION) - ulStyle |= MB_ICONEXCLAMATION; - else if (lStyle & wxICON_HAND) - ulStyle |= MB_ICONHAND; - else if (lStyle & wxICON_INFORMATION) - ulStyle |= MB_ICONEXCLAMATION; - else if (lStyle & wxICON_QUESTION) - ulStyle |= MB_ICONQUESTION; + + switch ( GetEffectiveIcon() ) + { + case wxICON_ERROR: + ulStyle |= MB_ERROR; + break; + + case wxICON_WARNING: + ulStyle |= MB_WARNING; + break; + + case wxICON_QUESTION: + ulStyle |= MB_QUERY; + break; + + case wxICON_INFORMATION: + ulStyle |= MB_INFORMATION; + break; + } if (hWnd != HWND_DESKTOP) ulStyle |= MB_APPLMODAL; @@ -113,8 +111,8 @@ int wxMessageDialog::ShowModal() ULONG ulAns = ::WinMessageBox( hWnd ,hWnd - ,(PSZ)m_sMessage.c_str() - ,(PSZ)m_sCaption.c_str() + ,GetFullMessage().c_str() + ,m_caption.c_str() ,0L ,ulStyle); switch (ulAns)