summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Composite.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Scale.java2
3 files changed, 7 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Composite.java
index 9cecee6cba..1965c99714 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Composite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Composite.java
@@ -507,7 +507,7 @@ int kEventControlClick (int nextHandler, int theEvent, int userData) {
short [] count = new short [1];
OS.CountSubControls (handle, count);
if (count [0] == 0) {
- if (OS.SetKeyboardFocus (window, handle, (short) OS.kControlFocusNextPart) == OS.noErr) {
+ if (OS.SetKeyboardFocus (window, handle, (short) focusPart ()) == OS.noErr) {
return OS.noErr;
}
}
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 07bf3d1843..4a990503cc 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
@@ -821,6 +821,10 @@ int focusHandle () {
return handle;
}
+int focusPart () {
+ return OS.kControlFocusNextPart;
+}
+
/**
* Forces the receiver to have the <em>keyboard focus</em>, causing
* all keyboard events to be delivered to it.
@@ -858,7 +862,7 @@ public boolean forceFocus () {
int window = OS.GetControlOwner (focusHandle);
Control oldFocus = display.getFocusControl (window, true);
display.ignoreFocus = true;
- OS.SetKeyboardFocus (window, focusHandle, (short) OS.kControlFocusNextPart);
+ OS.SetKeyboardFocus (window, focusHandle, (short) focusPart ());
display.ignoreFocus = false;
Control newFocus = display.getFocusControl ();
if (oldFocus != newFocus) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Scale.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Scale.java
index 76f2b6f192..26ea722ca9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Scale.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Scale.java
@@ -249,7 +249,7 @@ int kEventMouseDown (int nextHandler, int theEvent, int userData) {
OS.ClearKeyboardFocus (window);
result = OS.CallNextEventHandler (nextHandler, theEvent);
if (!isDisposed ()) {
- OS.SetKeyboardFocus (window, handle, (short) OS.kControlFocusNextPart);
+ OS.SetKeyboardFocus (window, handle, (short) focusPart ());
}
display.ignoreFocus = false;
return result;