From 1b489359c4051c23262e3118b4489054ef7f3843 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sun, 8 Dec 2002 21:43:43 +0000 Subject: [PATCH] Applied patch [ 637982 ] wxComboBox needs margin wxComboBox doesn't have a margin between the text and the dropdown button when the default size is used. Since wxTextctrl currently returns a rather long minmal size, this error is only visible if a long text (around 20 chars) is used. This patch introduces a margin (analog wxSpinctrl). Otto Wyss git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18120 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/univ/combobox.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp index 2e0af935fa..ea372f27c2 100644 --- a/src/univ/combobox.cpp +++ b/src/univ/combobox.cpp @@ -55,6 +55,12 @@ 3. which passes them to the popup window if it is popped up */ +// constants +// ---------------------------------------------------------------------------- + +// the margin between the text control and the combo button +static const wxCoord g_comboMargin = 2; + // ---------------------------------------------------------------------------- // wxComboButton is just a normal button except that it sends commands to the // combobox and not its parent @@ -294,7 +300,7 @@ wxSize wxComboControl::DoGetBestClientSize() const wxSize sizeBtn = m_btn->GetBestSize(), sizeText = m_text->GetBestSize(); - return wxSize(sizeBtn.x + sizeText.x, wxMax(sizeBtn.y, sizeText.y)); + return wxSize(sizeText.x + g_comboMargin + sizeBtn.x, wxMax(sizeBtn.y, sizeText.y)); } void wxComboControl::DoMoveWindow(int x, int y, int width, int height) -- 2.47.2