summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2008-06-04 19:30:18 +0000
committerSilenio Quarti <silenio>2008-06-04 19:30:18 +0000
commit5ccbc836d63be99bd6e1cf9e6c2cc8027488f31c (patch)
tree24d6b53eabde036025fb4d7f93f776bac27db44e /bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt
parent989c125a414b45b4c9a816d219c1bb02999d14b0 (diff)
downloadeclipse.platform.swt-5ccbc836d63be99bd6e1cf9e6c2cc8027488f31c.tar.gz
eclipse.platform.swt-5ccbc836d63be99bd6e1cf9e6c2cc8027488f31c.tar.xz
eclipse.platform.swt-5ccbc836d63be99bd6e1cf9e6c2cc8027488f31c.zip
implement setCursor()BEFORE_JAVADOC_BASH_FOR_34RC4
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java9
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java19
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Sash.java9
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java7
4 files changed, 42 insertions, 2 deletions
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 8fa4a27919..ff2601acca 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
@@ -2099,6 +2099,12 @@ public void removeTraverseListener(TraverseListener listener) {
eventTable.unhook (SWT.Traverse, listener);
}
+void resetCursorRects (int id, int sel) {
+ super.resetCursorRects (id, sel);
+ Cursor cursor = findCursor();
+ if (cursor != null) view.addCursorRect(view.visibleRect(), cursor.handle);
+}
+
boolean sendDragEvent (int button, int stateMask, int x, int y) {
Event event = new Event ();
event.button = button;
@@ -2422,8 +2428,7 @@ public void setCursor (Cursor cursor) {
checkWidget();
if (cursor != null && cursor.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
this.cursor = cursor;
- //TODO null
-// view.addCursorRect(view.frame(), cursor.handle);
+ view.window().invalidateCursorRectsForView(view);
}
void setDefaultFont () {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
index c41fa3764e..69a7e1c108 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
@@ -1657,6 +1657,7 @@ void initClasses () {
OS.class_addMethod(cls, OS.sel_acceptsFirstResponder, proc2, "@:");
OS.class_addMethod(cls, OS.sel_resignFirstResponder, proc2, "@:");
OS.class_addMethod(cls, OS.sel_becomeFirstResponder, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:");
OS.objc_registerClassPair(cls);
className = "SWTScrollView";
@@ -1677,6 +1678,7 @@ void initClasses () {
OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
OS.class_addMethod(cls, OS.sel_sendArrowSelection, proc2, "@:");
OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:");
OS.objc_registerClassPair(cls);
className = "SWTTableView";
@@ -1690,6 +1692,7 @@ void initClasses () {
OS.class_addMethod(cls, OS.sel_tableView_1willDisplayCell_1forTableColumn_1row_1, proc6, "@:@@@i");
OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
OS.class_addMethod(cls, OS.sel_tableView_1setObjectValue_1forTableColumn_1row_1, proc6, "@:@@@i");
+ OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:");
OS.objc_registerClassPair(cls);
className = "SWTOutlineView";
@@ -1705,6 +1708,7 @@ void initClasses () {
OS.class_addMethod(cls, OS.sel_outlineView_1willDisplayCell_1forTableColumn_1item_1, proc6, "@:@@@@");
OS.class_addMethod(cls, OS.sel_outlineView_1setObjectValue_1forTableColumn_1byItem_1, proc6, "@:@@@@");
OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:");
OS.objc_registerClassPair(cls);
className = "SWTTreeItem";
@@ -1723,6 +1727,7 @@ void initClasses () {
OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:");
OS.objc_registerClassPair(cls);
className = "SWTBox";
@@ -1732,6 +1737,7 @@ void initClasses () {
OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:");
OS.objc_registerClassPair(cls);
className = "SWTProgressIndicator";
@@ -1741,12 +1747,14 @@ void initClasses () {
OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:");
OS.objc_registerClassPair(cls);
className = "SWTSlider";
cls = OS.objc_allocateClassPair(OS.class_NSSlider, className, 0);
// OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:");
OS.objc_registerClassPair(cls);
className = "SWTPopUpButton";
@@ -1762,6 +1770,7 @@ void initClasses () {
OS.class_addMethod(cls, OS.sel_comboBoxSelectionDidChange_1, proc3, "@:@");
OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:");
OS.objc_registerClassPair(cls);
className = "SWTDatePicker";
@@ -1769,6 +1778,7 @@ void initClasses () {
// OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:");
OS.objc_registerClassPair(cls);
className = "SWTImageView";
@@ -1779,6 +1789,7 @@ void initClasses () {
OS.class_addMethod(cls, OS.sel_mouseUp_1, proc3, "@:@");
OS.class_addMethod(cls, OS.sel_rightMouseDown_1, proc3, "@:@");
OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:");
OS.objc_registerClassPair(cls);
className = "SWTStepper";
@@ -1786,6 +1797,7 @@ void initClasses () {
// OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:");
OS.objc_registerClassPair(cls);
className = "SWTScroller";
@@ -1793,6 +1805,7 @@ void initClasses () {
// OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:");
OS.objc_registerClassPair(cls);
className = "SWTMenuItem";
@@ -1810,11 +1823,13 @@ void initClasses () {
OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
OS.class_addMethod(cls, OS.sel_textView_1clickedOnLink_1atIndex_1, proc5, "@:@@i");
+ OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:");
OS.objc_registerClassPair(cls);
className = "SWTTextField";
cls = OS.objc_allocateClassPair(OS.class_NSTextField, className, 0);
OS.class_addMethod(cls, OS.sel_drawRect_1, drawRectProc, "@:i");
+ OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:");
OS.objc_registerClassPair(cls);
className = "SWTWindow";
@@ -3176,6 +3191,10 @@ int windowDelegateProc(int delegate, int sel) {
if (sel == OS.sel_resignFirstResponder) {
return widget.resignFirstResponder() ? 1 : 0;
}
+ if (sel == OS.sel_resetCursorRects) {
+ widget.resetCursorRects(delegate, sel);
+ return 0;
+ }
return 0;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Sash.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Sash.java
index fbb0ffae14..95e41adfe0 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Sash.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Sash.java
@@ -311,6 +311,15 @@ public void removeSelectionListener(SelectionListener listener) {
eventTable.unhook(SWT.DefaultSelection,listener);
}
+void resetCursorRects (int id, int sel) {
+ super.resetCursorRects (id, sel);
+ Cursor cursor = findCursor();
+ if (cursor == null) {
+ cursor = display.getSystemCursor((style & SWT.HORIZONTAL) != 0 ? SWT.CURSOR_SIZENS : SWT.CURSOR_SIZEWE);
+ view.addCursorRect(view.visibleRect(), cursor.handle);
+ }
+}
+
int traversalCode (int key, NSEvent theEvent) {
return 0;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java
index 8c12955963..9d31dc3c3f 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java
@@ -143,6 +143,13 @@ boolean becomeFirstResponder () {
return true;
}
+void resetCursorRects (int id, int sel) {
+ objc_super super_struct = new objc_super();
+ super_struct.receiver = id;
+ super_struct.cls = OS.objc_msgSend(id, OS.sel_superclass);
+ OS.objc_msgSendSuper(super_struct, sel);
+}
+
boolean resignFirstResponder () {
return true;
}