diff --git a/include/wx/msw/spinctrl.h b/include/wx/msw/spinctrl.h index 2427369e45..cf94fe18a3 100644 --- a/include/wx/msw/spinctrl.h +++ b/include/wx/msw/spinctrl.h @@ -92,6 +92,7 @@ protected: virtual void DoMoveWindow(int x, int y, int width, int height); virtual wxSize DoGetBestSize() const; virtual void DoGetSize(int *width, int *height) const; + virtual void DoGetClientSize(int *x, int *y) const; #if wxUSE_TOOLTIPS virtual void DoSetToolTip( wxToolTip *tip ); #endif // wxUSE_TOOLTIPS diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index ff3afaf8c8..2a1826c45a 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -643,6 +643,19 @@ void wxSpinCtrl::DoGetSize(int *x, int *y) const *y = ctrlrect.bottom - ctrlrect.top; } +void wxSpinCtrl::DoGetClientSize(int *x, int *y) const +{ + RECT spinrect = wxGetClientRect(GetHwnd()); + RECT textrect = wxGetClientRect(GetBuddyHwnd()); + RECT ctrlrect; + UnionRect(&ctrlrect,&textrect, &spinrect); + + if ( x ) + *x = ctrlrect.right - ctrlrect.left; + if ( y ) + *y = ctrlrect.bottom - ctrlrect.top; +} + void wxSpinCtrl::DoGetPosition(int *x, int *y) const { // hack: pretend that our HWND is the text control just for a moment