mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 00:31:03 +00:00
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:
parent
26019a4955
commit
d4e85d8f8d
3 changed files with 31 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue