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:
Vadim Zeitlin
2005-07-21 10:14:36 +00:00
parent b0c4316ebd
commit 3c29734862
2 changed files with 8 additions and 4 deletions

View File

@@ -22,6 +22,7 @@ wxMSW:
- Fixed multiline tooltips handling. - Fixed multiline tooltips handling.
- Fixed wxSlider::GetSelEnd() (Atilim Cetin) - Fixed wxSlider::GetSelEnd() (Atilim Cetin)
- Fixed accelerators of menu items added to already attached submenus - Fixed accelerators of menu items added to already attached submenus
- Position of wxEVT_MOUSEWHEEL events is now in client, not screen, coordinates
wxUniv: wxUniv:

View File

@@ -4575,11 +4575,14 @@ bool wxWindowMSW::HandleMouseMove(int x, int y, WXUINT flags)
bool wxWindowMSW::HandleMouseWheel(WXWPARAM wParam, WXLPARAM lParam) bool wxWindowMSW::HandleMouseWheel(WXWPARAM wParam, WXLPARAM lParam)
{ {
#if wxUSE_MOUSEWHEEL #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); wxMouseEvent event(wxEVT_MOUSEWHEEL);
InitMouseEvent(event, InitMouseEvent(event, pt.x, pt.y, LOWORD(wParam));
GET_X_LPARAM(lParam),
GET_Y_LPARAM(lParam),
LOWORD(wParam));
event.m_wheelRotation = (short)HIWORD(wParam); event.m_wheelRotation = (short)HIWORD(wParam);
event.m_wheelDelta = WHEEL_DELTA; event.m_wheelDelta = WHEEL_DELTA;