Add DoGetBestSize

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38188 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2006-03-17 22:50:05 +00:00
parent 71caeaf3c0
commit 10ae0adb58
2 changed files with 23 additions and 0 deletions

View File

@@ -55,6 +55,9 @@ public:
void Command(wxCommandEvent& event);
virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ;
virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF mevent ) ;
wxSize DoGetBestSize() const;
protected:
int m_pageSize;
int m_viewSize;

View File

@@ -219,3 +219,23 @@ wxInt32 wxScrollBar::MacControlHit( WXEVENTHANDLERREF handler, WXEVENTREF mevent
return noErr;
}
wxSize wxScrollBar::DoGetBestSize() const
{
int w = 100;
int h = 100;
if ( IsVertical() )
{
w = wxSystemSettings::GetMetric(wxSYS_VSCROLL_X);
}
else
{
h = wxSystemSettings::GetMetric(wxSYS_HSCROLL_Y);
}
wxSize best(w, h);
CacheBestSize(best);
return best;
}