From 12e424d28f9f82575c1ebb3fe57cd654a3a8d513 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 25 Dec 2006 14:39:11 +0000 Subject: [PATCH] show RTL message box (in Unicode build only) when using RTL (patch 1622000) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44062 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/msgdlg.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/msw/msgdlg.cpp b/src/msw/msgdlg.cpp index d19261705e..5312a8ec06 100644 --- a/src/msw/msgdlg.cpp +++ b/src/msw/msgdlg.cpp @@ -107,8 +107,21 @@ int wxMessageDialog::ShowModal() 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) { -- 2.45.2