diff options
author | Felipe Heidrich <fheidric> | 2010-12-21 17:17:06 +0000 |
---|---|---|
committer | Felipe Heidrich <fheidric> | 2010-12-21 17:17:06 +0000 |
commit | 1034efdda128f80759c28bd972b3a2faf7fa970a (patch) | |
tree | fdc93d5aa81345af04931646dd4bd5e620c2bdec /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java | |
parent | f77b713da589c0f23980e28b6a2dad546ca09c3b (diff) | |
download | eclipse.platform.swt-1034efdda128f80759c28bd972b3a2faf7fa970a.tar.gz eclipse.platform.swt-1034efdda128f80759c28bd972b3a2faf7fa970a.tar.xz eclipse.platform.swt-1034efdda128f80759c28bd972b3a2faf7fa970a.zip |
refactoring
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java')
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java index bc1ac27175..62181a0110 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java @@ -5046,7 +5046,59 @@ LRESULT WM_SYSKEYUP (int /*long*/ wParam, int /*long*/ lParam) { } LRESULT WM_TABLET_FLICK (int /*long*/ wParam, int /*long*/ lParam) { - return wmTabletFlick (handle, wParam, lParam); + if (!hooks (SWT.Gesture) && !filters (SWT.Gesture)) return null; + Event event = new Event (); + FLICK_DATA fData = new FLICK_DATA (); + int /*long*/ [] source = new int /*long*/ [1]; + source[0] = wParam; + OS.MoveMemory (fData, source, OS.FLICK_DATA_sizeof ()); + FLICK_POINT fPoint = new FLICK_POINT (); + source [0] = lParam; + OS.MoveMemory (fPoint, source, OS.FLICK_POINT_sizeof ()); + + /* The iFlickDirection field is defined as a 3-bit value in the FLICK_DATA structure */ + switch (fData.iFlickDirection & 0x7) { + case OS.FLICKDIRECTION_RIGHT: + event.xDirection = 1; + event.yDirection = 0; + break; + case OS.FLICKDIRECTION_UPRIGHT: + event.xDirection = 1; + event.yDirection = -1; + break; + case OS.FLICKDIRECTION_UP: + event.xDirection = 0; + event.yDirection = -1; + break; + case OS.FLICKDIRECTION_UPLEFT: + event.xDirection = -1; + event.yDirection = -1; + break; + case OS.FLICKDIRECTION_LEFT: + event.xDirection = -1; + event.yDirection = 0; + break; + case OS.FLICKDIRECTION_DOWNLEFT: + event.xDirection = -1; + event.yDirection = 1; + break; + case OS.FLICKDIRECTION_DOWN: + event.xDirection = 0; + event.yDirection = 1; + break; + case OS.FLICKDIRECTION_DOWNRIGHT: + event.xDirection = 1; + event.yDirection = 1; + break; + } + + event.x = fPoint.x; + event.y = fPoint.y; + event.type = SWT.Gesture; + event.detail = SWT.GESTURE_SWIPE; + setInputState (event, SWT.Gesture); + sendEvent (SWT.Gesture, event); + return event.doit ? null : LRESULT.ONE; } LRESULT WM_TIMER (int /*long*/ wParam, int /*long*/ lParam) { |