]> git.saurik.com Git - wxWidgets.git/commitdiff
Correct bug in the wxSpinCtrlGeneric sub-controls resizing.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 25 Dec 2010 13:46:23 +0000 (13:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 25 Dec 2010 13:46:23 +0000 (13:46 +0000)
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

src/generic/spinctlg.cpp

index d3c1cdb4a6d2d82dc25832b54dfc36ca3f266a9d..67d9caaa316f7e5d4ee31cb4cc42b45c7afaa9ca 100644 (file)
@@ -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);
 }