Hanle key equivalents in popup

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5675 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2000-01-06 19:49:19 +00:00
parent 936176ad81
commit c69a12abec
2 changed files with 51 additions and 31 deletions

View file

@ -109,6 +109,18 @@ NSApplication *NSApp = nil;
return YES; return YES;
} }
- (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (int)otherWin
{
if (place == NSWindowOut)
{
NSLog(@"Argh - icon window ordered out");
}
else
{
[super orderWindow: place relativeTo: otherWin];
}
}
- (void) initDefaults - (void) initDefaults
{ {
[super initDefaults]; [super initDefaults];

View file

@ -38,21 +38,20 @@
#include <AppKit/NSMenuView.h> #include <AppKit/NSMenuView.h>
#include <AppKit/NSFont.h> #include <AppKit/NSFont.h>
// /*
// class variables * class variables
// */
Class _nspopupbuttonCellClass = 0; Class _nspopupbuttonCellClass = 0;
// /*
// NSPopUpButton implementation * NSPopUpButton implementation
// */
@implementation NSPopUpButton @implementation NSPopUpButton
/////////////////////////////////////////////////////////////// /*
// * Class methods
// Class methods */
//
+ (void) initialize + (void) initialize
{ {
if (self == [NSPopUpButton class]) if (self == [NSPopUpButton class])
@ -73,9 +72,9 @@ Class _nspopupbuttonCellClass = 0;
_nspopupbuttonCellClass = classId; _nspopupbuttonCellClass = classId;
} }
// /*
// Initializing an NSPopUpButton * Initializing an NSPopUpButton
// */
- (id) init - (id) init
{ {
return [self initWithFrame: NSZeroRect pullsDown: NO]; return [self initWithFrame: NSZeroRect pullsDown: NO];
@ -148,6 +147,15 @@ Class _nspopupbuttonCellClass = 0;
[self synchronizeTitleAndSelectedItem]; [self synchronizeTitleAndSelectedItem];
} }
- (BOOL) performKeyEquivalent: (NSEvent*)theEvent
{
NSMenu *m = [self menu];
if (m != nil)
return [m performKeyEquivalent: theEvent];
return NO;
}
- (void) removeAllItems - (void) removeAllItems
{ {
[_cell removeAllItems]; [_cell removeAllItems];
@ -332,9 +340,9 @@ Class _nspopupbuttonCellClass = 0;
} }
// /*
// NSCoding protocol * NSCoding protocol
// */
- (void) encodeWithCoder: (NSCoder*)aCoder - (void) encodeWithCoder: (NSCoder*)aCoder
{ {
[super encodeWithCoder: aCoder]; [super encodeWithCoder: aCoder];