[setButtonType:] use those new names. Corrected [cellAttribute:]

and [setCellAttribute:] to use the right tests. [performClick:]
now play the sound, if provided.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14668 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
FredKiefer 2002-10-07 23:42:02 +00:00
parent 24ddd8c532
commit cc1307d3ae

View file

@ -142,13 +142,29 @@
value = 1; value = 1;
break; break;
case NSChangeGrayCell: case NSChangeGrayCell:
if (_showAltStateMask & NSChangeGrayCellMask)
value = 1;
break;
case NSCellLightsByGray:
if (_highlightsByMask & NSChangeGrayCellMask) if (_highlightsByMask & NSChangeGrayCellMask)
value = 1; value = 1;
break; break;
case NSChangeBackgroundCell: case NSChangeBackgroundCell:
if (_showAltStateMask & NSChangeBackgroundCellMask)
value = 1;
break;
case NSCellLightsByBackground:
if (_highlightsByMask & NSChangeBackgroundCellMask) if (_highlightsByMask & NSChangeBackgroundCellMask)
value = 1; value = 1;
break; break;
case NSCellChangesContents:
if (_showAltStateMask & NSContentsCellMask)
value = 1;
break;
case NSCellLightsByContents:
if (_highlightsByMask & NSContentsCellMask)
value = 1;
break;
default: default:
value = [super cellAttribute: aParameter]; value = [super cellAttribute: aParameter];
break; break;
@ -169,24 +185,22 @@
break; break;
case NSChangeGrayCell: case NSChangeGrayCell:
if (value) if (value)
_highlightsByMask |= NSChangeGrayCellMask; _showAltStateMask |= NSChangeGrayCellMask;
else else
_highlightsByMask &= ~NSChangeGrayCellMask; _showAltStateMask &= ~NSChangeGrayCellMask;
break; break;
case NSChangeBackgroundCell: case NSChangeBackgroundCell:
if (value) if (value)
_highlightsByMask |= NSChangeBackgroundCellMask; _showAltStateMask |= NSChangeBackgroundCellMask;
else else
_highlightsByMask &= ~NSChangeBackgroundCellMask; _showAltStateMask &= ~NSChangeBackgroundCellMask;
break;
/*
case NSCellLightsByContents:
_cell. = value;
break; break;
case NSCellChangesContents: case NSCellChangesContents:
_cell. = value; if (value)
_showAltStateMask |= NSContentsCellMask;
else
_showAltStateMask &= ~NSContentsCellMask;
break; break;
*/
case NSCellLightsByGray: case NSCellLightsByGray:
if (value) if (value)
_highlightsByMask |= NSChangeGrayCellMask; _highlightsByMask |= NSChangeGrayCellMask;
@ -199,6 +213,12 @@
else else
_highlightsByMask &= ~NSChangeBackgroundCellMask; _highlightsByMask &= ~NSChangeBackgroundCellMask;
break; break;
case NSCellLightsByContents:
if (value)
_highlightsByMask |= NSContentsCellMask;
else
_highlightsByMask &= ~NSContentsCellMask;
break;
default: default:
[super setCellAttribute: aParameter to: value]; [super setCellAttribute: aParameter to: value];
} }
@ -206,8 +226,15 @@
- (void) setFont: (NSFont*)fontObject - (void) setFont: (NSFont*)fontObject
{ {
// TODO Should change the size of the key equivalent font int size;
[super setFont: fontObject]; [super setFont: fontObject];
if ((_keyEquivalentFont != nil) && (fontObject != nil) &&
((size = [fontObject pointSize]) != [_keyEquivalentFont pointSize]))
{
[self setKeyEquivalentFont: [_keyEquivalentFont fontName]
size: size];
}
} }
- (void) setTitle: (NSString*)aString - (void) setTitle: (NSString*)aString
@ -460,7 +487,7 @@
switch (buttonType) switch (buttonType)
{ {
case NSMomentaryLight: case NSMomentaryLightButton:
[self setHighlightsBy: NSChangeBackgroundCellMask]; [self setHighlightsBy: NSChangeBackgroundCellMask];
[self setShowsStateBy: NSNoCellMask]; [self setShowsStateBy: NSNoCellMask];
[self setImageDimsWhenDisabled: YES]; [self setImageDimsWhenDisabled: YES];
@ -1039,7 +1066,10 @@
- (void) performClick: (id)sender - (void) performClick: (id)sender
{ {
// TODO Like super plus playing the sound if (_sound != nil)
{
[_sound play];
}
[super performClick: sender]; [super performClick: sender];
} }