]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/slider.cpp
Prealpha, prebeta of new wxTreeCtrl for GTK. It is possible to AddRoot,
[wxWidgets.git] / src / gtk / slider.cpp
index 01440975b1034fad942ee4bd5532ecea317038af..3f2b9b84f8e027af584db4463ee8daf1dc25147d 100644 (file)
@@ -23,7 +23,7 @@
 extern bool   g_blockEventsOnDrag;
 
 //-----------------------------------------------------------------------------
-// wxSlider
+// "value_changed"
 //-----------------------------------------------------------------------------
 
 static void gtk_slider_callback( GtkWidget *WXUNUSED(widget), wxSlider *win )
@@ -48,7 +48,7 @@ static void gtk_slider_callback( GtkWidget *WXUNUSED(widget), wxSlider *win )
   int value = (int)(win->m_adjust->value+0.5);
       
   int orient = wxHORIZONTAL;
-  if (win->GetWindowStyleFlag() & wxSB_VERTICAL == wxSB_VERTICAL) orient = wxHORIZONTAL;
+  if (win->GetWindowStyleFlag() & wxSB_VERTICAL == wxSB_VERTICAL) orient = wxVERTICAL;
   
   wxScrollEvent event( command, win->GetId(), value, orient );
   event.SetEventObject( win );
@@ -59,6 +59,10 @@ static void gtk_slider_callback( GtkWidget *WXUNUSED(widget), wxSlider *win )
   win->ProcessEvent( cevent );
 }
 
+//-----------------------------------------------------------------------------
+// wxSlider
+//-----------------------------------------------------------------------------
+
 IMPLEMENT_DYNAMIC_CLASS(wxSlider,wxControl)
 
 wxSlider::wxSlider(void)
@@ -83,9 +87,9 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
   m_oldPos = 0.0;
 
   if (style & wxSL_VERTICAL == wxSL_VERTICAL)
-    m_widget = gtk_hscale_new( NULL );
+    m_widget = gtk_hscale_new( (GtkAdjustment *) NULL );
   else
-    m_widget = gtk_vscale_new( NULL );
+    m_widget = gtk_vscale_new( (GtkAdjustment *) NULL );
     
   m_adjust = gtk_range_get_adjustment( GTK_RANGE(m_widget) );
   
@@ -234,3 +238,14 @@ void wxSlider::ClearSel(void)
 {
 }
 
+bool wxSlider::IsOwnGtkWindow( GdkWindow *window )
+{
+  GtkRange *range = GTK_RANGE(m_widget);
+  return ( (window == GTK_WIDGET(range)->window) ||
+           (window == range->trough) ||
+          (window == range->slider) ||
+          (window == range->step_forw) ||
+          (window == range->step_back) );
+}
+
+