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
This commit is contained in:
Václav Slavík 2002-01-21 19:03:31 +00:00
parent 84c88a17c0
commit 5397911d62

View File

@ -232,15 +232,18 @@ void wxSpinCtrl::DoMoveWindow(int x, int y, int width, int height)
{ {
wxControl::DoMoveWindow(x, y, width, height); wxControl::DoMoveWindow(x, y, width, height);
wxPoint p = GetParent() ?
GetParent()->GetClientAreaOrigin() : wxPoint(0,0);
// position the subcontrols inside the client area // position the subcontrols inside the client area
wxSize sizeBtn = m_btn->GetSize(); wxSize sizeBtn = m_btn->GetSize();
wxCoord wText = width - sizeBtn.x; 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__ #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 #else
m_btn->SetSize(x + wText + MARGIN, y, -1, height); m_btn->SetSize(x-p.x + wText + MARGIN, y-p.y, -1, height);
#endif #endif
} }