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:
@@ -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);
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user