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
3. which passes them to the popup window if it is popped up
*/
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
// ----------------------------------------------------------------------------
// wxComboButton is just a normal button except that it sends commands to the
// combobox and not its parent
wxSize sizeBtn = m_btn->GetBestSize(),
sizeText = m_text->GetBestSize();
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)
}
void wxComboControl::DoMoveWindow(int x, int y, int width, int height)