added mouse wheel support (patch 1696082)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45340 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -127,6 +127,10 @@ wxMSW:
|
||||
- Fixed infinite loop in wxThread::Wait() in console applications.
|
||||
- Return the restored window size from GetSize() when window is minimized.
|
||||
|
||||
wxX11:
|
||||
|
||||
- Added mouse wheel support (David Hart)
|
||||
|
||||
|
||||
2.8.4
|
||||
-----
|
||||
|
@@ -1463,6 +1463,22 @@ bool wxTranslateMouseEvent(wxMouseEvent& wxevent, wxWindow *win, Window window,
|
||||
eventType = wxEVT_RIGHT_DOWN;
|
||||
button = 3;
|
||||
}
|
||||
else if ( xevent->xbutton.button == Button4 ||
|
||||
xevent->xbutton.button == Button5 )
|
||||
{
|
||||
// this is the same value as used under wxMSW
|
||||
static const int WHEEL_DELTA = 120;
|
||||
|
||||
eventType = wxEVT_MOUSEWHEEL;
|
||||
button = xevent->xbutton.button;
|
||||
|
||||
wxevent.m_linesPerAction = 3;
|
||||
wxevent.m_wheelDelta = WHEEL_DELTA;
|
||||
|
||||
// Button 4 means mousewheel up, 5 means down
|
||||
wxevent.m_wheelRotation = button == Button4 ? WHEEL_DELTA
|
||||
: -WHEEL_DELTA;
|
||||
}
|
||||
|
||||
// check for a double click
|
||||
// TODO: where can we get this value from?
|
||||
|
Reference in New Issue
Block a user