Pop up the list of a combo box when the user presses the down arrow

key. This gives users full keyboard control for NSComboBox.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31120 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
wlux 2010-08-11 20:49:33 +00:00
parent 26019a4955
commit d4e85d8f8d
3 changed files with 31 additions and 0 deletions

View file

@ -29,6 +29,7 @@
#include "AppKit/NSComboBox.h"
#include "AppKit/NSComboBoxCell.h"
#include "AppKit/NSEvent.h"
#include "AppKit/NSTextView.h"
/*
* Class variables
@ -37,6 +38,15 @@ static Class usedCellClass;
static Class comboBoxCellClass;
static NSNotificationCenter *nc;
/*
* Declaration of private cell method
*/
@interface NSComboBoxCell (GNUstepPrivate)
- (void) _performClickWithFrame: (NSRect)cellFrame
inView: (NSView *)controlView;
@end
/**
<unit>
<heading>Class Description</heading>
@ -477,6 +487,18 @@ static NSNotificationCenter *nc;
[super mouseDown: theEvent];
}
- (BOOL) textView: (NSTextView *)textView doCommandBySelector: (SEL)command
{
if ([super textView: textView doCommandBySelector: command])
return YES;
if (sel_eq(command, @selector(moveDown:)))
{
[_cell _performClickWithFrame: [self bounds] inView: self];
return YES;
}
return NO;
}
- (void) setFrame: (NSRect)frame
{
NSRect rect = NSMakeRect(frame.origin.x, frame.origin.y, frame.size.width, 21);