Changed all title methods on NSButtonCell to use the

super string value methods and redefine the local string value
methods to work with the object value. 
Patch by Matt Rice <ratmice@gmail.com>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27946 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2009-02-21 23:15:22 +00:00
parent cf427c2451
commit ee49afcb9b
3 changed files with 37 additions and 11 deletions

View file

@ -1,3 +1,12 @@
2009-02-22 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSButtonCell.m: Changed all title methods to use the
super string value methods and redefine the local string value
methods to work with the object value.
Patch by Matt Rice <ratmice@gmail.com>.
* Source/GSThemeDrawing.m (-cellForScrollerKnobSlot:): Use
setTitle: instead of setStringValue:.
2009-02-20 12:08-EST Gregory John Casamento <greg_casamento@yahoo.com>
* Source/GSToolbarCustomizationPalette.m: Look up default items before

View file

@ -367,7 +367,7 @@
cell = [NSButtonCell new];
[cell setBordered: NO];
[cell setStringValue: nil];
[cell setTitle: nil];
if (horizontal)
{

View file

@ -199,7 +199,7 @@ typedef struct _GSButtonCellFlags
*/
- (NSString*) title
{
return [self stringValue];
return [super stringValue];
}
/** <p>Returns the NSButtonCell's alternate title ( used when highlighted ).
@ -327,7 +327,7 @@ typedef struct _GSButtonCellFlags
*/
- (void) setTitle: (NSString*)aString
{
[self setStringValue: aString];
[super setStringValue: aString];
}
/**<p>Sets the NSButtonCell's alternate title ( used when highlighted )
@ -364,21 +364,17 @@ typedef struct _GSButtonCellFlags
- (void)setAttributedAlternateTitle:(NSAttributedString *)aString
{
// TODO
NSString *alternateTitle;
alternateTitle = AUTORELEASE ([[aString string] copy]);
[self setAlternateTitle: alternateTitle];
[self setAlternateTitle: [aString string]];
}
- (NSAttributedString *)attributedTitle
{
return [self attributedStringValue];
return [super attributedStringValue];
}
- (void)setAttributedTitle:(NSAttributedString *)aString
{
[self setAttributedStringValue: aString];
[super setAttributedStringValue: aString];
}
- (void)setTitleWithMnemonic:(NSString *)aString
@ -809,7 +805,28 @@ typedef struct _GSButtonCellFlags
else // NSMixedState
{
return [NSNumber numberWithInt: -1];
}
}
}
- (void) setStringValue: (NSString *)aString
{
[self setState: ([aString length] != 0)];
}
- (NSString *) stringValue
{
return _cell.state ? @"1" : @"";
}
- (void) setAttributedStringValue: (NSAttributedString *)attrString
{
[self setState: ([attrString length] != 0)];
}
- (NSAttributedString *) attributedStringValue
{
return AUTORELEASE([[NSAttributedString alloc]
initWithString: [self stringValue]]);
}
/*