Implement native mousewheel behaviour in wxOwnerDrawnComboBox.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63860 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1755,15 +1755,35 @@ void wxComboCtrlBase::HandleNormalMouseEvent( wxMouseEvent& event )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if ( evtType == wxEVT_MOUSEWHEEL )
|
||||||
if ( IsPopupShown() )
|
|
||||||
{
|
{
|
||||||
// relay (some) mouse events to the popup
|
if ( IsPopupShown() )
|
||||||
if ( evtType == wxEVT_MOUSEWHEEL )
|
{
|
||||||
|
// relay (some) mouse events to the popup
|
||||||
m_popup->GetEventHandler()->AddPendingEvent(event);
|
m_popup->GetEventHandler()->AddPendingEvent(event);
|
||||||
|
}
|
||||||
|
else if ( event.GetWheelAxis() == 0 &&
|
||||||
|
event.GetWheelRotation() != 0 &&
|
||||||
|
event.GetModifiers() == 0 )
|
||||||
|
{
|
||||||
|
// Translate mousewheel actions into key up/down. This is
|
||||||
|
// the simplest way of getting native behaviour: scrolling the
|
||||||
|
// wheel moves selection up/down by one item.
|
||||||
|
wxKeyEvent kevent(wxEVT_KEY_DOWN);
|
||||||
|
kevent.m_keyCode = event.GetWheelRotation() > 0
|
||||||
|
? WXK_UP
|
||||||
|
: WXK_DOWN;
|
||||||
|
GetEventHandler()->AddPendingEvent(kevent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
event.Skip();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ( evtType )
|
else if ( evtType )
|
||||||
|
{
|
||||||
event.Skip();
|
event.Skip();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxComboCtrlBase::OnKeyEvent(wxKeyEvent& event)
|
void wxComboCtrlBase::OnKeyEvent(wxKeyEvent& event)
|
||||||
|
Reference in New Issue
Block a user