X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c2f14eeb84c08651a96050ff1f05d195fe3db7f..caa2490c0fb8053b1d416117a9619695d75af9e4:/src/gtk1/scrolbar.cpp diff --git a/src/gtk1/scrolbar.cpp b/src/gtk1/scrolbar.cpp index a2bb3082e8..7c8b236b7f 100644 --- a/src/gtk1/scrolbar.cpp +++ b/src/gtk1/scrolbar.cpp @@ -46,6 +46,7 @@ static const float sensitivity = 0.02; // FIXME: is GtkScrollType really passed to us as 2nd argument? +extern "C" { static void gtk_scrollbar_callback( GtkAdjustment *adjust, SCROLLBAR_CBACK_ARG wxScrollBar *win ) @@ -67,10 +68,6 @@ static void gtk_scrollbar_callback( GtkAdjustment *adjust, int orient = win->HasFlag(wxSB_VERTICAL) ? wxVERTICAL : wxHORIZONTAL; - wxScrollEvent event( command, win->GetId(), value, orient ); - event.SetEventObject( win ); - win->GetEventHandler()->ProcessEvent( event ); - // throw a LINEUP / LINEDOWN event if necessary if (g_currentUpDownEvent != wxEVT_NULL) { @@ -78,6 +75,11 @@ static void gtk_scrollbar_callback( GtkAdjustment *adjust, event.SetEventObject( win ); win->GetEventHandler()->ProcessEvent( event ); } + + // throw other event (wxEVT_SCROLL_THUMBTRACK) + wxScrollEvent event( command, win->GetId(), value, orient ); + event.SetEventObject( win ); + win->GetEventHandler()->ProcessEvent( event ); /* wxCommandEvent cevent( wxEVT_COMMAND_SCROLLBAR_UPDATED, win->GetId() ); @@ -85,10 +87,12 @@ static void gtk_scrollbar_callback( GtkAdjustment *adjust, win->ProcessEvent( cevent ); */ } +} //----------------------------------------------------------------------------- // "button_press_event" from slider //----------------------------------------------------------------------------- +extern "C" { static gint gtk_scrollbar_button_press_callback( GtkRange *widget, GdkEventButton *gdk_event, wxScrollBar *win ) @@ -102,7 +106,7 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *widget, int scroll_height, mouse_pos; // get the mouse position when the click is done - if (widget->orientation == GTK_ORIENTATION_VERTICAL) + if (win->HasFlag(wxSB_VERTICAL)) { scroll_height = GTK_WIDGET(widget)->allocation.height - 16; mouse_pos = (int)gdk_event->y; @@ -127,11 +131,13 @@ static gint gtk_scrollbar_button_press_callback( GtkRange *widget, return FALSE; } +} //----------------------------------------------------------------------------- // "button_release_event" from slider //----------------------------------------------------------------------------- +extern "C" { static gint gtk_scrollbar_button_release_callback( GtkRange *WXUNUSED(widget), GdkEventButton *WXUNUSED(gdk_event), @@ -158,6 +164,7 @@ gtk_scrollbar_button_release_callback( GtkRange *WXUNUSED(widget), return FALSE; } +} //----------------------------------------------------------------------------- // wxScrollBar