Add support for horizontal mouse wheel events to wxGTK too.
Handle GDK_SCROLL_{RIGHT,LEFT} directions in scroll-event handler in wxGTK. Closes #14221. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71195 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -480,6 +480,7 @@ All:
|
|||||||
All (GUI):
|
All (GUI):
|
||||||
|
|
||||||
- Added strike-through support to wxFont (Igor Korot).
|
- Added strike-through support to wxFont (Igor Korot).
|
||||||
|
- Add support for horizontal mouse wheel events to MSW and GTK (Lauri Nurmi).
|
||||||
- Fix infinite loop in wxHtmlEasyPrinting when trying to page break images
|
- Fix infinite loop in wxHtmlEasyPrinting when trying to page break images
|
||||||
taller than the page height in wxHtmlEasyPrinting (Laurent Poujoulat).
|
taller than the page height in wxHtmlEasyPrinting (Laurent Poujoulat).
|
||||||
- Added wxFilePickerCtrl::SetInitialDirectory().
|
- Added wxFilePickerCtrl::SetInitialDirectory().
|
||||||
@@ -521,7 +522,6 @@ MSW:
|
|||||||
- Add wxActiveXContainer::QueryClientSiteInterface and implement it in
|
- Add wxActiveXContainer::QueryClientSiteInterface and implement it in
|
||||||
wxWebViewIE to improve the default behaviour (Allonii).
|
wxWebViewIE to improve the default behaviour (Allonii).
|
||||||
- Update stretchable spaces in wxToolBar after tool removal (Catalin Raceanu).
|
- Update stretchable spaces in wxToolBar after tool removal (Catalin Raceanu).
|
||||||
- Add support for horizontal mouse wheel events (Lauri Nurmi).
|
|
||||||
- Implement wxGraphicsContext::SetInterpolationQuality() (Eric Jensen).
|
- Implement wxGraphicsContext::SetInterpolationQuality() (Eric Jensen).
|
||||||
- Fix coordinate handling in wxDC::Blit() when source DC is a DIB.
|
- Fix coordinate handling in wxDC::Blit() when source DC is a DIB.
|
||||||
- Fix handling of composite windows in wxToolTip (Armel Asselin).
|
- Fix handling of composite windows in wxToolTip (Armel Asselin).
|
||||||
|
@@ -1641,22 +1641,43 @@ window_scroll_event_hscrollbar(GtkWidget*, GdkEventScroll* gdk_event, wxWindow*
|
|||||||
static gboolean
|
static gboolean
|
||||||
window_scroll_event(GtkWidget*, GdkEventScroll* gdk_event, wxWindow* win)
|
window_scroll_event(GtkWidget*, GdkEventScroll* gdk_event, wxWindow* win)
|
||||||
{
|
{
|
||||||
if (gdk_event->direction != GDK_SCROLL_UP &&
|
|
||||||
gdk_event->direction != GDK_SCROLL_DOWN)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxMouseEvent event(wxEVT_MOUSEWHEEL);
|
wxMouseEvent event(wxEVT_MOUSEWHEEL);
|
||||||
InitMouseEvent(win, event, gdk_event);
|
InitMouseEvent(win, event, gdk_event);
|
||||||
|
|
||||||
// FIXME: Get these values from GTK or GDK
|
// FIXME: Get these values from GTK or GDK
|
||||||
event.m_linesPerAction = 3;
|
event.m_linesPerAction = 3;
|
||||||
event.m_wheelDelta = 120;
|
event.m_wheelDelta = 120;
|
||||||
if (gdk_event->direction == GDK_SCROLL_UP)
|
|
||||||
|
// Determine the scroll direction.
|
||||||
|
switch (gdk_event->direction)
|
||||||
|
{
|
||||||
|
case GDK_SCROLL_UP:
|
||||||
|
case GDK_SCROLL_RIGHT:
|
||||||
event.m_wheelRotation = 120;
|
event.m_wheelRotation = 120;
|
||||||
else
|
break;
|
||||||
|
|
||||||
|
case GDK_SCROLL_DOWN:
|
||||||
|
case GDK_SCROLL_LEFT:
|
||||||
event.m_wheelRotation = -120;
|
event.m_wheelRotation = -120;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return false; // Unknown/unhandled direction
|
||||||
|
}
|
||||||
|
|
||||||
|
// And the scroll axis.
|
||||||
|
switch (gdk_event->direction)
|
||||||
|
{
|
||||||
|
case GDK_SCROLL_UP:
|
||||||
|
case GDK_SCROLL_DOWN:
|
||||||
|
event.m_wheelAxis = wxMOUSE_WHEEL_VERTICAL;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GDK_SCROLL_LEFT:
|
||||||
|
case GDK_SCROLL_RIGHT:
|
||||||
|
event.m_wheelAxis = wxMOUSE_WHEEL_HORIZONTAL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (win->GTKProcessEvent(event))
|
if (win->GTKProcessEvent(event))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Reference in New Issue
Block a user