From: Václav Slavík Date: Fri, 28 Feb 2003 23:41:00 +0000 (+0000) Subject: fixed wxScrollBar creation when default size was used X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7f980cffb852bd48ecd5ca8248c1926f3bf25572?hp=c5969a384844aed0f75dc8495e3f68b88cea627a fixed wxScrollBar creation when default size was used git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gtk/scrolbar.h b/include/wx/gtk/scrolbar.h index f471873aa3..672334a1de 100644 --- a/include/wx/gtk/scrolbar.h +++ b/include/wx/gtk/scrolbar.h @@ -77,6 +77,9 @@ public: GtkAdjustment *m_adjust; float m_oldPos; +protected: + virtual wxSize DoGetBestSize() const; + private: DECLARE_DYNAMIC_CLASS(wxScrollBar) }; diff --git a/include/wx/gtk1/scrolbar.h b/include/wx/gtk1/scrolbar.h index f471873aa3..672334a1de 100644 --- a/include/wx/gtk1/scrolbar.h +++ b/include/wx/gtk1/scrolbar.h @@ -77,6 +77,9 @@ public: GtkAdjustment *m_adjust; float m_oldPos; +protected: + virtual wxSize DoGetBestSize() const; + private: DECLARE_DYNAMIC_CLASS(wxScrollBar) }; diff --git a/src/gtk/scrolbar.cpp b/src/gtk/scrolbar.cpp index 14530aef24..42fa93452d 100644 --- a/src/gtk/scrolbar.cpp +++ b/src/gtk/scrolbar.cpp @@ -180,6 +180,8 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, PostCreation(); + SetBestSize(size); + SetBackgroundColour( parent->GetBackgroundColour() ); Show( TRUE ); @@ -334,4 +336,9 @@ void wxScrollBar::ApplyWidgetStyle() gtk_widget_set_style( m_widget, m_widgetStyle ); } +wxSize wxScrollBar::DoGetBestSize() const +{ + return wxControl::DoGetBestSize(); +} + #endif diff --git a/src/gtk1/scrolbar.cpp b/src/gtk1/scrolbar.cpp index 14530aef24..42fa93452d 100644 --- a/src/gtk1/scrolbar.cpp +++ b/src/gtk1/scrolbar.cpp @@ -180,6 +180,8 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, PostCreation(); + SetBestSize(size); + SetBackgroundColour( parent->GetBackgroundColour() ); Show( TRUE ); @@ -334,4 +336,9 @@ void wxScrollBar::ApplyWidgetStyle() gtk_widget_set_style( m_widget, m_widgetStyle ); } +wxSize wxScrollBar::DoGetBestSize() const +{ + return wxControl::DoGetBestSize(); +} + #endif