X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/978af864269a739e77d9431c8465435e3f8f7407..659863d8a73d02626f4060bb1099fe7bfd80d22a:/src/msw/msgdlg.cpp diff --git a/src/msw/msgdlg.cpp b/src/msw/msgdlg.cpp index c8aaa8ef73..5312a8ec06 100644 --- a/src/msw/msgdlg.cpp +++ b/src/msw/msgdlg.cpp @@ -97,16 +97,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 = m_message; +#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, m_caption, msStyle); int ans; switch (msAns) {