]> git.saurik.com Git - wxWidgets.git/commitdiff
[ 1574264 ] Fix height of wxComboCtrl's wxTextCtrl
authorRobert Roebling <robert@roebling.de>
Tue, 10 Oct 2006 08:03:59 +0000 (08:03 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 10 Oct 2006 08:03:59 +0000 (08:03 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41864 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/combocmn.cpp

index 84a4a7e9c5be41e6a50b577e2958c31ae5eb47fc..ad80f48d51b54081bcdfd9f7b18a79c671357642 100644 (file)
@@ -62,6 +62,7 @@
 #if defined(__WXMSW__)
 
 #define USE_TRANSIENT_POPUP           1 // Use wxPopupWindowTransient (preferred, if it works properly on platform)
+#define TEXTCTRL_TEXT_CENTERED        0 // 1 if text in textctrl is vertically centered
 
 //#undef wxUSE_POPUPWIN
 //#define wxUSE_POPUPWIN 0
 #elif defined(__WXGTK__)
 
 #define USE_TRANSIENT_POPUP           1 // Use wxPopupWindowTransient (preferred, if it works properly on platform)
+#define TEXTCTRL_TEXT_CENTERED        1 // 1 if text in textctrl is vertically centered
 
 #elif defined(__WXMAC__)
 
 #define USE_TRANSIENT_POPUP           0 // Use wxPopupWindowTransient (preferred, if it works properly on platform)
+#define TEXTCTRL_TEXT_CENTERED        1 // 1 if text in textctrl is vertically centered
 
 #else
 
 #define USE_TRANSIENT_POPUP           0 // Use wxPopupWindowTransient (preferred, if it works properly on platform)
+#define TEXTCTRL_TEXT_CENTERED        1 // 1 if text in textctrl is vertically centered
 
 #endif
 
@@ -882,6 +886,7 @@ void wxComboCtrlBase::PositionTextCtrl( int textCtrlXAdjust, int textCtrlYAdjust
     wxSize sz = GetClientSize();
     int customBorder = m_widthCustomBorder;
 
+#if !TEXTCTRL_TEXT_CENTERED
     if ( (m_text->GetWindowStyleFlag() & wxBORDER_MASK) == wxNO_BORDER )
     {
         // Centre textctrl
@@ -908,12 +913,13 @@ void wxComboCtrlBase::PositionTextCtrl( int textCtrlXAdjust, int textCtrlYAdjust
         }
     }
     else
+#endif
     {
         // If it has border, have textctrl will the entire text field.
-        m_text->SetSize( m_tcArea.x,
-                         0,
+        m_text->SetSize( m_tcArea.x + m_widthCustomPaint,
+                         customBorder,
                          sz.x - m_btnArea.width - m_widthCustomPaint - customBorder,
-                         sz.y );
+                         sz.y-(customBorder*2) );
     }
 }