]> git.saurik.com Git - wxWidgets.git/commitdiff
implemented a simple DoGetBestSize() for MSW's wxScrollBar
authorDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Fri, 9 Apr 2004 15:16:46 +0000 (15:16 +0000)
committerDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Fri, 9 Apr 2004 15:16:46 +0000 (15:16 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26677 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/scrolbar.h
src/msw/scrolbar.cpp

index 6cae25208da310dd15e84cbd45bc3b0986c1c038..04e231de77f8419619b2fe51036e8969284efb4f 100644 (file)
@@ -60,6 +60,9 @@ public:
                              WXWORD pos, WXHWND control);
 
 protected:
+
+    wxSize DoGetBestSize() const;
+
     int m_pageSize;
     int m_viewSize;
     int m_objectSize;
index c340e946f438ae5634df5bfdec28a9638c82f682..b0f7e5ffef0c908b30707a2f614876194c7564dd 100644 (file)
@@ -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