Change the value of the appropriate adjustment instead of always using the
vertical one.
Closes #15469.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74764
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
+- Fix horizontal mouse wheel scrolling (minoki).
- Fix wxMenu::GetTitle() before the menu is appended to the bar (David Hart).
wxMSW:
- Fix wxMenu::GetTitle() before the menu is appended to the bar (David Hart).
wxMSW:
if (win->GTKProcessEvent(event))
return TRUE;
if (win->GTKProcessEvent(event))
return TRUE;
- GtkRange *range = win->m_scrollBar[wxWindow::ScrollDir_Vert];
+ GtkRange *range;
+ switch (gdk_event->direction)
+ {
+ case GDK_SCROLL_UP:
+ case GDK_SCROLL_DOWN:
+ range = win->m_scrollBar[wxWindow::ScrollDir_Vert];
+ break;
+
+ case GDK_SCROLL_LEFT:
+ case GDK_SCROLL_RIGHT:
+ range = win->m_scrollBar[wxWindow::ScrollDir_Horz];
+ break;
+
+ default:
+ return false;
+ }
if (range && gtk_widget_get_visible(GTK_WIDGET(range)))
{
GtkAdjustment* adj = gtk_range_get_adjustment(range);
double delta = gtk_adjustment_get_step_increment(adj) * 3;
if (range && gtk_widget_get_visible(GTK_WIDGET(range)))
{
GtkAdjustment* adj = gtk_range_get_adjustment(range);
double delta = gtk_adjustment_get_step_increment(adj) * 3;
- if (gdk_event->direction == GDK_SCROLL_UP)
+ if (gdk_event->direction == GDK_SCROLL_UP ||
+ gdk_event->direction == GDK_SCROLL_LEFT)
delta = -delta;
gtk_range_set_value(range, gtk_adjustment_get_value(adj) + delta);
delta = -delta;
gtk_range_set_value(range, gtk_adjustment_get_value(adj) + delta);