X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..4f433feff9251ded00bba26b633f93e660cd44c4:/src/gtk1/slider.cpp diff --git a/src/gtk1/slider.cpp b/src/gtk1/slider.cpp index 27f9bdd393..c5d5be31fe 100644 --- a/src/gtk1/slider.cpp +++ b/src/gtk1/slider.cpp @@ -19,9 +19,7 @@ #if wxUSE_SLIDER #include "wx/utils.h" - -#include - +#include "wx/math.h" #include "wx/gtk/private.h" //----------------------------------------------------------------------------- @@ -43,6 +41,7 @@ static const float sensitivity = 0.02; // "value_changed" //----------------------------------------------------------------------------- +extern "C" { static void gtk_slider_callback( GtkAdjustment *adjust, SCROLLBAR_CBACK_ARG wxSlider *win ) @@ -74,6 +73,7 @@ static void gtk_slider_callback( GtkAdjustment *adjust, cevent.SetInt( value ); win->GetEventHandler()->ProcessEvent( cevent ); } +} //----------------------------------------------------------------------------- // wxSlider @@ -134,6 +134,11 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id, m_adjust = gtk_range_get_adjustment( GTK_RANGE(m_widget) ); +#ifdef __WXGTK20__ + if (style & wxSL_INVERSE) + gtk_range_set_inverted( GTK_RANGE(m_widget), TRUE ); +#endif + GtkEnableEvents(); SetRange( minValue, maxValue ); @@ -141,11 +146,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id, m_parent->DoAddChild( this ); - PostCreation(); - - SetBackgroundColour( parent->GetBackgroundColour() ); - - Show( TRUE ); + PostCreation(size); return TRUE; } @@ -269,12 +270,6 @@ bool wxSlider::IsOwnGtkWindow( GdkWindow *window ) #endif } -void wxSlider::ApplyWidgetStyle() -{ - SetWidgetStyle(); - gtk_widget_set_style( m_widget, m_widgetStyle ); -} - void wxSlider::GtkDisableEvents() { gtk_signal_disconnect_by_func( GTK_OBJECT(m_adjust), @@ -290,4 +285,11 @@ void wxSlider::GtkEnableEvents() (gpointer) this ); } +// static +wxVisualAttributes +wxSlider::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) +{ + return GetDefaultAttributesFromGTKWidget(gtk_vscale_new); +} + #endif