]> git.saurik.com Git - wxWidgets.git/commitdiff
Remove vertical wxTextCtrl adjustment hacks for wxMSW in wxComboCtrl code.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 7 Dec 2011 14:05:11 +0000 (14:05 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 7 Dec 2011 14:05:11 +0000 (14:05 +0000)
Because wxTextCtrl used to wrongly report its best size in wxNO_BORDER case
under MSW, wxComboCtrl manually adjusted its position to work around this.
However since r69066 wxTextCtrl::GetBestSize() was fixed and now these
adjustments resulted in wrong vertical position for the control.

Just remove all manual adjustments completely now to fix this.

Closes #13722.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69942 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/combo.h
src/generic/combog.cpp
src/msw/combo.cpp

index 4c7f0867b318b73da6c3e87bc8969444d3b513f0..3806ca1a8ad867a2c13e1bc10e234f788d7c52f5 100644 (file)
@@ -560,7 +560,8 @@ protected:
 
     // Standard textctrl positioning routine. Just give it platform-dependant
     // textctrl coordinate adjustment.
-    virtual void PositionTextCtrl( int textCtrlXAdjust, int textCtrlYAdjust );
+    virtual void PositionTextCtrl( int textCtrlXAdjust = 0,
+                                   int textCtrlYAdjust = 0);
 
     // event handlers
     void OnSizeEvent( wxSizeEvent& event );
index be0fa445cacb8b9285239dadb4c65aadb062b6a6..84eb95cd47cf7b162e2c5cfb784a1266e36b18a6 100644 (file)
@@ -46,7 +46,6 @@
 // meaningless if LEFT_MARGIN_CAN_BE_SET set to 1 in combocmn.cpp
 #define TEXTCTRLXADJUST                 0
 
-#define TEXTCTRLYADJUST                 0
 #define TEXTXADJUST                     0 // how much is read-only text's x adjusted
 #define DEFAULT_DROPBUTTON_WIDTH        19
 
@@ -56,7 +55,6 @@
 // meaningless if LEFT_MARGIN_CAN_BE_SET set to 1 in combocmn.cpp
 #define TEXTCTRLXADJUST                 2
 
-#define TEXTCTRLYADJUST                 3
 #define TEXTXADJUST                     0 // how much is read-only text's x adjusted
 #define DEFAULT_DROPBUTTON_WIDTH        17
 
@@ -66,7 +64,6 @@
 // meaningless if LEFT_MARGIN_CAN_BE_SET set to 1 in combocmn.cpp
 #define TEXTCTRLXADJUST                 -1
 
-#define TEXTCTRLYADJUST                 0
 #define TEXTXADJUST                     1 // how much is read-only text's x adjusted
 #define DEFAULT_DROPBUTTON_WIDTH        23
 
@@ -76,7 +73,6 @@
 // meaningless if LEFT_MARGIN_CAN_BE_SET set to 1 in combocmn.cpp
 #define TEXTCTRLXADJUST                 0
 
-#define TEXTCTRLYADJUST                 0
 #define TEXTXADJUST                     0 // how much is read-only text's x adjusted
 #define DEFAULT_DROPBUTTON_WIDTH        22
 
@@ -86,7 +82,6 @@
 // meaningless if LEFT_MARGIN_CAN_BE_SET set to 1 in combocmn.cpp
 #define TEXTCTRLXADJUST                 0
 
-#define TEXTCTRLYADJUST                 0
 #define TEXTXADJUST                     0 // how much is read-only text's x adjusted
 #define DEFAULT_DROPBUTTON_WIDTH        19
 
@@ -235,7 +230,7 @@ void wxGenericComboCtrl::OnResize()
 #endif
 
     // Move textctrl, if any, accordingly
-    PositionTextCtrl( TEXTCTRLXADJUST, TEXTCTRLYADJUST );
+    PositionTextCtrl( TEXTCTRLXADJUST );
 }
 
 void wxGenericComboCtrl::OnPaintEvent( wxPaintEvent& WXUNUSED(event) )
index 1e59def4d8714cd8fac1cc11bcbf2bc3f5624762..12db6bf584c1a4db9f6353af51cc388621aac069 100644 (file)
 #define NATIVE_TEXT_INDENT_XP       4
 #define NATIVE_TEXT_INDENT_CLASSIC  2
 
-#define TEXTCTRLYADJUST_XP          3
-#define TEXTCTRLYADJUST_CLASSIC     3
-
 #define COMBOBOX_ANIMATION_RESOLUTION   10
 
 #define COMBOBOX_ANIMATION_DURATION     200  // In milliseconds
@@ -229,26 +226,13 @@ void wxComboCtrl::OnResize()
     //
     // Recalculates button and textctrl areas
 
-    int textCtrlYAdjust;
-
-#if wxUSE_UXTHEME
-    if ( wxUxThemeEngine::GetIfActive() )
-    {
-        textCtrlYAdjust = TEXTCTRLYADJUST_XP;
-    }
-    else
-#endif
-    {
-        textCtrlYAdjust = TEXTCTRLYADJUST_CLASSIC;
-    }
-
     // Technically Classic Windows style combo has more narrow button,
     // but the native renderer doesn't paint it well like that.
     int btnWidth = 17;
     CalculateAreas(btnWidth);
 
     // Position textctrl using standard routine
-    PositionTextCtrl(0, textCtrlYAdjust);
+    PositionTextCtrl();
 }
 
 // Draws non-XP GUI dotted line around the focus area