summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarolyn MacLeod <carolyn>2006-09-29 21:04:26 +0000
committerCarolyn MacLeod <carolyn>2006-09-29 21:04:26 +0000
commit40076c3201ec0c8a12fb1180bc85487acdc195c0 (patch)
tree66f454d7499a1b4905a1d740c485d49a6b7eb62f
parent9bb01241838ca6844ce23996aa03e1aedd283a8e (diff)
downloadeclipse.platform.swt-40076c3201ec0c8a12fb1180bc85487acdc195c0.tar.gz
eclipse.platform.swt-40076c3201ec0c8a12fb1180bc85487acdc195c0.tar.xz
eclipse.platform.swt-40076c3201ec0c8a12fb1180bc85487acdc195c0.zip
Fix selection event in DateTime
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Widget.java12
3 files changed, 28 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java
index 8ee11ce407..5ac14c2a5d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/carbon/org/eclipse/swt/internal/carbon/OS.java
@@ -340,6 +340,7 @@ public class OS extends Platform {
public static final int kEventClassAppleEvent = ('e'<<24) + ('p'<<16) + ('p'<<8) + 'c';
public static final int kEventClassApplication = ('a'<<24) + ('p'<<16) + ('p'<<8) + 'l';
public static final int kEventClassCommand = ('c'<<24) + ('m'<<16) + ('d'<<8) + 's';
+ public static final int kEventClassClockView = ('c'<<24) + ('l'<<16) + ('o'<<8) + 'c';
public static final int kEventClassControl = ('c'<<24) + ('n'<<16) + ('t'<<8) + 'l';
public static final int kEventClassFont= ('f'<<24) + ('o'<<16) + ('n'<<8) + 't';
public static final int kEventClassHIObject = ('h'<<24) + ('i'<<16) + ('o'<<8) + 'b';
@@ -349,6 +350,7 @@ public class OS extends Platform {
public static final int kEventClassScrollable = ('s'<<24) + ('c'<<16) + ('r'<<8) + 'l';
public static final int kEventClassTextInput = ('t'<<24) + ('e'<<16) + ('x'<<8) + 't';
public static final int kEventClassWindow = ('w'<<24) + ('i'<<16) + ('n'<<8) + 'd';
+ public static final int kEventClockDateOrTimeChanged = 1;
public static final int kEventControlApplyBackground = 5;
public static final int kEventControlActivate = 9;
public static final int kEventControlAddedSubControl = 152;
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 435ca31aa6..de5216716e 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
@@ -106,11 +106,11 @@ public class Display extends Device {
static final int WAKE_CLASS = 'S' << 24 | 'W' << 16 | 'T' << 8 | '-';
static final int WAKE_KIND = 1;
Event [] eventQueue;
- Callback actionCallback, appleEventCallback, commandCallback, controlCallback, accessibilityCallback, appearanceCallback;
+ Callback actionCallback, appleEventCallback, clockCallback, commandCallback, controlCallback, accessibilityCallback, appearanceCallback;
Callback drawItemCallback, itemDataCallback, itemNotificationCallback, itemCompareCallback, trayItemCallback;
Callback hitTestCallback, keyboardCallback, menuCallback, mouseHoverCallback, helpCallback, pollingCallback;
Callback mouseCallback, trackingCallback, windowCallback, colorCallback, textInputCallback;
- int actionProc, appleEventProc, commandProc, controlProc, appearanceProc, accessibilityProc;
+ int actionProc, appleEventProc, clockProc, commandProc, controlProc, appearanceProc, accessibilityProc;
int drawItemProc, itemDataProc, itemNotificationProc, itemCompareProc, helpProc, trayItemProc;
int hitTestProc, keyboardProc, menuProc, mouseHoverProc, pollingProc;
int mouseProc, trackingProc, windowProc, colorProc, textInputProc;
@@ -834,6 +834,12 @@ Rect computeInset (int control) {
return rect;
}
+int clockProc (int nextHandler, int theEvent, int userData) {
+ Widget widget = getWidget (userData);
+ if (widget != null) return widget.clockProc (nextHandler, theEvent, userData);
+ return OS.eventNotHandledErr;
+}
+
int controlProc (int nextHandler, int theEvent, int userData) {
Widget widget = getWidget (userData);
if (widget != null) return widget.controlProc (nextHandler, theEvent, userData);
@@ -2007,6 +2013,9 @@ void initializeCallbacks () {
caretCallback = new Callback(this, "caretProc", 2);
caretProc = caretCallback.getAddress();
if (caretProc == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
+ clockCallback = new Callback (this, "clockProc", 3);
+ clockProc = clockCallback.getAddress ();
+ if (clockProc == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
commandCallback = new Callback (this, "commandProc", 3);
commandProc = commandCallback.getAddress ();
if (commandProc == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
@@ -3066,6 +3075,7 @@ void releaseDisplay () {
actionCallback.dispose ();
appleEventCallback.dispose ();
caretCallback.dispose ();
+ clockCallback.dispose ();
commandCallback.dispose ();
controlCallback.dispose ();
accessibilityCallback.dispose ();
@@ -3087,12 +3097,12 @@ void releaseDisplay () {
trayItemCallback.dispose ();
pollingCallback.dispose ();
actionCallback = appleEventCallback = caretCallback = commandCallback = appearanceCallback = null;
- accessibilityCallback = controlCallback = drawItemCallback = itemDataCallback = itemNotificationCallback = null;
+ accessibilityCallback = clockCallback = controlCallback = drawItemCallback = itemDataCallback = itemNotificationCallback = null;
helpCallback = hitTestCallback = keyboardCallback = menuCallback = itemCompareCallback = trayItemCallback = null;
mouseHoverCallback = mouseCallback = trackingCallback = windowCallback = colorCallback = pollingCallback = null;
textInputCallback = null;
actionProc = appleEventProc = caretProc = commandProc = appearanceProc = trayItemProc = 0;
- accessibilityProc = controlProc = drawItemProc = itemDataProc = itemNotificationProc = itemCompareProc = 0;
+ accessibilityProc = clockProc = controlProc = drawItemProc = itemDataProc = itemNotificationProc = itemCompareProc = 0;
helpProc = hitTestProc = keyboardProc = menuProc = pollingProc = 0;
mouseHoverProc = mouseProc = trackingProc = windowProc = colorProc = 0;
textInputProc = 0;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Widget.java
index 5ee91242cf..f5050aaf45 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Widget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Widget.java
@@ -340,6 +340,14 @@ boolean contains (int shellX, int shellY) {
return true;
}
+int clockProc (int nextHandler, int theEvent, int userData) {
+ int kind = OS.GetEventKind (theEvent);
+ switch (kind) {
+ case OS.kEventClockDateOrTimeChanged: return kEventClockDateOrTimeChanged (nextHandler, theEvent, userData);
+ }
+ return OS.eventNotHandledErr;
+}
+
int controlProc (int nextHandler, int theEvent, int userData) {
int eventKind = OS.GetEventKind (theEvent);
switch (eventKind) {
@@ -961,6 +969,10 @@ int kEventProcessCommand (int nextHandler, int theEvent, int userData) {
return OS.eventNotHandledErr;
}
+int kEventClockDateOrTimeChanged (int nextHandler, int theEvent, int userData) {
+ return OS.eventNotHandledErr;
+}
+
int kEventControlApplyBackground (int nextHandler, int theEvent, int userData) {
return OS.eventNotHandledErr;
}