From 7f980cffb852bd48ecd5ca8248c1926f3bf25572 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Fri, 28 Feb 2003 23:41:00 +0000 Subject: [PATCH] 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 --- include/wx/gtk/scrolbar.h | 3 +++ include/wx/gtk1/scrolbar.h | 3 +++ src/gtk/scrolbar.cpp | 7 +++++++ src/gtk1/scrolbar.cpp | 7 +++++++ 4 files changed, 20 insertions(+) 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 -- 2.45.2