* 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:
Eric Wasylishen 2011-04-30 05:46:44 +00:00
parent a3fe4dcbec
commit 019d81dc22
2 changed files with 29 additions and 0 deletions

View file

@ -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:):

View file

@ -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
*/