]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/scrolbar.cpp
don't let the user modify the contents of read-only control (modified patch 1463707)
[wxWidgets.git] / src / gtk / scrolbar.cpp
index aadb7d0086e89f296a963efcb17f32f79b625ccc..4319b39407ca9df9289644e1db129bcf30dfc220 100644 (file)
 #include "wx/math.h"
 #include "wx/gtk/private.h"
 
-//-----------------------------------------------------------------------------
-// idle system
-//-----------------------------------------------------------------------------
-
-extern void wxapp_install_idle_handler();
-extern bool g_isIdle;
-
 //-----------------------------------------------------------------------------
 // data
 //-----------------------------------------------------------------------------
@@ -42,7 +35,6 @@ static const float sensitivity = 0.02;
 
 extern "C" {
 static void gtk_scrollbar_callback( GtkAdjustment *adjust,
-                                    SCROLLBAR_CBACK_ARG
                                     wxScrollBar *win )
 {
     if (g_isIdle) wxapp_install_idle_handler();
@@ -55,7 +47,7 @@ static void gtk_scrollbar_callback( GtkAdjustment *adjust,
 
     win->m_oldPos = adjust->value;
 
-    wxEventType command = GtkScrollTypeToWx(GET_SCROLL_TYPE(win->m_widget));
+    wxEventType command = GtkScrollTypeToWx(GTK_SCROLL_JUMP);
 
     double dvalue = adjust->value;
     int value = (int)(dvalue < 0 ? dvalue - 0.5 : dvalue + 0.5);
@@ -187,6 +179,10 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
         m_widget = gtk_hscrollbar_new( (GtkAdjustment *) NULL );
 
     m_adjust = gtk_range_get_adjustment( GTK_RANGE(m_widget) );
+    if ( style & wxSB_VERTICAL )
+    {
+        SetVScrollAdjustment(m_adjust);
+    }
 
     g_signal_connect (m_adjust, "value_changed",
                       G_CALLBACK (gtk_scrollbar_callback), this);