Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich2003-11-19 13:21:05 -0500
committerFelipe Heidrich2003-11-19 13:21:05 -0500
commit5e192872761c443a32a0d4c322adc75395a72283 (patch)
tree4f028e9a8a07d4c5649301fd4c789d72fcd58608
parentcb0108131ae126ecb8b3e007af75644f04fc5a0c (diff)
downloadeclipse.platform.swt-I20031119.tar.gz
eclipse.platform.swt-I20031119.tar.xz
eclipse.platform.swt-I20031119.zip
*** empty log message ***v3030aI20031119
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Menu.java11
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/TabFolder.java20
3 files changed, 17 insertions, 15 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 8e439db1be..99d2218da8 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
@@ -1407,6 +1407,7 @@ int kEventRawKeyDown (int nextHandler, int theEvent, int userData) {
}
int kEventRawKeyModifiersChanged (int nextHandler, int theEvent, int userData) {
+ Display display = this.display;
int [] modifiers = new int [1];
OS.GetEventParameter (theEvent, OS.kEventParamKeyModifiers, OS.typeUInt32, null, modifiers.length * 4, null, modifiers);
int lastModifiers = display.lastModifiers;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Menu.java
index f126ba4b33..a262a75b05 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Menu.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Menu.java
@@ -573,7 +573,6 @@ int kEventMenuDrawItemContent (int nextHandler, int theEvent, int userData) {
OS.GetEventParameter (theEvent, OS.kEventParamCGContextRef, OS.typeCGContextRef, null, 4, null, context);
/* Draw the key */
- short left = rect.left;
int modifierIndex = modifierIndex (accelText);
char [] buffer = new char [length - modifierIndex - 1];
accelText.getChars (modifierIndex + 1, length, buffer, 0);
@@ -589,17 +588,19 @@ int kEventMenuDrawItemContent (int nextHandler, int theEvent, int userData) {
OS.GetThemeMetric (OS.kThemeMetricMenuIconTrailingEdgeMargin, metric);
rect.left = (short) (rect.right - info.widMax - metric [0]);
int str = OS.CFStringCreateWithCharacters (OS.kCFAllocatorDefault, buffer, buffer.length);
- OS.DrawThemeTextBox (str, (short) font, OS.kThemeStateActive, false, rect, (short) OS.teFlushDefault, context [0]);
+ OS.DrawThemeTextBox (str, (short) font, OS.kThemeStateActive, false, rect, (short) OS.teFlushLeft, context [0]);
OS.CFRelease (str);
/* Draw the modifiers */
if (modifierIndex != -1) {
buffer = new char [modifierIndex + 1];
accelText.getChars (0, buffer.length, buffer, 0);
- rect.right = rect.left;
- rect.left = left;
str = OS.CFStringCreateWithCharacters (OS.kCFAllocatorDefault, buffer, buffer.length);
- OS.DrawThemeTextBox (str, (short) OS.kThemeMenuItemCmdKeyFont, OS.kThemeStateActive, false, rect, (short) OS.teFlushRight, context [0]);
+ org.eclipse.swt.internal.carbon.Point size1 = new org.eclipse.swt.internal.carbon.Point ();
+ OS.GetThemeTextDimensions (str, (short) OS.kThemeMenuItemCmdKeyFont, 0, false, size1, null);
+ rect.right = rect.left;
+ rect.left = (short) (rect.right - size1.h);
+ OS.DrawThemeTextBox (str, (short) OS.kThemeMenuItemCmdKeyFont, OS.kThemeStateActive, false, rect, (short) OS.teFlushLeft, context [0]);
OS.CFRelease (str);
}
return result;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/TabFolder.java
index dc78516007..9922bf37a4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/TabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/TabFolder.java
@@ -158,18 +158,18 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
public Rectangle computeTrim (int x, int y, int width, int height) {
checkWidget ();
+ Rect oldBounds = new Rect ();
+ OS.GetControlBounds (handle, oldBounds);
Rect bounds = new Rect ();
- OS.GetControlBounds (handle, bounds);
+ bounds.right = bounds.bottom = 100;
+ OS.SetControlBounds (handle, bounds);
Rect client = new Rect ();
- OS.GetControlData (handle, (short)OS.kControlEntireControl, OS.kControlTabContentRectTag, Rect.sizeof, client, null);
- x -= Math.max (3, client.left - bounds.left);
- if ((style & SWT.BOTTOM) != 0) {
- y -= client.top - bounds.top;
- } else {
- y -= Math.max (34, client.top - bounds.top);
- }
- width += Math.max (6, (bounds.right - bounds.left) - (client.right - client.left));
- height += Math.max (37, (bounds.bottom - bounds.top) - (client.bottom - client.top));
+ OS.GetTabContentRect (handle, client);
+ OS.SetControlBounds (handle, oldBounds);
+ x -= client.left - bounds.left;
+ y -= client.top - bounds.top;
+ width += (bounds.right - bounds.left) - (client.right - client.left);
+ height += (bounds.bottom - bounds.top) - (client.bottom - client.top);
Rect inset = getInset ();
x -= inset.left;
y -= inset.top;

Back to the top