From: Vadim Zeitlin Date: Sat, 25 Dec 2010 13:46:23 +0000 (+0000) Subject: Correct bug in the wxSpinCtrlGeneric sub-controls resizing. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6f0b6fd1e4b5b2633e1f34c54c8d4f4e5da98637?ds=inline Correct bug in the wxSpinCtrlGeneric sub-controls resizing. The code in DoMoveWindow() didn't account for the margin and made the text control part of the window too large resulting in the truncation of the spin button. Simply remember to take margin into account when computing the text width. See #12767. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66443 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/spinctlg.cpp b/src/generic/spinctlg.cpp index d3c1cdb4a6..67d9caaa31 100644 --- a/src/generic/spinctlg.cpp +++ b/src/generic/spinctlg.cpp @@ -270,7 +270,7 @@ void wxSpinCtrlGenericBase::DoMoveWindow(int x, int y, int width, int height) // position the subcontrols inside the client area wxSize sizeBtn = m_spinButton->GetSize(); - wxCoord wText = width - sizeBtn.x; + wxCoord wText = width - sizeBtn.x - MARGIN; m_textCtrl->SetSize(x, y, wText, height); m_spinButton->SetSize(x + wText + MARGIN, y, wxDefaultCoord, height); }