Fill out NSBox implementation.

Minor bug fixes.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2536 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
scottc 1997-10-20 22:01:25 +00:00
parent 7fbda79985
commit a0ccec39d1
7 changed files with 372 additions and 13 deletions

View file

@ -103,6 +103,37 @@
return c;
}
//
// Determining Component Sizes
//
- (NSSize)cellSize
{
NSFont *f;
NSSize borderSize, s;
// Get border size
if ([self isBordered])
{
if ([self isBezeled])
borderSize = [NSCell sizeForBorderType: NSBezelBorder];
else
borderSize = [NSCell sizeForBorderType: NSLineBorder];
}
else
borderSize = [NSCell sizeForBorderType: NSNoBorder];
// Get size of text with a little buffer space
f = [self font];
s = NSMakeSize([f widthOfString: [self stringValue]] + 2,
[f pointSize] + 2);
// Add in border size
s.width += 2 * borderSize.width;
s.height += 2 * borderSize.height;
return s;
}
//
// Modifying Graphic Attributes
//