diff options
| author | Carolyn MacLeod | 2012-03-08 22:21:54 +0000 |
|---|---|---|
| committer | Carolyn MacLeod | 2012-03-10 21:42:15 +0000 |
| commit | e1cf3a98bb6cd87d3590664f506dbfd017b28fdb (patch) | |
| tree | 980482eccaa4c0a1b2dd680e20f612d85a4872e1 | |
| parent | 6b083490c307e06e3dbe89efcb32f0c23cd5e466 (diff) | |
| download | eclipse.platform.swt-e1cf3a98bb6cd87d3590664f506dbfd017b28fdb.tar.gz eclipse.platform.swt-e1cf3a98bb6cd87d3590664f506dbfd017b28fdb.tar.xz eclipse.platform.swt-e1cf3a98bb6cd87d3590664f506dbfd017b28fdb.zip | |
Change menu detect event detail constant names
4 files changed, 22 insertions, 9 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java index e1a337e42c..78bf72f3cb 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java @@ -5968,7 +5968,7 @@ void handleKeyUp(Event event) { * @param event menu detect event */ void handleMenuDetect(Event event) { - if (event.detail == SWT.CONTEXT_FOCUS) { + if (event.detail == SWT.MENU_KEYBOARD) { Point point = getPointAtOffset(caretOffset); Display display = getDisplay(); point = display.map(this, null, point); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java index 7d21f7375f..3c8bf55320 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java @@ -33,6 +33,7 @@ import org.eclipse.swt.internal.*; * </p> * * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> + * @since 3.8 */ /* NOTE: @@ -1025,9 +1026,21 @@ public class SWT { */ public static final int TOUCHSTATE_UP = 1 << 2; - public static final int CONTEXT_NONE = 1 << 0; - public static final int CONTEXT_POINTER = 1 << 1; - public static final int CONTEXT_FOCUS = 1 << 2; + /** + * Menu detect event detail value indicating that a context menu + * was requested by a mouse or other pointing device. + * + * @since 3.8 + */ + public static final int MENU_MOUSE = 1 << 1; + + /** + * Menu detect event detail value indicating that a context menu + * was requested by a keyboard or other focus-based device. + * + * @since 3.8 + */ + public static final int MENU_KEYBOARD = 1 << 2; /** * A constant indicating that widgets have changed. diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/MenuDetectEvent.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/MenuDetectEvent.java index 6d48d91773..1fa5bc99d9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/MenuDetectEvent.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/MenuDetectEvent.java @@ -47,8 +47,8 @@ public final class MenuDetectEvent extends TypedEvent { * The event trigger type. * <p><ul> * <li>{@link org.eclipse.swt.SWT#CONTEXT_NONE}</li> - * <li>{@link org.eclipse.swt.SWT#CONTEXT_POINTER}</li> - * <li>{@link org.eclipse.swt.SWT#CONTEXT_FOCUS}</li> + * <li>{@link org.eclipse.swt.SWT#MENU_MOUSE}</li> + * <li>{@link org.eclipse.swt.SWT#MENU_KEYBOARD}</li> * </ul></p> * * A field indicating whether the event was triggered by a pointing device, diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java index fd9fd44c15..40d8a72222 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java @@ -1458,7 +1458,7 @@ boolean SetWindowPos (int /*long*/ hWnd, int /*long*/ hWndInsertAfter, int X, in } boolean showMenu (int x, int y) { - return showMenu (x, y, SWT.CONTEXT_POINTER); + return showMenu (x, y, SWT.MENU_MOUSE); } boolean showMenu (int x, int y, int detail) { @@ -1551,7 +1551,7 @@ LRESULT wmContextMenu (int /*long*/ hwnd, int /*long*/ wParam, int /*long*/ lPar OS.POINTSTOPOINT (pt, lParam); x = pt.x; y = pt.y; - detail = SWT.CONTEXT_POINTER; + detail = SWT.MENU_MOUSE; OS.ScreenToClient (hwnd, pt); RECT rect = new RECT (); OS.GetClientRect (hwnd, rect); @@ -1560,7 +1560,7 @@ LRESULT wmContextMenu (int /*long*/ hwnd, int /*long*/ wParam, int /*long*/ lPar int pos = OS.GetMessagePos (); x = OS.GET_X_LPARAM (pos); y = OS.GET_Y_LPARAM (pos); - detail = SWT.CONTEXT_FOCUS; + detail = SWT.MENU_KEYBOARD; } /* Show the menu */ |
