position of wxEVT_MOUSEWHEEL events is now in client, not screen, coordinates
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34897 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -4575,11 +4575,14 @@ bool wxWindowMSW::HandleMouseMove(int x, int y, WXUINT flags)
|
||||
bool wxWindowMSW::HandleMouseWheel(WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
#if wxUSE_MOUSEWHEEL
|
||||
// notice that WM_MOUSEWHEEL position is in screen coords (as it's
|
||||
// forwarded up to the parent by DefWindowProc()) and not in the client
|
||||
// ones as all the other messages, translate them to the client coords for
|
||||
// consistency
|
||||
const wxPoint
|
||||
pt = ScreenToClient(wxPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)));
|
||||
wxMouseEvent event(wxEVT_MOUSEWHEEL);
|
||||
InitMouseEvent(event,
|
||||
GET_X_LPARAM(lParam),
|
||||
GET_Y_LPARAM(lParam),
|
||||
LOWORD(wParam));
|
||||
InitMouseEvent(event, pt.x, pt.y, LOWORD(wParam));
|
||||
event.m_wheelRotation = (short)HIWORD(wParam);
|
||||
event.m_wheelDelta = WHEEL_DELTA;
|
||||
|
||||
|
Reference in New Issue
Block a user