From caafd0821d78e35ecec45ebeb7001b3508288cf7 Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Fri, 9 Apr 2004 15:16:46 +0000 Subject: [PATCH] implemented a simple DoGetBestSize() for MSW's wxScrollBar git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26677 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/scrolbar.h | 3 +++ src/msw/scrolbar.cpp | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/include/wx/msw/scrolbar.h b/include/wx/msw/scrolbar.h index 6cae25208d..04e231de77 100644 --- a/include/wx/msw/scrolbar.h +++ b/include/wx/msw/scrolbar.h @@ -60,6 +60,9 @@ public: WXWORD pos, WXHWND control); protected: + + wxSize DoGetBestSize() const; + int m_pageSize; int m_viewSize; int m_objectSize; diff --git a/src/msw/scrolbar.cpp b/src/msw/scrolbar.cpp index c340e946f4..b0f7e5ffef 100644 --- a/src/msw/scrolbar.cpp +++ b/src/msw/scrolbar.cpp @@ -375,4 +375,21 @@ void wxScrollBar::Command(wxCommandEvent& event) ProcessCommand(event); } +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); + } + + return wxSize(w, h); +} + #endif // wxUSE_SCROLLBAR -- 2.47.2