summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt
diff options
context:
space:
mode:
authorCarolyn MacLeod <Carolyn_MacLeod@ca.ibm.com>2012-03-08 15:39:17 -0500
committerCarolyn MacLeod <Carolyn_MacLeod@ca.ibm.com>2012-03-10 16:42:11 -0500
commit6b083490c307e06e3dbe89efcb32f0c23cd5e466 (patch)
treef3c3255cc8efb495027b333a2b1cd342f68c24a4 /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt
parent22c98fa42a51e9ecf55469a432543ede877d4e8d (diff)
downloadeclipse.platform.swt-6b083490c307e06e3dbe89efcb32f0c23cd5e466.tar.gz
eclipse.platform.swt-6b083490c307e06e3dbe89efcb32f0c23cd5e466.tar.xz
eclipse.platform.swt-6b083490c307e06e3dbe89efcb32f0c23cd5e466.zip
Initial bug110005 work (Windows)
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java11
1 files changed, 9 insertions, 2 deletions
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 65ceaa5320..fd9fd44c15 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,9 +1458,14 @@ boolean SetWindowPos (int /*long*/ hWnd, int /*long*/ hWndInsertAfter, int X, in
}
boolean showMenu (int x, int y) {
+ return showMenu (x, y, SWT.CONTEXT_POINTER);
+}
+
+boolean showMenu (int x, int y, int detail) {
Event event = new Event ();
event.x = x;
event.y = y;
+ event.detail = detail;
sendEvent (SWT.MenuDetect, event);
// widget could be disposed at this point
if (isDisposed ()) return false;
@@ -1540,12 +1545,13 @@ LRESULT wmContextMenu (int /*long*/ hwnd, int /*long*/ wParam, int /*long*/ lPar
* originated from a mouse event and display the menu when the
* mouse was released in the client area.
*/
- int x = 0, y = 0;
+ int x = 0, y = 0, detail = 0;
if (lParam != -1) {
POINT pt = new POINT ();
OS.POINTSTOPOINT (pt, lParam);
x = pt.x;
y = pt.y;
+ detail = SWT.CONTEXT_POINTER;
OS.ScreenToClient (hwnd, pt);
RECT rect = new RECT ();
OS.GetClientRect (hwnd, rect);
@@ -1554,10 +1560,11 @@ 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;
}
/* Show the menu */
- return showMenu (x, y) ? LRESULT.ZERO : null;
+ return showMenu (x, y, detail) ? LRESULT.ZERO : null;
}
LRESULT wmIMEChar (int /*long*/ hwnd, int /*long*/ wParam, int /*long*/ lParam) {