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
This commit is contained in:
@@ -107,8 +107,21 @@ int wxMessageDialog::ShowModal()
|
|||||||
else
|
else
|
||||||
msStyle |= MB_TASKMODAL;
|
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
|
// 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;
|
int ans;
|
||||||
switch (msAns)
|
switch (msAns)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user