wxSpinCtrl::GetSize() should work now (thanks to Kristjan Jonsson)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7166 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-04-14 18:53:26 +00:00
parent 87f968fb5a
commit 351cc2a737
2 changed files with 15 additions and 0 deletions

View File

@@ -75,6 +75,7 @@ public:
protected:
virtual void DoMoveWindow(int x, int y, int width, int height);
virtual wxSize DoGetBestSize() const;
virtual void DoGetSize(int *width, int *height) const;
// the handler for wxSpinButton events
void OnSpinChange(wxSpinEvent& event);

View File

@@ -336,6 +336,20 @@ void wxSpinCtrl::DoMoveWindow(int x, int y, int width, int height)
}
}
// get total size of the control
void wxSpinCtrl::DoGetSize(int *x, int *y) const
{
RECT spinrect, textrect, ctrlrect;
GetWindowRect(GetHwnd(), &spinrect);
GetWindowRect((HWND)m_hwndBuddy, &textrect);
UnionRect(&ctrlrect,&textrect, &spinrect);
if ( x )
*x = ctrlrect.right - ctrlrect.left;
if ( y )
*y = ctrlrect.bottom - ctrlrect.top;
}
#endif // __WIN95__
#endif