Fix positioning of ComboBoxEditor in wxPG (wxGTK)

Position of the combo box editor associated with properties having custom
bitmaps like e.g. ColourProperty, needs to be adjusted in order to display
edited text at the same position as the text which is displayed as
a property value prior to the editing.
This commit is contained in:
Artur Wieczorek
2017-07-16 19:05:06 +02:00
parent 3212f7eab9
commit 9994288688
2 changed files with 17 additions and 3 deletions

View File

@@ -169,7 +169,7 @@ wxCONSTRUCTOR_5( wxComboBox, wxWindow*, Parent, wxWindowID, Id, \
#define TRANSIENT_POPUPWIN_IS_PERFECT 1 // wxPopupTransientWindow works, its child can have focus, and common
// native controls work on it like normal.
#define POPUPWIN_IS_PERFECT 1 // Same, but for non-transient popup window.
#define TEXTCTRL_TEXT_CENTERED 1 // 1 if text in textctrl is vertically centered
#define TEXTCTRL_TEXT_CENTERED 0 // 1 if text in textctrl is vertically centered
#define FOCUS_RING 0 // No focus ring on wxGTK
#elif defined(__WXMAC__)

View File

@@ -701,6 +701,20 @@ public:
return rect.width;
}
#if defined(__WXMSW__)
#define wxPG_TEXTCTRLXADJUST3 0
#elif defined(__WXGTK__)
#if defined(__WXGTK3__)
#define wxPG_TEXTCTRLXADJUST3 2
#else
#define wxPG_TEXTCTRLXADJUST3 0
#endif // wxGTK3/!wxGTK3
#elif defined(__WXOSX__)
#define wxPG_TEXTCTRLXADJUST3 0
#else
#define wxPG_TEXTCTRLXADJUST3 0
#endif
virtual void PositionTextCtrl( int textCtrlXAdjust,
int WXUNUSED(textCtrlYAdjust) ) wxOVERRIDE
{
@@ -709,8 +723,8 @@ public:
(wxPG_XBEFOREWIDGET+wxPG_CONTROL_MARGIN+1) - 1,
#endif
wxOwnerDrawnComboBox::PositionTextCtrl(
textCtrlXAdjust,
0 // Under MSW vertical position is already properly adjusted.
textCtrlXAdjust + wxPG_TEXTCTRLXADJUST3,
0 // Under MSW, GTK vertical position is already properly adjusted.
// Note: This parameter is not used by other ports.
);
}