summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Northover <steve>2002-10-28 17:24:56 +0000
committerSteve Northover <steve>2002-10-28 17:24:56 +0000
commitbd218c3eb569f129d11747c306f4ee217901f37c (patch)
treec9e7cbc0f4e6f6cf3daaea4512cf7e5b1e679eaf
parent1e905df1cdbc5538b1dad05f8f32cbd4a85b85ac (diff)
downloadeclipse.platform.swt-bd218c3eb569f129d11747c306f4ee217901f37c.tar.gz
eclipse.platform.swt-bd218c3eb569f129d11747c306f4ee217901f37c.tar.xz
eclipse.platform.swt-bd218c3eb569f129d11747c306f4ee217901f37c.zip
24619
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java44
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java6
2 files changed, 22 insertions, 28 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java
index 0f430a1cbe..78e100a6fa 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java
@@ -1286,17 +1286,7 @@ int processMouseDown (MacMouseEvent mmEvent) {
return OS.noErr;
}
int processMouseEnter (MacMouseEvent mme) {
- /* AW
- XCrossingEvent xEvent = new XCrossingEvent ();
- OS.memmove (xEvent, callData, XCrossingEvent.sizeof);
- if (xEvent.mode != OS.NotifyNormal) return 0;
- if (xEvent.subwindow != 0) return 0;
- */
- Event event = new Event ();
- Point p= MacUtil.toControl(handle, mme.getWhere());
- event.x = p.x;
- event.y = p.y;
- postEvent (SWT.MouseEnter, event);
+ sendMouseEvent (SWT.MouseEnter, 0, mme);
return OS.noErr;
}
int processMouseMove (MacMouseEvent mme) {
@@ -1309,26 +1299,13 @@ int processMouseExit (MacMouseEvent mme) {
Display display = getDisplay ();
display.removeMouseHoverTimeOut ();
display.hideToolTip ();
- /* AW
- XCrossingEvent xEvent = new XCrossingEvent ();
- OS.memmove (xEvent, callData, XCrossingEvent.sizeof);
- if (xEvent.mode != OS.NotifyNormal) return 0;
- if (xEvent.subwindow != 0) return 0;
- */
- Event event = new Event ();
- Point p= MacUtil.toControl(handle, mme.getWhere());
- event.x = p.x;
- event.y = p.y;
- postEvent (SWT.MouseExit, event);
+ sendMouseEvent (SWT.MouseExit, 0, mme);
return OS.noErr;
}
int processMouseHover (MacMouseEvent mme) {
Display display = getDisplay ();
- Event event = new Event ();
- Point local = toControl (display.getCursorLocation ());
- event.x = local.x; event.y = local.y;
- postEvent (SWT.MouseHover, event);
display.showToolTip (handle, toolTipText);
+ sendMouseEvent (SWT.MouseHover, 0, mme);
return OS.noErr;
}
int processMouseUp (MacMouseEvent mmEvent) {
@@ -2668,4 +2645,19 @@ public void update () {
void internalGetControlBounds(int hndl, Rect bounds) {
OS.GetControlBounds(hndl, bounds);
}
+
+ /**
+ * Hook (overwritten in Text and Combo)
+ */
+ /*
+ final int sendKeyEvent(int type, int nextHandler, int eRefHandle) {
+
+ MacEvent mEvent= new MacEvent(eRefHandle);
+ if (translateTraversal(mEvent))
+ return 0;
+
+ processEvent (type, new MacEvent(eRefHandle));
+ return OS.kNoErr;
+ }
+ */
} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java
index b88c0e86e7..a4978224a6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java
@@ -246,6 +246,7 @@ public class Display extends Device {
public int fCurrentCursor;
private Shell fMenuRootShell;
int fLastModifiers;
+ MacMouseEvent fLastMouseEvent;
private static boolean fgCarbonInitialized;
private static boolean fgInitCursorCalled;
@@ -1116,7 +1117,8 @@ static boolean isValidClass (Class clazz) {
int mouseHoverProc (int id, int handle) {
if (mouseHoverID != 0) OS.RemoveEventLoopTimer(mouseHoverID);
mouseHoverID = mouseHoverHandle = 0;
- int rc= windowProc (handle, SWT.MouseHover, new MacMouseEvent());
+ if (fLastMouseEvent == null) return OS.noErr;
+ int rc= windowProc (handle, SWT.MouseHover, fLastMouseEvent);
sendUserEvent(54321);
return rc;
}
@@ -2250,7 +2252,7 @@ static String convertToLf(String text) {
int whichControl= MacUtil.findControlUnderMouse(whichWindow, me, cpart);
Widget widget= WidgetTable.get(whichControl);
- MacMouseEvent mme= new MacMouseEvent(me);
+ MacMouseEvent mme= fLastMouseEvent = new MacMouseEvent(me);
switch (eventKind) {