]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/slider.cpp
[ 1216436 ] cleanup 'shadow variable' warnings from gcc in headers.
[wxWidgets.git] / src / gtk / slider.cpp
index 799f21d2b11f5f80981f3b1c193a9919ff42a4ad..c5d5be31fe8108b74d6b168b119499b11bcb7571 100644 (file)
@@ -7,18 +7,19 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "slider.h"
 #endif
 
 #pragma implementation "slider.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/slider.h"
 
 #if wxUSE_SLIDER
 
 #include "wx/utils.h"
 #include "wx/slider.h"
 
 #if wxUSE_SLIDER
 
 #include "wx/utils.h"
-
-#include <math.h>
-
+#include "wx/math.h"
 #include "wx/gtk/private.h"
 
 //-----------------------------------------------------------------------------
 #include "wx/gtk/private.h"
 
 //-----------------------------------------------------------------------------
@@ -40,6 +41,7 @@ static const float sensitivity = 0.02;
 // "value_changed"
 //-----------------------------------------------------------------------------
 
 // "value_changed"
 //-----------------------------------------------------------------------------
 
+extern "C" {
 static void gtk_slider_callback( GtkAdjustment *adjust,
                                  SCROLLBAR_CBACK_ARG
                                  wxSlider *win )
 static void gtk_slider_callback( GtkAdjustment *adjust,
                                  SCROLLBAR_CBACK_ARG
                                  wxSlider *win )
@@ -71,6 +73,7 @@ static void gtk_slider_callback( GtkAdjustment *adjust,
     cevent.SetInt( value );
     win->GetEventHandler()->ProcessEvent( cevent );
 }
     cevent.SetInt( value );
     win->GetEventHandler()->ProcessEvent( cevent );
 }
+}
 
 //-----------------------------------------------------------------------------
 // wxSlider
 
 //-----------------------------------------------------------------------------
 // wxSlider
@@ -131,6 +134,11 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
 
     m_adjust = gtk_range_get_adjustment( GTK_RANGE(m_widget) );
 
 
     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 );
     GtkEnableEvents();
 
     SetRange( minValue, maxValue );
@@ -138,11 +146,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
 
     m_parent->DoAddChild( this );
 
 
     m_parent->DoAddChild( this );
 
-    PostCreation();
-
-    SetBackgroundColour( parent->GetBackgroundColour() );
-
-    Show( TRUE );
+    PostCreation(size);
 
     return TRUE;
 }
 
     return TRUE;
 }
@@ -266,12 +270,6 @@ bool wxSlider::IsOwnGtkWindow( GdkWindow *window )
 #endif
 }
 
 #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),
 void wxSlider::GtkDisableEvents()
 {
     gtk_signal_disconnect_by_func( GTK_OBJECT(m_adjust),
@@ -287,4 +285,11 @@ void wxSlider::GtkEnableEvents()
                         (gpointer) this );
 }
 
                         (gpointer) this );
 }
 
+// static
+wxVisualAttributes
+wxSlider::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
+{
+    return GetDefaultAttributesFromGTKWidget(gtk_vscale_new);
+}
+
 #endif
 #endif