}
bool wxSpinButton::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
- WXWORD pos, WXHWND control)
+ WXWORD WXUNUSED(pos), WXHWND control)
{
wxCHECK_MSG( control, false, wxT("scrolling what?") );
}
wxSpinEvent event(wxEVT_SCROLL_THUMBTRACK, m_windowId);
- event.SetPosition((short)pos); // cast is important for negative values!
+ // We can't use 16 bit position provided in this message for spin buttons
+ // using 32 bit range.
+ event.SetPosition(GetValue());
event.SetEventObject(this);
return HandleWindowEvent(event);
}
bool wxSpinCtrl::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
- WXWORD pos, WXHWND control)
+ WXWORD WXUNUSED(pos), WXHWND control)
{
wxCHECK_MSG( control, false, wxT("scrolling what?") );
return false;
}
- int new_value = (short) pos;
+ // Notice that we can't use "pos" from WM_VSCROLL as it is 16 bit and we
+ // might be using 32 bit range.
+ int new_value = GetValue();
if (m_oldValue != new_value)
SendSpinUpdate( new_value );
- return TRUE;
+ return true;
}
bool wxSpinCtrl::MSWOnNotify(int WXUNUSED(idCtrl), WXLPARAM lParam, WXLPARAM *result)