]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/combocmn.cpp
add a note about changing selection background colour
[wxWidgets.git] / src / common / combocmn.cpp
index 77c67f137e9431537eb500c4e1963f9e1fb1f26e..2595b6ad92ace1787abfa67ff16d40f82bb3fa68 100644 (file)
@@ -28,6 +28,7 @@
 #include "wx/combobox.h"
 
 #ifndef WX_PRECOMP
+    #include "wx/app.h"
     #include "wx/log.h"
     #include "wx/dcclient.h"
     #include "wx/settings.h"
@@ -355,6 +356,7 @@ public:
 #if USES_WXPOPUPTRANSIENTWINDOW
     virtual bool Show( bool show );
     virtual bool ProcessLeftDown(wxMouseEvent& event);
+protected:
     virtual void OnDismiss();
 #endif
 
@@ -1003,9 +1005,10 @@ void wxComboCtrlBase::PositionTextCtrl( int textCtrlXAdjust, int textCtrlYAdjust
     if ( !m_text )
         return;
 
+#if !TEXTCTRL_TEXT_CENTERED
+
     wxSize sz = GetClientSize();
 
-#if !TEXTCTRL_TEXT_CENTERED
     int customBorder = m_widthCustomBorder;
     if ( (m_text->GetWindowStyleFlag() & wxBORDER_MASK) == wxNO_BORDER )
     {
@@ -1852,7 +1855,7 @@ void wxComboCtrlBase::ShowPopup()
     }
 
     winPopup->Enable();
-    
+
     wxASSERT( !m_popup || m_popup == popup ); // Consistency check.
 
     wxSize adjustedSize = m_popupInterface->GetAdjustedSize(widthPopup,
@@ -1879,6 +1882,10 @@ void wxComboCtrlBase::ShowPopup()
 
     int rightX = scrPos.x + ctrlSz.x + m_extRight - szp.x;
     int leftX = scrPos.x - m_extLeft;
+
+    if ( wxTheApp->GetLayoutDirection() == wxLayout_RightToLeft )
+        leftX -= ctrlSz.x;
+
     int screenWidth = wxSystemSettings::GetMetric( wxSYS_SCREEN_X );
 
     // If there is not enough horizontal space, anchor on the other side.