From 5397911d6248a3bafe08233480ffb0c614b892e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Mon, 21 Jan 2002 19:03:31 +0000 Subject: [PATCH] fixed incorrect positioning of controls in generic wxSpinCtrl git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13728 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/spinctlg.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/generic/spinctlg.cpp b/src/generic/spinctlg.cpp index ff767d2848..f5019af63a 100644 --- a/src/generic/spinctlg.cpp +++ b/src/generic/spinctlg.cpp @@ -232,15 +232,18 @@ void wxSpinCtrl::DoMoveWindow(int x, int y, int width, int height) { wxControl::DoMoveWindow(x, y, width, height); + wxPoint p = GetParent() ? + GetParent()->GetClientAreaOrigin() : wxPoint(0,0); + // position the subcontrols inside the client area wxSize sizeBtn = m_btn->GetSize(); wxCoord wText = width - sizeBtn.x; - m_text->SetSize(x, y, wText, height); + m_text->SetSize(x-p.x, y-p.y, wText, height); #ifdef __WXMAC__ - m_btn->SetSize(x + wText + MARGIN, y, -1, -1); + m_btn->SetSize(x-p.x + wText + MARGIN, y-p.y, -1, -1); #else - m_btn->SetSize(x + wText + MARGIN, y, -1, height); + m_btn->SetSize(x-p.x + wText + MARGIN, y-p.y, -1, height); #endif }