Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Barnes2008-06-17 18:12:33 +0000
committerKevin Barnes2008-06-17 18:12:33 +0000
commitbef1bdbd7048feb0ad77f320e25be5e5f6cc6607 (patch)
treeb384324272518aa8146cc36c669ac134555b7e45
parentd62d95171d1b9884e29ffebb40505397ee01c22b (diff)
downloadeclipse.platform.swt-bef1bdbd7048feb0ad77f320e25be5e5f6cc6607.tar.gz
eclipse.platform.swt-bef1bdbd7048feb0ad77f320e25be5e5f6cc6607.tar.xz
eclipse.platform.swt-bef1bdbd7048feb0ad77f320e25be5e5f6cc6607.zip
fixed computed size
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Group.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Group.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Group.java
index 733bac8a21..3789e77543 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Group.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Group.java
@@ -97,10 +97,11 @@ protected void checkSubclass () {
public Rectangle computeTrim (int x, int y, int width, int height) {
checkWidget ();
NSBox widget = (NSBox)view;
- NSSize margins = widget.contentViewMargins();
+ NSRect titleRect = widget.titleRect();
+ float borderWidth = widget.borderWidth();
NSRect frame = contentView.frame();
- width += margins.width * 2;
- height += margins.height * 2 + frame.y;
+ width += borderWidth * 2 + frame.x;
+ height += borderWidth * 2 + titleRect.height + frame.y;
return super.computeTrim(x, y, width, height);
}
@@ -116,7 +117,8 @@ void deregister () {
void createHandle () {
SWTBox widget = (SWTBox)new SWTBox().alloc();
widget.initWithFrame(new NSRect());
- widget.setTitle(NSString.stringWith(""));
+ widget.setTitlePosition(OS.NSNoTitle);
+ widget.setContentViewMargins(new NSSize());
SWTView contentWidget = (SWTView)new SWTView().alloc();
contentWidget.initWithFrame(new NSRect());
// contentWidget.setDrawsBackground(false);
@@ -194,7 +196,9 @@ public void setText (String string) {
char [] buffer = new char [text.length ()];
text.getChars (0, buffer.length, buffer, 0);
int length = fixMnemonic (buffer);
- ((NSBox)view).setTitle(NSString.stringWithCharacters(buffer, length));
+ NSBox box = (NSBox)view;
+ box.setTitlePosition(length == 0 ? OS.NSNoTitle : OS.NSAtTop);
+ box.setTitle(NSString.stringWithCharacters(buffer, length));
}
}

Back to the top