From d2aa263fd120a01843fb40a063abe8c6ff921cbc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 7 Jan 2007 16:07:59 +0000 Subject: [PATCH] fix for popup positioning in RTL mode (patch 1622930) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44121 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/popupcmn.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/common/popupcmn.cpp b/src/common/popupcmn.cpp index 8fc32bcc50..57ba86c0a0 100644 --- a/src/common/popupcmn.cpp +++ b/src/common/popupcmn.cpp @@ -151,7 +151,18 @@ void wxPopupWindowBase::Position(const wxPoint& ptOrigin, } // now check left/right too - wxCoord x = ptOrigin.x + size.x; + wxCoord x = ptOrigin.x; + + if ( wxTheApp->GetLayoutDirection() == wxLayout_RightToLeft ) + { + // shift the window to the left instead of the right. + x -= size.x; + x -= sizeSelf.x; // also shift it by window width. + } + else + x += size.x; + + if ( x + sizeSelf.x > sizeScreen.x ) { // check if there is enough space to the left -- 2.47.2