summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/cocoa
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2009-02-06 22:26:13 +0000
committerSilenio Quarti <silenio>2009-02-06 22:26:13 +0000
commitd2d3b59527daeecd67e136042aa132b73c698426 (patch)
treeb39e6c0abd4951cd1367223d0849ff8a048416c4 /bundles/org.eclipse.swt/Eclipse SWT/cocoa
parentbd65f48f077afd4b15868a6c52778cfb3455db75 (diff)
downloadeclipse.platform.swt-d2d3b59527daeecd67e136042aa132b73c698426.tar.gz
eclipse.platform.swt-d2d3b59527daeecd67e136042aa132b73c698426.tar.xz
eclipse.platform.swt-d2d3b59527daeecd67e136042aa132b73c698426.zip
fixing mouse events in the fieldEditor, corner of scrolled widgets and header of table
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/cocoa')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java4
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java12
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java4
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java4
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java4
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java5
6 files changed, 30 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java
index f0731adc22..d43e08309b 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java
@@ -901,6 +901,10 @@ void insertEditText (String string) {
}
}
+boolean isEventView (int /*long*/ id) {
+ return true;
+}
+
void mouseDown(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
// If this is a combo box with an editor field and the control is disposed
// while the view's cell editor is open we crash while tearing down the
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
index 2d939ac801..f0614064ab 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
@@ -1877,10 +1877,14 @@ void scrollWheel (int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
super.scrollWheel(id, sel, theEvent);
}
+boolean isEventView (int /*long*/ id) {
+ return true;
+}
+
boolean mouseEvent (int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent, int type) {
- if (id != eventView ().id) return true;
if (!display.sendEvent) return true;
display.sendEvent = false;
+ if (!isEventView (id)) return true;
Control control = this;
NSEvent nsEvent = new NSEvent(theEvent);
int nsType = (int)/*64*/nsEvent.type();
@@ -1921,10 +1925,11 @@ boolean mouseEvent (int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent, in
void mouseDown(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
if (!mouseEvent(id, sel, theEvent, SWT.MouseDown)) return;
+ boolean set = isEventView (id);
Display display = this.display;
- display.trackingControl = this;
+ if (set) display.trackingControl = this;
super.mouseDown(id, sel, theEvent);
- display.trackingControl = null;
+ if (set) display.trackingControl = null;
}
void mouseUp(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
@@ -2648,6 +2653,7 @@ void sendFocusEvent (int type, boolean post) {
}
boolean sendMouseEvent (NSEvent nsEvent, int type, boolean send) {
+ System.out.println(type + " " + this);
NSInputManager manager = NSInputManager.currentInputManager ();
if (manager != null && manager.wantsToHandleMouseEvents ()) {
if (manager.handleMouseEvent (nsEvent)) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java
index 467466ec98..72a027a01d 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java
@@ -293,6 +293,10 @@ public int getYear () {
return (int)/*64*/getCalendarDate().yearOfCommonEra();
}
+boolean isEventView (int /*long*/ id) {
+ return true;
+}
+
/**
* Removes the listener from the collection of listeners who will
* be notified when the control is selected by the user.
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java
index 33bdf5b6be..0972e09f93 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java
@@ -233,6 +233,10 @@ boolean hooksKeys () {
return hooks (SWT.KeyDown) || hooks (SWT.KeyUp) || hooks (SWT.Traverse);
}
+boolean isEventView (int /*long*/ id) {
+ return id == eventView ().id;
+}
+
boolean isTrim (NSView view) {
if (scrollView != null) {
if (scrollView.id == view.id) return true;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java
index c2f6aefc31..c4bd0eef71 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java
@@ -490,6 +490,10 @@ public int getTextLimit () {
return textLimit;
}
+boolean isEventView (int /*long*/ id) {
+ return true;
+}
+
/**
* Pastes text from clipboard.
* <p>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java
index 4f9d7e1133..37c53bc07c 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java
@@ -1127,6 +1127,11 @@ void insertEditText (String string) {
}
}
+boolean isEventView (int /*long*/ id) {
+ if ((style & SWT.MULTI) != 0) return super.isEventView (id);
+ return true;
+}
+
/**
* Pastes text from clipboard.
* <p>