Refactor MSW gesture events initialization

Don't repeat the same code for initializing events in several different
functions but put it in a helper InitGestureEvent() function and just
call it from the event-specific handlers.
This commit is contained in:
Vadim Zeitlin
2017-11-21 17:24:19 +01:00
parent 989dd36405
commit b3e726faed
2 changed files with 28 additions and 63 deletions

View File

@@ -360,6 +360,10 @@ public:
bool HandleMouseWheel(wxMouseWheelAxis axis,
WXWPARAM wParam, WXLPARAM lParam);
// Common gesture event initialization, returns true if it is the initial
// event (GF_BEGIN set in flags), false otherwise.
bool InitGestureEvent(wxGestureEvent& event, int x, int y, WXDWORD flags);
bool HandlePanGesture(int x, int y, WXDWORD flags);
bool HandleZoomGesture(int x, int y, WXDWORD fingerDistance, WXDWORD flags);
bool HandleRotateGesture(int x, int y, WXDWORD angleArgument, WXDWORD flags);