summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Northover <steve>2002-12-11 01:10:03 +0000
committerSteve Northover <steve>2002-12-11 01:10:03 +0000
commit805ae5e175704e364f714b299517e4ac5a92be9a (patch)
treeb43e6a2ee12c45a1b4e6c5abe5f5d64c7c201cc0
parent7ef9314c256eb82b286abb1213514cc506334d6f (diff)
downloadeclipse.platform.swt-805ae5e175704e364f714b299517e4ac5a92be9a.tar.gz
eclipse.platform.swt-805ae5e175704e364f714b299517e4ac5a92be9a.tar.xz
eclipse.platform.swt-805ae5e175704e364f714b299517e4ac5a92be9a.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/List.java24
1 files changed, 20 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/List.java
index b07a87738e..91f0a9a29e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/List.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/List.java
@@ -328,15 +328,23 @@ int kEventMouseDown (int nextHandler, int theEvent, int userData) {
int kEventRawKeyDown (int nextHandler, int theEvent, int userData) {
int result = super.kEventRawKeyDown (nextHandler, theEvent, userData);
if (result == OS.noErr) return result;
+ /*
+ * Feature in the Macintosh. For some reason, when the user hits an
+ * up or down arrow to traverse the items in a Data Browser, the item
+ * scrolls to the left such that the white space that is normally
+ * visible to the right of the every item is scrolled out of view.
+ * The fix is to do the arrow traversal in Java and not call the
+ * default handler.
+ */
int [] keyCode = new int [1];
OS.GetEventParameter (theEvent, OS.kEventParamKeyCode, OS.typeUInt32, null, keyCode.length * 4, null, keyCode);
switch (keyCode [0]) {
- case 125: {
+ case 125: { /* Down */
int index = getSelectionIndex ();
setSelection (Math.min (itemCount - 1, index + 1));
return OS.noErr;
}
- case 126: {
+ case 126: { /* Up*/
int index = getSelectionIndex ();
setSelection (Math.max (0, index - 1));
return OS.noErr;
@@ -348,15 +356,23 @@ int kEventRawKeyDown (int nextHandler, int theEvent, int userData) {
int kEventRawKeyRepeat (int nextHandler, int theEvent, int userData) {
int result = super.kEventRawKeyRepeat (nextHandler, theEvent, userData);
if (result == OS.noErr) return result;
+ /*
+ * Feature in the Macintosh. For some reason, when the user hits an
+ * up or down arrow to traverse the items in a Data Browser, the item
+ * scrolls to the left such that the white space that is normally
+ * visible to the right of the every item is scrolled out of view.
+ * The fix is to do the arrow traversal in Java and not call the
+ * default handler.
+ */
int [] keyCode = new int [1];
OS.GetEventParameter (theEvent, OS.kEventParamKeyCode, OS.typeUInt32, null, keyCode.length * 4, null, keyCode);
switch (keyCode [0]) {
- case 125: {
+ case 125: { /* Down */
int index = getSelectionIndex ();
setSelection (Math.min (itemCount - 1, index + 1));
return OS.noErr;
}
- case 126: {
+ case 126: { /* Up*/
int index = getSelectionIndex ();
setSelection (Math.max (0, index - 1));
return OS.noErr;