mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 02:10:48 +00:00
* Source/NSOutlineView.m: Implement -keyDown: to expand/contract
items. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32954 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a3fe4dcbec
commit
019d81dc22
2 changed files with 29 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2011-04-29 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/NSOutlineView.m: Implement -keyDown: to expand/contract
|
||||
items.
|
||||
|
||||
2011-04-29 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/NSTextView.m (-mouseDown:):
|
||||
|
|
|
@ -858,6 +858,30 @@ static NSImage *unexpandable = nil;
|
|||
[super mouseDown: theEvent];
|
||||
}
|
||||
|
||||
- (void)keyDown: (NSEvent*)event
|
||||
{
|
||||
NSString *characters = [event characters];
|
||||
|
||||
if ([characters length] == 1)
|
||||
{
|
||||
unichar c = [characters characterAtIndex: 0];
|
||||
id item = [self itemAtRow: [self selectedRow]];
|
||||
switch (c)
|
||||
{
|
||||
case NSLeftArrowFunctionKey:
|
||||
[self collapseItem: item];
|
||||
return;
|
||||
case NSRightArrowFunctionKey:
|
||||
[self expandItem: item];
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
[super keyDown: event];
|
||||
}
|
||||
|
||||
/*
|
||||
* Drawing
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue