]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/popupcmn.cpp
include wx/utils.h in PCH-less build to ensure that we get the correct (DLL-exported...
[wxWidgets.git] / src / common / popupcmn.cpp
index 8fc32bcc50f56547bc0b65627b54a40e9c64d543..57ba86c0a00314f91dbcd0111c7fbdc282a7b5da 100644 (file)
@@ -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