diff --git a/ChangeLog b/ChangeLog index bc180b3fb..a5b09e747 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-02-22 Fred Kiefer + + * 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 . + * Source/GSThemeDrawing.m (-cellForScrollerKnobSlot:): Use + setTitle: instead of setStringValue:. + 2009-02-20 12:08-EST Gregory John Casamento * Source/GSToolbarCustomizationPalette.m: Look up default items before diff --git a/Source/GSThemeDrawing.m b/Source/GSThemeDrawing.m index dc17ecd5e..36fc96581 100644 --- a/Source/GSThemeDrawing.m +++ b/Source/GSThemeDrawing.m @@ -367,7 +367,7 @@ cell = [NSButtonCell new]; [cell setBordered: NO]; - [cell setStringValue: nil]; + [cell setTitle: nil]; if (horizontal) { diff --git a/Source/NSButtonCell.m b/Source/NSButtonCell.m index eb2d6b4e8..834d8a3e1 100644 --- a/Source/NSButtonCell.m +++ b/Source/NSButtonCell.m @@ -199,7 +199,7 @@ typedef struct _GSButtonCellFlags */ - (NSString*) title { - return [self stringValue]; + return [super stringValue]; } /**

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]; } /**

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]]); } /*