X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/978af864269a739e77d9431c8465435e3f8f7407..180b5b4827d08f1ac13bbb5eca03f775ab35a0b1:/src/msw/msgdlg.cpp diff --git a/src/msw/msgdlg.cpp b/src/msw/msgdlg.cpp index c8aaa8ef73..061b9211a2 100644 --- a/src/msw/msgdlg.cpp +++ b/src/msw/msgdlg.cpp @@ -16,6 +16,8 @@ #pragma hdrstop #endif +#if wxUSE_MSGDLG + #include "wx/msgdlg.h" #ifndef WX_PRECOMP @@ -33,18 +35,6 @@ IMPLEMENT_CLASS(wxMessageDialog, wxDialog) -wxMessageDialog::wxMessageDialog(wxWindow *parent, - const wxString& message, - const wxString& caption, - long style, - const wxPoint& WXUNUSED(pos)) -{ - m_caption = caption; - m_message = message; - m_parent = parent; - SetMessageDialogStyle(style); -} - int wxMessageDialog::ShowModal() { if ( !wxTheApp->GetTopWindow() ) @@ -97,16 +87,31 @@ int wxMessageDialog::ShowModal() if ( wxStyle & wxSTAY_ON_TOP ) msStyle |= MB_TOPMOST; +#ifndef __WXWINCE__ if ( wxTheApp->GetLayoutDirection() == wxLayout_RightToLeft ) msStyle |= MB_RTLREADING | MB_RIGHT; +#endif if (hWnd) msStyle |= MB_APPLMODAL; else msStyle |= MB_TASKMODAL; + // per MSDN documentation for MessageBox() we can prefix the message with 2 + // right-to-left mark characters to tell the function to use RTL layout + // (unfortunately this only works in Unicode builds) + wxString message = GetFullMessage(); +#if wxUSE_UNICODE + if ( wxTheApp->GetLayoutDirection() == wxLayout_RightToLeft ) + { + // NB: not all compilers support \u escapes + static const wchar_t wchRLM = 0x200f; + message.Prepend(wxString(wchRLM, 2)); + } +#endif // wxUSE_UNICODE + // do show the dialog - int msAns = MessageBox(hWnd, m_message.c_str(), m_caption.c_str(), msStyle); + int msAns = MessageBox(hWnd, message.wx_str(), m_caption.wx_str(), msStyle); int ans; switch (msAns) { @@ -129,3 +134,5 @@ int wxMessageDialog::ShowModal() } return ans; } + +#endif // wxUSE_MSGDLG