Use ForwardMouseWheelEvent rather than checking window bounds

This commit is contained in:
Thomas Goyne 2013-08-14 20:09:10 -07:00
parent c7aba2f54a
commit dd6542c143

View file

@ -145,23 +145,17 @@ void VideoSlider::OnMouse(wxMouseEvent &event) {
c->videoController->JumpToFrame(val);
}
else if (event.GetWheelRotation() != 0) {
else if (event.GetWheelRotation() != 0 && ForwardMouseWheelEvent(this, event)) {
// If mouse is over the slider, use wheel to step by frames or keyframes (when Shift is held)
if (GetClientRect().Contains(event.GetX(), event.GetY())) {
if (event.ShiftDown())
if (event.GetWheelRotation() < 0)
cmd::call("video/frame/next/keyframe", c);
else
cmd::call("video/frame/prev/keyframe", c);
else {
SetValue(val + (event.GetWheelRotation() > 0 ? -1 : 1));
c->videoController->JumpToFrame(val);
}
if (event.ShiftDown())
if (event.GetWheelRotation() < 0)
cmd::call("video/frame/next/keyframe", c);
else
cmd::call("video/frame/prev/keyframe", c);
else {
SetValue(val + (event.GetWheelRotation() > 0 ? -1 : 1));
c->videoController->JumpToFrame(val);
}
else
// Forward Wheel to subs grid to scroll by line/page
if (c->subsGrid->GetClientRect().Contains(event.GetX(), event.GetY()))
c->subsGrid->GetEventHandler()->ProcessEvent(event);
}
}