]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/slider.cpp
interchanged w and h in wxSplitterWindow::OnSashPositionChange (now
[wxWidgets.git] / src / gtk / slider.cpp
index 01440975b1034fad942ee4bd5532ecea317038af..3c3e19901099446adf49e70f8f0f03704e697431 100644 (file)
@@ -2,9 +2,8 @@
 // Name:        slider.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Created:     01/02/97
-// Id:
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id:          $Id$
+// Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
@@ -23,7 +22,7 @@
 extern bool   g_blockEventsOnDrag;
 
 //-----------------------------------------------------------------------------
-// wxSlider
+// "value_changed"
 //-----------------------------------------------------------------------------
 
 static void gtk_slider_callback( GtkWidget *WXUNUSED(widget), wxSlider *win )
@@ -48,7 +47,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 +58,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 +86,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) );
   
@@ -96,6 +99,8 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
   
   PostCreation();
   
+  SetBackgroundColour( parent->GetBackgroundColour() );
+
   Show( TRUE );
     
   return TRUE;
@@ -234,3 +239,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) );
+}
+
+