X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6de97a3b945c99fb942209df48be26f43c1b436d..520e470fdd0daef09c77938db642e4583933c90d:/src/gtk/slider.cpp diff --git a/src/gtk/slider.cpp b/src/gtk/slider.cpp index 01440975b1..3f2b9b84f8 100644 --- a/src/gtk/slider.cpp +++ b/src/gtk/slider.cpp @@ -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) ); +} + +