2001-12-17 16:51:51 +00:00
|
|
|
/** <title>NSButton</title>
|
1996-05-30 20:03:15 +00:00
|
|
|
|
2001-12-17 16:51:51 +00:00
|
|
|
<abstract>The button class</abstract>
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
Copyright (C) 1996 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Author: Scott Christley <scottc@net-community.com>
|
1997-10-09 22:55:31 +00:00
|
|
|
Ovidiu Predescu <ovidiu@net-community.com>
|
1996-05-30 20:03:15 +00:00
|
|
|
Date: 1996
|
1999-03-24 11:31:06 +00:00
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
This file is part of the GNUstep GUI Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
1999-03-24 11:31:06 +00:00
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
1996-10-18 17:14:13 +00:00
|
|
|
License along with this library; see the file COPYING.LIB.
|
|
|
|
If not, write to the Free Software Foundation,
|
|
|
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1999-03-24 11:31:06 +00:00
|
|
|
*/
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1997-09-23 22:43:24 +00:00
|
|
|
#include <gnustep/gui/config.h>
|
1998-11-25 17:16:48 +00:00
|
|
|
|
1997-02-18 00:29:25 +00:00
|
|
|
#include <AppKit/NSButton.h>
|
|
|
|
#include <AppKit/NSWindow.h>
|
|
|
|
#include <AppKit/NSButtonCell.h>
|
|
|
|
#include <AppKit/NSApplication.h>
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// class variables
|
|
|
|
//
|
1998-12-16 12:57:41 +00:00
|
|
|
id _nsbuttonCellClass = nil;
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// NSButton implementation
|
|
|
|
//
|
|
|
|
@implementation NSButton
|
|
|
|
|
|
|
|
//
|
|
|
|
// Class methods
|
|
|
|
//
|
1999-03-24 11:31:06 +00:00
|
|
|
+ (void) initialize
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-03-24 11:31:06 +00:00
|
|
|
if (self == [NSButton class])
|
|
|
|
{
|
|
|
|
[self setVersion: 1];
|
|
|
|
[self setCellClass: [NSButtonCell class]];
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
1999-03-24 11:31:06 +00:00
|
|
|
// Initializing the NSButton Factory
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
1999-03-24 11:31:06 +00:00
|
|
|
+ (Class) cellClass
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-12-16 12:57:41 +00:00
|
|
|
return _nsbuttonCellClass;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1999-03-24 11:31:06 +00:00
|
|
|
+ (void) setCellClass: (Class)classId
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-12-16 12:57:41 +00:00
|
|
|
_nsbuttonCellClass = classId;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Instance methods
|
|
|
|
//
|
|
|
|
|
1999-03-24 11:31:06 +00:00
|
|
|
- (BOOL) acceptsFirstMouse: (NSEvent *)theEvent
|
|
|
|
{
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
1999-03-24 11:31:06 +00:00
|
|
|
// Setting the Button Type
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
1999-03-24 11:31:06 +00:00
|
|
|
- (void) setButtonType: (NSButtonType)aType
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
[_cell setButtonType: aType];
|
2000-12-26 21:42:57 +00:00
|
|
|
[self setNeedsDisplay: YES];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
1999-03-24 11:31:06 +00:00
|
|
|
// Setting the State
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
1999-03-24 11:31:06 +00:00
|
|
|
- (void) setIntValue: (int)anInt
|
1997-02-18 00:29:25 +00:00
|
|
|
{
|
1999-03-24 11:31:06 +00:00
|
|
|
[self setState: (anInt != 0)];
|
1997-02-18 00:29:25 +00:00
|
|
|
}
|
|
|
|
|
1999-03-24 11:31:06 +00:00
|
|
|
- (void) setFloatValue: (float)aFloat
|
1997-02-18 00:29:25 +00:00
|
|
|
{
|
1999-03-24 11:31:06 +00:00
|
|
|
[self setState: (aFloat != 0)];
|
1997-02-18 00:29:25 +00:00
|
|
|
}
|
|
|
|
|
1999-03-24 11:31:06 +00:00
|
|
|
- (void) setDoubleValue: (double)aDouble
|
1997-02-18 00:29:25 +00:00
|
|
|
{
|
1999-03-24 11:31:06 +00:00
|
|
|
[self setState: (aDouble != 0)];
|
1997-02-18 00:29:25 +00:00
|
|
|
}
|
|
|
|
|
1999-03-24 11:31:06 +00:00
|
|
|
- (void) setState: (int)value
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
[_cell setState: value];
|
1996-05-30 20:03:15 +00:00
|
|
|
[self display];
|
|
|
|
}
|
|
|
|
|
1999-03-24 11:31:06 +00:00
|
|
|
- (int) state
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
return [_cell state];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
2000-06-27 17:33:16 +00:00
|
|
|
- (BOOL) allowsMixedState
|
|
|
|
{
|
|
|
|
return [_cell allowsMixedState];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setAllowsMixedState: (BOOL)flag
|
|
|
|
{
|
|
|
|
[_cell setAllowsMixedState: flag];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setNextState
|
|
|
|
{
|
|
|
|
[_cell setNextState];
|
2000-12-26 21:42:57 +00:00
|
|
|
[self display];
|
2000-06-27 17:33:16 +00:00
|
|
|
}
|
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
1999-03-24 11:31:06 +00:00
|
|
|
// Setting the Repeat Interval
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
1999-03-24 11:31:06 +00:00
|
|
|
- (void) getPeriodicDelay: (float *)delay
|
|
|
|
interval: (float *)interval
|
1997-08-05 21:50:10 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
[_cell getPeriodicDelay: delay interval: interval];
|
1997-08-05 21:50:10 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1999-03-24 11:31:06 +00:00
|
|
|
- (void) setPeriodicDelay: (float)delay
|
|
|
|
interval: (float)interval
|
1997-08-05 21:50:10 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
[_cell setPeriodicDelay: delay interval: interval];
|
1997-08-05 21:50:10 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
1999-03-24 11:31:06 +00:00
|
|
|
// Setting the Titles
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
1999-03-24 11:31:06 +00:00
|
|
|
- (NSString *) alternateTitle
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
return [_cell alternateTitle];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1999-03-24 11:31:06 +00:00
|
|
|
- (void) setAlternateTitle: (NSString *)aString
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
[_cell setAlternateTitle: aString];
|
2000-12-26 21:42:57 +00:00
|
|
|
[self setNeedsDisplay: YES];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1999-03-24 11:31:06 +00:00
|
|
|
- (void) setTitle: (NSString *)aString
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
[_cell setTitle: aString];
|
2000-12-26 21:42:57 +00:00
|
|
|
[self setNeedsDisplay: YES];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1999-03-24 11:31:06 +00:00
|
|
|
- (NSString *) title
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
return [_cell title];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
2001-01-26 18:42:16 +00:00
|
|
|
- (NSAttributedString *) attributedAlternateTitle
|
2000-12-26 21:42:57 +00:00
|
|
|
{
|
|
|
|
return [_cell attributedAlternateTitle];
|
|
|
|
}
|
|
|
|
|
2001-01-26 18:42:16 +00:00
|
|
|
- (NSAttributedString *) attributedTitle
|
2000-12-26 21:42:57 +00:00
|
|
|
{
|
|
|
|
return [_cell attributedTitle];
|
|
|
|
}
|
|
|
|
|
2001-01-26 18:42:16 +00:00
|
|
|
- (void) setAttributedAlternateTitle: (NSAttributedString *)aString
|
2000-12-26 21:42:57 +00:00
|
|
|
{
|
|
|
|
[_cell setAttributedAlternateTitle: aString];
|
|
|
|
[self setNeedsDisplay: YES];
|
|
|
|
}
|
|
|
|
|
2001-01-26 18:42:16 +00:00
|
|
|
- (void) setAttributedTitle: (NSAttributedString *)aString
|
2000-12-26 21:42:57 +00:00
|
|
|
{
|
|
|
|
[_cell setAttributedTitle: aString];
|
|
|
|
[self setNeedsDisplay: YES];
|
|
|
|
}
|
|
|
|
|
2001-01-26 18:42:16 +00:00
|
|
|
- (void) setTitleWithMnemonic: (NSString *)aString
|
2000-12-26 21:42:57 +00:00
|
|
|
{
|
|
|
|
[_cell setTitleWithMnemonic: aString];
|
|
|
|
[self setNeedsDisplay: YES];
|
|
|
|
}
|
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
1999-03-24 11:31:06 +00:00
|
|
|
// Setting the Images
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
1999-03-24 11:31:06 +00:00
|
|
|
- (NSImage *) alternateImage
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
return [_cell alternateImage];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1999-03-24 11:31:06 +00:00
|
|
|
- (NSImage *) image
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
return [_cell image];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1999-03-24 11:31:06 +00:00
|
|
|
- (NSCellImagePosition) imagePosition
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
return [_cell imagePosition];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1999-03-24 11:31:06 +00:00
|
|
|
- (void) setAlternateImage: (NSImage *)anImage
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
[_cell setAlternateImage: anImage];
|
2000-12-26 21:42:57 +00:00
|
|
|
[self setNeedsDisplay: YES];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1999-03-24 11:31:06 +00:00
|
|
|
- (void) setImage: (NSImage *)anImage
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
[_cell setImage: anImage];
|
2000-12-26 21:42:57 +00:00
|
|
|
[self setNeedsDisplay: YES];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1999-03-24 11:31:06 +00:00
|
|
|
- (void) setImagePosition: (NSCellImagePosition)aPosition
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
[_cell setImagePosition: aPosition];
|
2000-12-26 21:42:57 +00:00
|
|
|
[self setNeedsDisplay: YES];
|
1997-02-18 00:29:25 +00:00
|
|
|
}
|
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
1999-03-24 11:31:06 +00:00
|
|
|
// Modifying Graphic Attributes
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
1999-03-24 11:31:06 +00:00
|
|
|
- (BOOL) isBordered
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
return [_cell isBordered];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1999-03-24 11:31:06 +00:00
|
|
|
- (BOOL) isTransparent
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
return [_cell isTransparent];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1999-03-24 11:31:06 +00:00
|
|
|
- (void) setBordered: (BOOL)flag
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
[_cell setBordered: flag];
|
2000-12-26 21:42:57 +00:00
|
|
|
[self setNeedsDisplay: YES];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1999-03-24 11:31:06 +00:00
|
|
|
- (void) setTransparent: (BOOL)flag
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
[_cell setTransparent: flag];
|
2000-12-26 21:42:57 +00:00
|
|
|
[self setNeedsDisplay: YES];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSBezelStyle)bezelStyle
|
|
|
|
{
|
|
|
|
return [_cell bezelStyle];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setBezelStyle:(NSBezelStyle)bezelStyle
|
|
|
|
{
|
|
|
|
[_cell setBezelStyle: bezelStyle];
|
|
|
|
[self setNeedsDisplay: YES];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)showsBorderOnlyWhileMouseInside
|
|
|
|
{
|
|
|
|
return [_cell showsBorderOnlyWhileMouseInside];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setShowsBorderOnlyWhileMouseInside:(BOOL)show
|
|
|
|
{
|
|
|
|
[_cell setShowsBorderOnlyWhileMouseInside: show];
|
|
|
|
[self setNeedsDisplay: YES];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
1999-03-24 11:31:06 +00:00
|
|
|
// Displaying
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
|
|
|
|
1999-03-24 11:31:06 +00:00
|
|
|
- (void) highlight: (BOOL)flag
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
2000-01-10 02:04:25 +00:00
|
|
|
[_cell highlight: flag withFrame: _bounds inView: self];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
1999-03-24 11:31:06 +00:00
|
|
|
// Setting the Key Equivalent
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
1998-12-15 16:20:22 +00:00
|
|
|
- (NSString*) keyEquivalent
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
return [_cell keyEquivalent];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-12-15 16:20:22 +00:00
|
|
|
- (unsigned int) keyEquivalentModifierMask
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
return [_cell keyEquivalentModifierMask];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-12-15 16:20:22 +00:00
|
|
|
- (void) setKeyEquivalent: (NSString*)aKeyEquivalent
|
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
[_cell setKeyEquivalent: aKeyEquivalent];
|
1998-12-15 16:20:22 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-15 16:20:22 +00:00
|
|
|
- (void) setKeyEquivalentModifierMask: (unsigned int)mask
|
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
[_cell setKeyEquivalentModifierMask: mask];
|
1998-12-15 16:20:22 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
1998-12-16 11:48:33 +00:00
|
|
|
// Determining the first responder
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
1999-03-24 11:31:06 +00:00
|
|
|
- (BOOL) acceptsFirstResponder
|
|
|
|
{
|
2000-12-21 17:23:21 +00:00
|
|
|
return [self isEnabled];
|
1999-03-24 11:31:06 +00:00
|
|
|
}
|
1998-12-15 16:20:22 +00:00
|
|
|
|
2001-03-22 00:27:37 +00:00
|
|
|
- (BOOL) becomeFirstResponder
|
|
|
|
{
|
2001-07-09 02:49:03 +00:00
|
|
|
[_window disableKeyEquivalentForDefaultButtonCell];
|
2001-03-22 00:27:37 +00:00
|
|
|
[_cell setShowsFirstResponder: YES];
|
|
|
|
[self setNeedsDisplay: YES];
|
|
|
|
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL) resignFirstResponder
|
|
|
|
{
|
2001-07-09 02:49:03 +00:00
|
|
|
[_window enableKeyEquivalentForDefaultButtonCell];
|
2001-03-22 00:27:37 +00:00
|
|
|
[_cell setShowsFirstResponder: NO];
|
|
|
|
[self setNeedsDisplay: YES];
|
|
|
|
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) becomeKeyWindow
|
|
|
|
{
|
|
|
|
[_cell setShowsFirstResponder: YES];
|
|
|
|
[self setNeedsDisplay: YES];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) resignKeyWindow
|
|
|
|
{
|
|
|
|
[_cell setShowsFirstResponder: NO];
|
|
|
|
[self setNeedsDisplay: YES];
|
|
|
|
}
|
|
|
|
|
1998-12-15 16:20:22 +00:00
|
|
|
- (void) keyDown: (NSEvent*)theEvent
|
|
|
|
{
|
1999-10-12 12:59:10 +00:00
|
|
|
if ([self isEnabled])
|
|
|
|
{
|
2000-09-04 02:03:37 +00:00
|
|
|
NSString *characters = [theEvent characters];
|
|
|
|
unichar character = 0;
|
|
|
|
|
|
|
|
if ([characters length] > 0)
|
|
|
|
{
|
|
|
|
character = [characters characterAtIndex: 0];
|
|
|
|
}
|
|
|
|
|
1999-10-12 12:59:10 +00:00
|
|
|
// Handle SPACE or RETURN to perform a click
|
2000-09-04 02:03:37 +00:00
|
|
|
if ((character == NSNewlineCharacter)
|
|
|
|
|| (character == NSEnterCharacter)
|
|
|
|
|| (character == NSCarriageReturnCharacter)
|
|
|
|
|| ([characters isEqualToString: @" "]))
|
1999-10-12 12:59:10 +00:00
|
|
|
{
|
|
|
|
[self performClick: self];
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[super keyDown: theEvent];
|
1998-12-15 16:20:22 +00:00
|
|
|
}
|
|
|
|
|
1998-12-16 11:48:33 +00:00
|
|
|
//
|
1999-03-24 11:31:06 +00:00
|
|
|
// Handling Events and Action Messages
|
1998-12-16 11:48:33 +00:00
|
|
|
//
|
|
|
|
|
1998-12-15 16:20:22 +00:00
|
|
|
- (void) performClick: (id)sender
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-12-16 03:07:14 +00:00
|
|
|
[_cell performClick: sender];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-12-15 16:20:22 +00:00
|
|
|
- (BOOL) performKeyEquivalent: (NSEvent *)anEvent
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-12-15 16:20:22 +00:00
|
|
|
if ([self isEnabled])
|
|
|
|
{
|
|
|
|
NSString *key = [self keyEquivalent];
|
|
|
|
|
|
|
|
if (key != nil && [key isEqual: [anEvent charactersIgnoringModifiers]])
|
|
|
|
{
|
|
|
|
unsigned int mask = [self keyEquivalentModifierMask];
|
|
|
|
|
|
|
|
if (([anEvent modifierFlags] & mask) == mask)
|
|
|
|
{
|
|
|
|
[self performClick: self];
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
|
2001-01-26 18:42:16 +00:00
|
|
|
- (void) setSound: (NSSound *)aSound
|
2000-12-26 21:42:57 +00:00
|
|
|
{
|
|
|
|
[_cell setSound: aSound];
|
|
|
|
}
|
|
|
|
|
2001-01-26 18:42:16 +00:00
|
|
|
- (NSSound *) sound
|
2000-12-26 21:42:57 +00:00
|
|
|
{
|
|
|
|
return [_cell sound];
|
|
|
|
}
|
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
@end
|