From b1766c28b276e102bed83652c467df9db270b3ac Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 16 Oct 2002 20:32:12 +0000 Subject: patch #620627: mouse wheel support for NewGui svn-id: r5169 --- gui/dialog.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'gui/dialog.cpp') diff --git a/gui/dialog.cpp b/gui/dialog.cpp index 09f76edb1c..679637967b 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -163,6 +163,21 @@ void Dialog::handleMouseUp(int x, int y, int button, int clickCount) w->handleMouseUp(x - w->_x, y - w->_y, button, clickCount); } +void Dialog::handleMouseWheel(int x, int y, int direction) +{ + Widget *w; + + // This may look a bit backwards, but I think it makes more sense for + // the mouse wheel to primarily affect the widget the mouse is at than + // the widget that happens to be focused. + + w = findWidget(x, y); + if (!w) + w = _focusedWidget; + if (w) + w->handleMouseWheel(x, y, direction); +} + void Dialog::handleKeyDown(char key, int modifiers) { if (_focusedWidget) { -- cgit v1.2.3