New MacOSX methods [formatter], [setFormatter:],

[attributedStringValue], [setAttributedStringValue:].


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17252 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
FredKiefer 2003-07-18 14:03:08 +00:00
parent cfc1fd0e1b
commit 0c9ce6b22e
2 changed files with 58 additions and 5 deletions

View file

@ -324,6 +324,21 @@ static Class actionCellClass;
[self setNeedsDisplay: YES];
}
- (void) setFormatter: (NSFormatter*)newFormatter
{
if (_cell)
{
[_cell setFormatter: newFormatter];
if (![_cell isKindOfClass: actionCellClass])
[self setNeedsDisplay: YES];
}
}
- (id) formatter
{
return [_cell formatter];
}
/*
* Managing the Field Editor
*/
@ -448,6 +463,36 @@ static Class actionCellClass;
return [_cell target];
}
/*
* Attributed string handling
*/
- (void) setAttributedStringValue: (NSAttributedString*)attribStr
{
NSCell *selected = [self selectedCell];
[self abortEditing];
[selected setAttributedStringValue: attribStr];
if (![selected isKindOfClass: actionCellClass])
[self setNeedsDisplay: YES];
}
- (NSAttributedString*) attributedStringValue
{
NSCell *selected = [self selectedCell];
if (selected == nil)
{
return AUTORELEASE([NSAttributedString new]);
}
// As this mehtod is not defined for NSActionCell, we have
// to do the validation here.
[self validateEditing];
return [selected attributedStringValue];
}
/*
* Assigning a Tag
*/