diff options
author | Silenio Quarti <silenio> | 2002-12-10 20:08:59 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2002-12-10 20:08:59 +0000 |
commit | a24e80e370007858dedba2b4cd5b838b0bbb742e (patch) | |
tree | 9c99d032d1f4b478a65995420d91a6ef35a39e32 | |
parent | c95aadef666fa684eb9ef9f93e16e2ddce1a83f9 (diff) | |
download | eclipse.platform.swt-a24e80e370007858dedba2b4cd5b838b0bbb742e.tar.gz eclipse.platform.swt-a24e80e370007858dedba2b4cd5b838b0bbb742e.tar.xz eclipse.platform.swt-a24e80e370007858dedba2b4cd5b838b0bbb742e.zip |
*** empty log message ***
4 files changed, 40 insertions, 35 deletions
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 7ae5cf9124..a744b73e85 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 @@ -616,7 +616,6 @@ int kEventMouseDown (int nextHandler, int theEvent, int userData) { if (!shell.isDisposed ()) { shell.setActiveControl (this); } -// if ((state & CANVAS) != 0 && userData != 0) return OS.noErr; return OS.eventNotHandledErr; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java index 6140ccacf2..dcac4e9175 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Shell.java @@ -297,8 +297,14 @@ void hookEvents () { }; int windowTarget = OS.GetWindowEventTarget (shellHandle); OS.InstallEventHandler (windowTarget, windowProc, mask1.length / 2, mask1, shellHandle, null); - int[] mask2 = new int [] { + int [] mask2 = new int [] { OS.kEventClassMouse, OS.kEventMouseDown, + OS.kEventClassMouse, OS.kEventMouseDragged, +// OS.kEventClassMouse, OS.kEventMouseEntered, +// OS.kEventClassMouse, OS.kEventMouseExited, + OS.kEventClassMouse, OS.kEventMouseMoved, + OS.kEventClassMouse, OS.kEventMouseUp, + OS.kEventClassMouse, OS.kEventMouseWheelMoved, }; OS.InstallEventHandler (windowTarget, mouseProc, mask2.length / 2, mask2, shellHandle, null); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/ToolItem.java index f1daea500c..2af0dff1cd 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/ToolItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/ToolItem.java @@ -184,7 +184,7 @@ void drawWidget (int control) { public Rectangle getBounds () { checkWidget(); - Rect rect = getBounds (handle); + Rect rect = getControlBounds (handle); return new Rectangle (rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top); } 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 0f74631212..92d74c36bf 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 @@ -288,27 +288,6 @@ boolean filters (int eventType) { return display.filters (eventType); } -Rect getBounds (int control) { - Rect rect = new Rect(); - OS.GetControlBounds (control, rect); - int window = OS.GetControlOwner (control); - int [] theRoot = new int [1]; - OS.GetRootControl (window, theRoot); - int [] parentHandle = new int [1]; - OS.GetSuperControl (control, parentHandle); - if (parentHandle [0] != theRoot [0]) { - Rect parentRect = new Rect (); - OS.GetControlBounds (parentHandle [0], parentRect); - OS.OffsetRect (rect, (short) -parentRect.left, (short) -parentRect.top); - } - Rect inset = getInset (); - rect.left -= inset.left; - rect.top -= inset.top; - rect.right += inset.right; - rect.bottom += inset.bottom; - return rect; -} - int getClipping (int control) { int visibleRgn = OS.NewRgn (), childRgn = OS.NewRgn (), tempRgn = OS.NewRgn (); int window = OS.GetControlOwner (control); @@ -340,6 +319,38 @@ int getClipping (int control) { return visibleRgn; } +Rect getControlBounds (int control) { + Rect rect = new Rect(); + OS.GetControlBounds (control, rect); + int window = OS.GetControlOwner (control); + int [] theRoot = new int [1]; + OS.GetRootControl (window, theRoot); + int [] parentHandle = new int [1]; + OS.GetSuperControl (control, parentHandle); + if (parentHandle [0] != theRoot [0]) { + Rect parentRect = new Rect (); + OS.GetControlBounds (parentHandle [0], parentRect); + OS.OffsetRect (rect, (short) -parentRect.left, (short) -parentRect.top); + } + Rect inset = getInset (); + rect.left -= inset.left; + rect.top -= inset.top; + rect.right += inset.right; + rect.bottom += inset.bottom; + return rect; +} + +Rect getControlSize (int control) { + Rect rect = new Rect (); + OS.GetControlBounds (control, rect); + Rect inset = getInset (); + rect.left -= inset.left; + rect.top -= inset.top; + rect.right += inset.right; + rect.bottom += inset.bottom; + return rect; +} + public Object getData () { checkWidget(); return data; @@ -368,17 +379,6 @@ String getNameText () { return ""; } -Rect getSize (int control) { - Rect rect = new Rect (); - OS.GetControlBounds (control, rect); - Rect inset = getInset (); - rect.left -= inset.left; - rect.top -= inset.top; - rect.right += inset.right; - rect.bottom += inset.bottom; - return rect; -} - public int getStyle () { checkWidget(); return style; |