Fixed HandleMouseWheel to be __WIN32__ sensitive
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10011 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3371,16 +3371,31 @@ bool wxWindow::HandleMouseWheel(WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
GET_X_LPARAM(lParam),
|
GET_X_LPARAM(lParam),
|
||||||
GET_Y_LPARAM(lParam),
|
GET_Y_LPARAM(lParam),
|
||||||
LOWORD(wParam));
|
LOWORD(wParam));
|
||||||
|
|
||||||
event.m_wheelRotation = (short)HIWORD(wParam);
|
event.m_wheelRotation = (short)HIWORD(wParam);
|
||||||
event.m_wheelDelta = WHEEL_DELTA;
|
event.m_wheelDelta = WHEEL_DELTA;
|
||||||
|
|
||||||
int linesPer;
|
#ifdef __WIN32__
|
||||||
if (!SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &linesPer, 0))
|
static int s_linesPerRotation = -1;
|
||||||
linesPer = 1;
|
if ( s_linesPerRotation == -1 )
|
||||||
event.m_linesPerAction = linesPer;
|
{
|
||||||
|
if ( !::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0,
|
||||||
|
&s_linesPerRotation, 0))
|
||||||
|
{
|
||||||
|
// this is not supposed to happen
|
||||||
|
wxLogLastError(_T("SystemParametersInfo(GETWHEELSCROLLLINES)"));
|
||||||
|
|
||||||
|
// the default is 3, so use it if SystemParametersInfo() failed
|
||||||
|
s_linesPerRotation = 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else // Win16
|
||||||
|
// no SystemParametersInfo() under Win16
|
||||||
|
static const int s_linesPerRotation = 3;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
event.m_linesPerAction = s_linesPerRotation;
|
||||||
return GetEventHandler()->ProcessEvent(event);
|
return GetEventHandler()->ProcessEvent(event);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user