mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 22:40:38 +00:00
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:
parent
7fbda79985
commit
a0ccec39d1
7 changed files with 372 additions and 13 deletions
|
@ -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
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue