Updated -cellSize to process multiline string value. This should

improve greately the behaviour  of NSTextField and consequently of the
NSPanel building functions.

Updated -[NSCell _drawText:inFrame:]
and -[NSButtonCell drawInteriorWithFrame:inView:]
to handle properly multiline strings.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6257 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
pjb 2000-03-10 13:27:50 +00:00
parent 99f2fb6496
commit 23a6b9f034
2 changed files with 54 additions and 24 deletions

View file

@ -48,6 +48,7 @@
#include <AppKit/NSGraphics.h>
#include <AppKit/PSOperators.h>
#include "GSUtil.h"
@implementation NSButtonCell
@ -489,11 +490,10 @@
imageSize = [imageToDisplay size];
}
if (titleToDisplay && (ipos == NSImageAbove || ipos == NSImageBelow))
{
titleSize = NSMakeSize([_cell_font widthOfString: titleToDisplay],
[_cell_font boundingRectForFont].size.height);
}
if (titleToDisplay && (ipos == NSImageAbove || ipos == NSImageBelow)) {
titleSize =GSUtil_sizeOfMultilineStringWithFont(titleToDisplay,
_cell_font);
}
if (flippedView == YES)
{
@ -686,11 +686,12 @@
else
imageSize = NSZeroSize;
if (titleToDisplay)
titleSize = NSMakeSize ([_cell_font widthOfString: titleToDisplay],
[_cell_font boundingRectForFont].size.height);
else
titleSize = NSZeroSize;
if(titleToDisplay!=nil){
titleSize=GSUtil_sizeOfMultilineStringWithFont(titleToDisplay,
_cell_font);
}else{
titleSize=NSZeroSize;
}
switch (_cell.image_position)
{