2006-09-02 12:09:20 -04:00
|
|
|
//
|
|
|
|
// FileOutlineView.m
|
|
|
|
// BindTest
|
|
|
|
//
|
2006-09-04 14:46:18 -04:00
|
|
|
// Created by Vincent Spader on 8/20/06.
|
|
|
|
// Copyright 2006 Vincent Spader. All rights reserved.
|
2006-09-02 12:09:20 -04:00
|
|
|
//
|
|
|
|
|
|
|
|
#import "FileOutlineView.h"
|
|
|
|
#import "FileIconCell.h"
|
|
|
|
|
2007-02-18 14:35:28 -03:00
|
|
|
@interface FileOutlineView (KFTypeSelectTableViewSupport)
|
|
|
|
- (void)findPrevious:(id)sender;
|
|
|
|
- (void)findNext:(id)sender;
|
|
|
|
@end
|
|
|
|
|
2006-09-02 12:09:20 -04:00
|
|
|
@implementation FileOutlineView
|
|
|
|
|
|
|
|
- (void) awakeFromNib
|
|
|
|
{
|
|
|
|
NSEnumerator *e = [[self tableColumns] objectEnumerator];
|
|
|
|
id c;
|
|
|
|
while ((c = [e nextObject]))
|
|
|
|
{
|
|
|
|
// id headerCell = [[ImageTextCell alloc] init];
|
|
|
|
id dataCell = [[FileIconCell alloc] init];
|
|
|
|
|
|
|
|
[dataCell setLineBreakMode:NSLineBreakByTruncatingTail];
|
|
|
|
// [c setHeaderCell: headerCell];
|
|
|
|
[c setDataCell: dataCell];
|
|
|
|
}
|
|
|
|
}
|
2007-02-18 14:35:28 -03:00
|
|
|
|
|
|
|
|
|
|
|
//Navigate outline view with the keyboard, send select actions to delegate
|
|
|
|
- (void)keyDown:(NSEvent *)theEvent
|
|
|
|
{
|
|
|
|
if (!([theEvent modifierFlags] & NSCommandKeyMask)) {
|
|
|
|
|
|
|
|
NSString *charString = [theEvent charactersIgnoringModifiers];
|
|
|
|
unichar pressedChar = 0;
|
2006-09-02 12:09:20 -04:00
|
|
|
|
2007-02-18 14:35:28 -03:00
|
|
|
//Get the pressed character
|
|
|
|
if ([charString length] == 1) pressedChar = [charString characterAtIndex:0];
|
|
|
|
|
|
|
|
if ((pressedChar == '\031') && // backtab
|
|
|
|
([self respondsToSelector:@selector(findPrevious:)])) {
|
|
|
|
/* KFTypeSelectTableView supports findPrevious; backtab is added to AIOutlineView as a find previous action
|
|
|
|
* if KFTypeSelectTableView is being used via posing */
|
|
|
|
[self findPrevious:self];
|
|
|
|
|
|
|
|
} else if ((pressedChar == '\t') &&
|
|
|
|
([self respondsToSelector:@selector(findNext:)])) {
|
|
|
|
/* KFTypeSelectTableView supports findNext; tab is added to AIOutlineView as a find next action
|
|
|
|
* if KFTypeSelectTableView is being used via posing */
|
|
|
|
[self findNext:self];
|
|
|
|
|
|
|
|
} else {
|
|
|
|
[super keyDown:theEvent];
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
[super keyDown:theEvent];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-09-02 12:09:20 -04:00
|
|
|
@end
|