// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "slider.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#if wxUSE_SLIDER
#include "wx/utils.h"
-
-#include <math.h>
-
+#include "wx/math.h"
#include "wx/gtk/private.h"
//-----------------------------------------------------------------------------
// "value_changed"
//-----------------------------------------------------------------------------
+extern "C" {
static void gtk_slider_callback( GtkAdjustment *adjust,
SCROLLBAR_CBACK_ARG
wxSlider *win )
cevent.SetInt( value );
win->GetEventHandler()->ProcessEvent( cevent );
}
+}
//-----------------------------------------------------------------------------
// wxSlider
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 );
#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),
(gpointer) this );
}
+// static
+wxVisualAttributes
+wxSlider::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
+{
+ return GetDefaultAttributesFromGTKWidget(gtk_vscale_new);
+}
+
#endif