Inital commit of the extended outliner. NPOB.

This commit is contained in:
hyatt%netscape.com 2002-04-20 02:54:08 +00:00
Родитель 16d6178b2f
Коммит 7717ae474e
34 изменённых файлов: 1418 добавлений и 12 удалений

94
camino/BrowserWindow.nib/classes.nib сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,94 @@
{
IBClasses = (
{CLASS = BookmarkItem; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {addBookmark = id; addFolder = id; deleteBookmark = id; deleteBookmarks = id; };
CLASS = BookmarksDataSource;
LANGUAGE = ObjC;
OUTLETS = {
mAddButton = id;
mBrowserWindowController = id;
mDeleteButton = id;
mOutlineView = id;
};
SUPERCLASS = NSObject;
},
{CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = BrowserWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; },
{
ACTIONS = {
back = id;
cancelAddBookmarkSheet = id;
endAddBookmarkSheet = id;
endLocationSheet = id;
forward = id;
goToLocationFromToolbarURLField = id;
home = id;
manageBookmarks = id;
openLinkInNewTab = id;
openLinkInNewWindow = id;
reload = id;
saveImageAs = id;
saveLinkAs = id;
savePageAs = id;
stop = id;
toggleSidebar = id;
viewOnlyThisImage = id;
};
CLASS = BrowserWindowController;
LANGUAGE = ObjC;
OUTLETS = {
mAddBookmarkCheckbox = id;
mAddBookmarkFolderField = id;
mAddBookmarkSheetWindow = id;
mAddBookmarkTitleField = id;
mCachedBMDS = id;
mImageLinkMenu = id;
mImageMenu = id;
mInputMenu = id;
mLinkMenu = id;
mLocationSheetURLField = id;
mLocationSheetWindow = id;
mLocationToolbarView = id;
mPageMenu = id;
mPersonalToolbar = BookmarksToolbar;
mProgress = id;
mSidebarBookmarksDataSource = id;
mSidebarBrowserView = id;
mSidebarDrawer = NSDrawer;
mSidebarSourceTabView = id;
mSidebarTabView = id;
mStatus = id;
mTabBrowser = id;
mURLBar = id;
};
SUPERCLASS = NSWindowController;
},
{CLASS = CHExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = CHExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{CLASS = ExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = LocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = MJExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{CLASS = MainController; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {load = id; };
CLASS = MyBrowserView;
LANGUAGE = ObjC;
OUTLETS = {
mImageLinkMenu = id;
mImageMenu = id;
mInputMenu = id;
mLinkMenu = id;
mPageMenu = id;
mWindowController = id;
progress = id;
progressSuper = id;
status = id;
urlbar = id;
};
SUPERCLASS = NSView;
}
);
IBVersion = 1;
}

55
camino/BrowserWindow.nib/info.nib сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>7 130 480 309 0 0 1152 746 </string>
<key>IBEditorPositions</key>
<dict>
<key>124</key>
<string>431 537 170 180 0 0 1152 746 </string>
<key>160</key>
<string>478 70 195 666 0 0 1152 746 </string>
<key>28</key>
<string>478 279 195 457 0 0 1152 746 </string>
<key>297</key>
<string>70 110 187 210 0 0 1152 746 </string>
<key>314</key>
<string>271 139 168 180 0 0 1152 746 </string>
<key>336</key>
<string>458 90 200 162 0 0 1152 746 </string>
<key>343</key>
<string>499 330 200 252 0 0 1152 746 </string>
<key>365</key>
<string>22 500 93 162 0 0 1152 746 </string>
<key>463</key>
<string>7 444 200 252 0 0 1152 746 </string>
<key>56</key>
<string>404 484 343 68 0 0 1152 746 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
<key>IBGroupedObjects</key>
<dict>
<key>3</key>
<array>
<string>8</string>
<string>9</string>
</array>
</dict>
<key>IBLastGroupID</key>
<string>4</string>
<key>IBLockedObjects</key>
<array>
<integer>252</integer>
</array>
<key>IBOpenObjects</key>
<array>
<integer>10</integer>
<integer>394</integer>
<integer>160</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
</dict>
</plist>

Двоичные данные
camino/BrowserWindow.nib/objects.nib сгенерированный Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,35 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2002 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Hyatt <hyatt@netscape.com> (Original Author)
*/
#import <AppKit/AppKit.h>
@interface CHExtendedOutlineView : NSOutlineView {
SEL mDeleteAction;
}
-(void)keyDown:(NSEvent*)aEvent;
-(void)setDeleteAction: (SEL)deleteAction;
-(SEL)deleteAction;
@end

Просмотреть файл

@ -0,0 +1,93 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2002 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Hyatt <hyatt@netscape.com> (Original Author)
*/
#import "CHExtendedOutlineView.h"
@implementation CHExtendedOutlineView
- (id)initWithFrame:(NSRect)frame {
if ( (self = [super initWithFrame:frame]) ) {
mDeleteAction = 0;
}
return self;
}
-(void)setDeleteAction: (SEL)aDeleteAction
{
mDeleteAction = aDeleteAction;
}
-(SEL)deleteAction
{
return mDeleteAction;
}
int kReturnKeyCode = 0x24;
int kDeleteKeyCode = 0x33;
int kLeftArrowKeyCode = 0x7B;
int kRightArrowKeyCode = 0x7C;
-(void)keyDown:(NSEvent*)aEvent
{
// Check for a certain set of special keys.
//NSDeleteFunctionKey
if ([aEvent keyCode] == kDeleteKeyCode) {
if (mDeleteAction)
[NSApp sendAction: mDeleteAction to: [self target] from: self];
return;
}
else if ([aEvent keyCode] == kReturnKeyCode) {
// Override return to keep the goofy inline editing
// from happening.
if ([self numberOfSelectedRows] == 1)
[NSApp sendAction: [self doubleAction] to: [self target] from: self];
return;
}
else if ([aEvent keyCode] == kLeftArrowKeyCode ||
[aEvent keyCode] == kRightArrowKeyCode)
{
BOOL expand = ([aEvent keyCode] == kRightArrowKeyCode);
if ([self numberOfSelectedRows] == 1) {
int index = [self selectedRow];
if (index == -1)
return;
id item = [self itemAtRow: index];
if (!item)
return;
if (![self isExpandable: item])
return;
if (![self isItemExpanded: item] && expand)
[self expandItem: item];
else if ([self isItemExpanded: item] && !expand)
[self collapseItem: item];
}
}
return [super keyDown: aEvent];
}
@end

Просмотреть файл

@ -14,7 +14,7 @@
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Copyright (C) 2002 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):

Просмотреть файл

@ -2414,12 +2414,12 @@
};
F5C3AB810270072A01A80166 = {
isa = PBXFileReference;
path = ExtendedOutlineView.h;
path = CHExtendedOutlineView.h;
refType = 4;
};
F5C3AB820270072A01A80166 = {
isa = PBXFileReference;
path = ExtendedOutlineView.mm;
path = CHExtendedOutlineView.mm;
refType = 4;
};
F5C3AB830270072A01A80166 = {

94
camino/English.lproj/BrowserWindow.nib/classes.nib сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,94 @@
{
IBClasses = (
{CLASS = BookmarkItem; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {addBookmark = id; addFolder = id; deleteBookmark = id; deleteBookmarks = id; };
CLASS = BookmarksDataSource;
LANGUAGE = ObjC;
OUTLETS = {
mAddButton = id;
mBrowserWindowController = id;
mDeleteButton = id;
mOutlineView = id;
};
SUPERCLASS = NSObject;
},
{CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = BrowserWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; },
{
ACTIONS = {
back = id;
cancelAddBookmarkSheet = id;
endAddBookmarkSheet = id;
endLocationSheet = id;
forward = id;
goToLocationFromToolbarURLField = id;
home = id;
manageBookmarks = id;
openLinkInNewTab = id;
openLinkInNewWindow = id;
reload = id;
saveImageAs = id;
saveLinkAs = id;
savePageAs = id;
stop = id;
toggleSidebar = id;
viewOnlyThisImage = id;
};
CLASS = BrowserWindowController;
LANGUAGE = ObjC;
OUTLETS = {
mAddBookmarkCheckbox = id;
mAddBookmarkFolderField = id;
mAddBookmarkSheetWindow = id;
mAddBookmarkTitleField = id;
mCachedBMDS = id;
mImageLinkMenu = id;
mImageMenu = id;
mInputMenu = id;
mLinkMenu = id;
mLocationSheetURLField = id;
mLocationSheetWindow = id;
mLocationToolbarView = id;
mPageMenu = id;
mPersonalToolbar = BookmarksToolbar;
mProgress = id;
mSidebarBookmarksDataSource = id;
mSidebarBrowserView = id;
mSidebarDrawer = NSDrawer;
mSidebarSourceTabView = id;
mSidebarTabView = id;
mStatus = id;
mTabBrowser = id;
mURLBar = id;
};
SUPERCLASS = NSWindowController;
},
{CLASS = CHExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = CHExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{CLASS = ExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = LocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = MJExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{CLASS = MainController; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {load = id; };
CLASS = MyBrowserView;
LANGUAGE = ObjC;
OUTLETS = {
mImageLinkMenu = id;
mImageMenu = id;
mInputMenu = id;
mLinkMenu = id;
mPageMenu = id;
mWindowController = id;
progress = id;
progressSuper = id;
status = id;
urlbar = id;
};
SUPERCLASS = NSView;
}
);
IBVersion = 1;
}

55
camino/English.lproj/BrowserWindow.nib/info.nib сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>7 130 480 309 0 0 1152 746 </string>
<key>IBEditorPositions</key>
<dict>
<key>124</key>
<string>431 537 170 180 0 0 1152 746 </string>
<key>160</key>
<string>478 70 195 666 0 0 1152 746 </string>
<key>28</key>
<string>478 279 195 457 0 0 1152 746 </string>
<key>297</key>
<string>70 110 187 210 0 0 1152 746 </string>
<key>314</key>
<string>271 139 168 180 0 0 1152 746 </string>
<key>336</key>
<string>458 90 200 162 0 0 1152 746 </string>
<key>343</key>
<string>499 330 200 252 0 0 1152 746 </string>
<key>365</key>
<string>22 500 93 162 0 0 1152 746 </string>
<key>463</key>
<string>7 444 200 252 0 0 1152 746 </string>
<key>56</key>
<string>404 484 343 68 0 0 1152 746 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
<key>IBGroupedObjects</key>
<dict>
<key>3</key>
<array>
<string>8</string>
<string>9</string>
</array>
</dict>
<key>IBLastGroupID</key>
<string>4</string>
<key>IBLockedObjects</key>
<array>
<integer>252</integer>
</array>
<key>IBOpenObjects</key>
<array>
<integer>10</integer>
<integer>394</integer>
<integer>160</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
</dict>
</plist>

Двоичные данные
camino/English.lproj/BrowserWindow.nib/objects.nib сгенерированный Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -2414,12 +2414,12 @@
};
F5C3AB810270072A01A80166 = {
isa = PBXFileReference;
path = ExtendedOutlineView.h;
path = CHExtendedOutlineView.h;
refType = 4;
};
F5C3AB820270072A01A80166 = {
isa = PBXFileReference;
path = ExtendedOutlineView.mm;
path = CHExtendedOutlineView.mm;
refType = 4;
};
F5C3AB830270072A01A80166 = {

94
camino/resources/localized/English.lproj/BrowserWindow.nib/classes.nib сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,94 @@
{
IBClasses = (
{CLASS = BookmarkItem; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {addBookmark = id; addFolder = id; deleteBookmark = id; deleteBookmarks = id; };
CLASS = BookmarksDataSource;
LANGUAGE = ObjC;
OUTLETS = {
mAddButton = id;
mBrowserWindowController = id;
mDeleteButton = id;
mOutlineView = id;
};
SUPERCLASS = NSObject;
},
{CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = BrowserWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; },
{
ACTIONS = {
back = id;
cancelAddBookmarkSheet = id;
endAddBookmarkSheet = id;
endLocationSheet = id;
forward = id;
goToLocationFromToolbarURLField = id;
home = id;
manageBookmarks = id;
openLinkInNewTab = id;
openLinkInNewWindow = id;
reload = id;
saveImageAs = id;
saveLinkAs = id;
savePageAs = id;
stop = id;
toggleSidebar = id;
viewOnlyThisImage = id;
};
CLASS = BrowserWindowController;
LANGUAGE = ObjC;
OUTLETS = {
mAddBookmarkCheckbox = id;
mAddBookmarkFolderField = id;
mAddBookmarkSheetWindow = id;
mAddBookmarkTitleField = id;
mCachedBMDS = id;
mImageLinkMenu = id;
mImageMenu = id;
mInputMenu = id;
mLinkMenu = id;
mLocationSheetURLField = id;
mLocationSheetWindow = id;
mLocationToolbarView = id;
mPageMenu = id;
mPersonalToolbar = BookmarksToolbar;
mProgress = id;
mSidebarBookmarksDataSource = id;
mSidebarBrowserView = id;
mSidebarDrawer = NSDrawer;
mSidebarSourceTabView = id;
mSidebarTabView = id;
mStatus = id;
mTabBrowser = id;
mURLBar = id;
};
SUPERCLASS = NSWindowController;
},
{CLASS = CHExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = CHExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{CLASS = ExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = LocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = MJExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{CLASS = MainController; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {load = id; };
CLASS = MyBrowserView;
LANGUAGE = ObjC;
OUTLETS = {
mImageLinkMenu = id;
mImageMenu = id;
mInputMenu = id;
mLinkMenu = id;
mPageMenu = id;
mWindowController = id;
progress = id;
progressSuper = id;
status = id;
urlbar = id;
};
SUPERCLASS = NSView;
}
);
IBVersion = 1;
}

55
camino/resources/localized/English.lproj/BrowserWindow.nib/info.nib сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>7 130 480 309 0 0 1152 746 </string>
<key>IBEditorPositions</key>
<dict>
<key>124</key>
<string>431 537 170 180 0 0 1152 746 </string>
<key>160</key>
<string>478 70 195 666 0 0 1152 746 </string>
<key>28</key>
<string>478 279 195 457 0 0 1152 746 </string>
<key>297</key>
<string>70 110 187 210 0 0 1152 746 </string>
<key>314</key>
<string>271 139 168 180 0 0 1152 746 </string>
<key>336</key>
<string>458 90 200 162 0 0 1152 746 </string>
<key>343</key>
<string>499 330 200 252 0 0 1152 746 </string>
<key>365</key>
<string>22 500 93 162 0 0 1152 746 </string>
<key>463</key>
<string>7 444 200 252 0 0 1152 746 </string>
<key>56</key>
<string>404 484 343 68 0 0 1152 746 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
<key>IBGroupedObjects</key>
<dict>
<key>3</key>
<array>
<string>8</string>
<string>9</string>
</array>
</dict>
<key>IBLastGroupID</key>
<string>4</string>
<key>IBLockedObjects</key>
<array>
<integer>252</integer>
</array>
<key>IBOpenObjects</key>
<array>
<integer>10</integer>
<integer>394</integer>
<integer>160</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
</dict>
</plist>

Двоичные данные
camino/resources/localized/English.lproj/BrowserWindow.nib/objects.nib сгенерированный Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -14,7 +14,7 @@
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Copyright (C) 2002 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):

Просмотреть файл

@ -0,0 +1,35 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2002 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Hyatt <hyatt@netscape.com> (Original Author)
*/
#import <AppKit/AppKit.h>
@interface CHExtendedOutlineView : NSOutlineView {
SEL mDeleteAction;
}
-(void)keyDown:(NSEvent*)aEvent;
-(void)setDeleteAction: (SEL)deleteAction;
-(SEL)deleteAction;
@end

Просмотреть файл

@ -0,0 +1,93 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2002 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Hyatt <hyatt@netscape.com> (Original Author)
*/
#import "CHExtendedOutlineView.h"
@implementation CHExtendedOutlineView
- (id)initWithFrame:(NSRect)frame {
if ( (self = [super initWithFrame:frame]) ) {
mDeleteAction = 0;
}
return self;
}
-(void)setDeleteAction: (SEL)aDeleteAction
{
mDeleteAction = aDeleteAction;
}
-(SEL)deleteAction
{
return mDeleteAction;
}
int kReturnKeyCode = 0x24;
int kDeleteKeyCode = 0x33;
int kLeftArrowKeyCode = 0x7B;
int kRightArrowKeyCode = 0x7C;
-(void)keyDown:(NSEvent*)aEvent
{
// Check for a certain set of special keys.
//NSDeleteFunctionKey
if ([aEvent keyCode] == kDeleteKeyCode) {
if (mDeleteAction)
[NSApp sendAction: mDeleteAction to: [self target] from: self];
return;
}
else if ([aEvent keyCode] == kReturnKeyCode) {
// Override return to keep the goofy inline editing
// from happening.
if ([self numberOfSelectedRows] == 1)
[NSApp sendAction: [self doubleAction] to: [self target] from: self];
return;
}
else if ([aEvent keyCode] == kLeftArrowKeyCode ||
[aEvent keyCode] == kRightArrowKeyCode)
{
BOOL expand = ([aEvent keyCode] == kRightArrowKeyCode);
if ([self numberOfSelectedRows] == 1) {
int index = [self selectedRow];
if (index == -1)
return;
id item = [self itemAtRow: index];
if (!item)
return;
if (![self isExpandable: item])
return;
if (![self isItemExpanded: item] && expand)
[self expandItem: item];
else if ([self isItemExpanded: item] && !expand)
[self collapseItem: item];
}
}
return [super keyDown: aEvent];
}
@end

94
chimera/BrowserWindow.nib/classes.nib сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,94 @@
{
IBClasses = (
{CLASS = BookmarkItem; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {addBookmark = id; addFolder = id; deleteBookmark = id; deleteBookmarks = id; };
CLASS = BookmarksDataSource;
LANGUAGE = ObjC;
OUTLETS = {
mAddButton = id;
mBrowserWindowController = id;
mDeleteButton = id;
mOutlineView = id;
};
SUPERCLASS = NSObject;
},
{CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = BrowserWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; },
{
ACTIONS = {
back = id;
cancelAddBookmarkSheet = id;
endAddBookmarkSheet = id;
endLocationSheet = id;
forward = id;
goToLocationFromToolbarURLField = id;
home = id;
manageBookmarks = id;
openLinkInNewTab = id;
openLinkInNewWindow = id;
reload = id;
saveImageAs = id;
saveLinkAs = id;
savePageAs = id;
stop = id;
toggleSidebar = id;
viewOnlyThisImage = id;
};
CLASS = BrowserWindowController;
LANGUAGE = ObjC;
OUTLETS = {
mAddBookmarkCheckbox = id;
mAddBookmarkFolderField = id;
mAddBookmarkSheetWindow = id;
mAddBookmarkTitleField = id;
mCachedBMDS = id;
mImageLinkMenu = id;
mImageMenu = id;
mInputMenu = id;
mLinkMenu = id;
mLocationSheetURLField = id;
mLocationSheetWindow = id;
mLocationToolbarView = id;
mPageMenu = id;
mPersonalToolbar = BookmarksToolbar;
mProgress = id;
mSidebarBookmarksDataSource = id;
mSidebarBrowserView = id;
mSidebarDrawer = NSDrawer;
mSidebarSourceTabView = id;
mSidebarTabView = id;
mStatus = id;
mTabBrowser = id;
mURLBar = id;
};
SUPERCLASS = NSWindowController;
},
{CLASS = CHExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = CHExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{CLASS = ExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = LocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = MJExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{CLASS = MainController; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {load = id; };
CLASS = MyBrowserView;
LANGUAGE = ObjC;
OUTLETS = {
mImageLinkMenu = id;
mImageMenu = id;
mInputMenu = id;
mLinkMenu = id;
mPageMenu = id;
mWindowController = id;
progress = id;
progressSuper = id;
status = id;
urlbar = id;
};
SUPERCLASS = NSView;
}
);
IBVersion = 1;
}

55
chimera/BrowserWindow.nib/info.nib сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>7 130 480 309 0 0 1152 746 </string>
<key>IBEditorPositions</key>
<dict>
<key>124</key>
<string>431 537 170 180 0 0 1152 746 </string>
<key>160</key>
<string>478 70 195 666 0 0 1152 746 </string>
<key>28</key>
<string>478 279 195 457 0 0 1152 746 </string>
<key>297</key>
<string>70 110 187 210 0 0 1152 746 </string>
<key>314</key>
<string>271 139 168 180 0 0 1152 746 </string>
<key>336</key>
<string>458 90 200 162 0 0 1152 746 </string>
<key>343</key>
<string>499 330 200 252 0 0 1152 746 </string>
<key>365</key>
<string>22 500 93 162 0 0 1152 746 </string>
<key>463</key>
<string>7 444 200 252 0 0 1152 746 </string>
<key>56</key>
<string>404 484 343 68 0 0 1152 746 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
<key>IBGroupedObjects</key>
<dict>
<key>3</key>
<array>
<string>8</string>
<string>9</string>
</array>
</dict>
<key>IBLastGroupID</key>
<string>4</string>
<key>IBLockedObjects</key>
<array>
<integer>252</integer>
</array>
<key>IBOpenObjects</key>
<array>
<integer>10</integer>
<integer>394</integer>
<integer>160</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
</dict>
</plist>

Двоичные данные
chimera/BrowserWindow.nib/objects.nib сгенерированный Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,35 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2002 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Hyatt <hyatt@netscape.com> (Original Author)
*/
#import <AppKit/AppKit.h>
@interface CHExtendedOutlineView : NSOutlineView {
SEL mDeleteAction;
}
-(void)keyDown:(NSEvent*)aEvent;
-(void)setDeleteAction: (SEL)deleteAction;
-(SEL)deleteAction;
@end

Просмотреть файл

@ -0,0 +1,93 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2002 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Hyatt <hyatt@netscape.com> (Original Author)
*/
#import "CHExtendedOutlineView.h"
@implementation CHExtendedOutlineView
- (id)initWithFrame:(NSRect)frame {
if ( (self = [super initWithFrame:frame]) ) {
mDeleteAction = 0;
}
return self;
}
-(void)setDeleteAction: (SEL)aDeleteAction
{
mDeleteAction = aDeleteAction;
}
-(SEL)deleteAction
{
return mDeleteAction;
}
int kReturnKeyCode = 0x24;
int kDeleteKeyCode = 0x33;
int kLeftArrowKeyCode = 0x7B;
int kRightArrowKeyCode = 0x7C;
-(void)keyDown:(NSEvent*)aEvent
{
// Check for a certain set of special keys.
//NSDeleteFunctionKey
if ([aEvent keyCode] == kDeleteKeyCode) {
if (mDeleteAction)
[NSApp sendAction: mDeleteAction to: [self target] from: self];
return;
}
else if ([aEvent keyCode] == kReturnKeyCode) {
// Override return to keep the goofy inline editing
// from happening.
if ([self numberOfSelectedRows] == 1)
[NSApp sendAction: [self doubleAction] to: [self target] from: self];
return;
}
else if ([aEvent keyCode] == kLeftArrowKeyCode ||
[aEvent keyCode] == kRightArrowKeyCode)
{
BOOL expand = ([aEvent keyCode] == kRightArrowKeyCode);
if ([self numberOfSelectedRows] == 1) {
int index = [self selectedRow];
if (index == -1)
return;
id item = [self itemAtRow: index];
if (!item)
return;
if (![self isExpandable: item])
return;
if (![self isItemExpanded: item] && expand)
[self expandItem: item];
else if ([self isItemExpanded: item] && !expand)
[self collapseItem: item];
}
}
return [super keyDown: aEvent];
}
@end

Просмотреть файл

@ -14,7 +14,7 @@
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Copyright (C) 2002 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):

Просмотреть файл

@ -2414,12 +2414,12 @@
};
F5C3AB810270072A01A80166 = {
isa = PBXFileReference;
path = ExtendedOutlineView.h;
path = CHExtendedOutlineView.h;
refType = 4;
};
F5C3AB820270072A01A80166 = {
isa = PBXFileReference;
path = ExtendedOutlineView.mm;
path = CHExtendedOutlineView.mm;
refType = 4;
};
F5C3AB830270072A01A80166 = {

94
chimera/English.lproj/BrowserWindow.nib/classes.nib сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,94 @@
{
IBClasses = (
{CLASS = BookmarkItem; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {addBookmark = id; addFolder = id; deleteBookmark = id; deleteBookmarks = id; };
CLASS = BookmarksDataSource;
LANGUAGE = ObjC;
OUTLETS = {
mAddButton = id;
mBrowserWindowController = id;
mDeleteButton = id;
mOutlineView = id;
};
SUPERCLASS = NSObject;
},
{CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = BrowserWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; },
{
ACTIONS = {
back = id;
cancelAddBookmarkSheet = id;
endAddBookmarkSheet = id;
endLocationSheet = id;
forward = id;
goToLocationFromToolbarURLField = id;
home = id;
manageBookmarks = id;
openLinkInNewTab = id;
openLinkInNewWindow = id;
reload = id;
saveImageAs = id;
saveLinkAs = id;
savePageAs = id;
stop = id;
toggleSidebar = id;
viewOnlyThisImage = id;
};
CLASS = BrowserWindowController;
LANGUAGE = ObjC;
OUTLETS = {
mAddBookmarkCheckbox = id;
mAddBookmarkFolderField = id;
mAddBookmarkSheetWindow = id;
mAddBookmarkTitleField = id;
mCachedBMDS = id;
mImageLinkMenu = id;
mImageMenu = id;
mInputMenu = id;
mLinkMenu = id;
mLocationSheetURLField = id;
mLocationSheetWindow = id;
mLocationToolbarView = id;
mPageMenu = id;
mPersonalToolbar = BookmarksToolbar;
mProgress = id;
mSidebarBookmarksDataSource = id;
mSidebarBrowserView = id;
mSidebarDrawer = NSDrawer;
mSidebarSourceTabView = id;
mSidebarTabView = id;
mStatus = id;
mTabBrowser = id;
mURLBar = id;
};
SUPERCLASS = NSWindowController;
},
{CLASS = CHExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = CHExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{CLASS = ExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = LocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = MJExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{CLASS = MainController; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {load = id; };
CLASS = MyBrowserView;
LANGUAGE = ObjC;
OUTLETS = {
mImageLinkMenu = id;
mImageMenu = id;
mInputMenu = id;
mLinkMenu = id;
mPageMenu = id;
mWindowController = id;
progress = id;
progressSuper = id;
status = id;
urlbar = id;
};
SUPERCLASS = NSView;
}
);
IBVersion = 1;
}

55
chimera/English.lproj/BrowserWindow.nib/info.nib сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>7 130 480 309 0 0 1152 746 </string>
<key>IBEditorPositions</key>
<dict>
<key>124</key>
<string>431 537 170 180 0 0 1152 746 </string>
<key>160</key>
<string>478 70 195 666 0 0 1152 746 </string>
<key>28</key>
<string>478 279 195 457 0 0 1152 746 </string>
<key>297</key>
<string>70 110 187 210 0 0 1152 746 </string>
<key>314</key>
<string>271 139 168 180 0 0 1152 746 </string>
<key>336</key>
<string>458 90 200 162 0 0 1152 746 </string>
<key>343</key>
<string>499 330 200 252 0 0 1152 746 </string>
<key>365</key>
<string>22 500 93 162 0 0 1152 746 </string>
<key>463</key>
<string>7 444 200 252 0 0 1152 746 </string>
<key>56</key>
<string>404 484 343 68 0 0 1152 746 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
<key>IBGroupedObjects</key>
<dict>
<key>3</key>
<array>
<string>8</string>
<string>9</string>
</array>
</dict>
<key>IBLastGroupID</key>
<string>4</string>
<key>IBLockedObjects</key>
<array>
<integer>252</integer>
</array>
<key>IBOpenObjects</key>
<array>
<integer>10</integer>
<integer>394</integer>
<integer>160</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
</dict>
</plist>

Двоичные данные
chimera/English.lproj/BrowserWindow.nib/objects.nib сгенерированный Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -2414,12 +2414,12 @@
};
F5C3AB810270072A01A80166 = {
isa = PBXFileReference;
path = ExtendedOutlineView.h;
path = CHExtendedOutlineView.h;
refType = 4;
};
F5C3AB820270072A01A80166 = {
isa = PBXFileReference;
path = ExtendedOutlineView.mm;
path = CHExtendedOutlineView.mm;
refType = 4;
};
F5C3AB830270072A01A80166 = {

94
chimera/resources/localized/English.lproj/BrowserWindow.nib/classes.nib сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,94 @@
{
IBClasses = (
{CLASS = BookmarkItem; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {addBookmark = id; addFolder = id; deleteBookmark = id; deleteBookmarks = id; };
CLASS = BookmarksDataSource;
LANGUAGE = ObjC;
OUTLETS = {
mAddButton = id;
mBrowserWindowController = id;
mDeleteButton = id;
mOutlineView = id;
};
SUPERCLASS = NSObject;
},
{CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = BrowserWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; },
{
ACTIONS = {
back = id;
cancelAddBookmarkSheet = id;
endAddBookmarkSheet = id;
endLocationSheet = id;
forward = id;
goToLocationFromToolbarURLField = id;
home = id;
manageBookmarks = id;
openLinkInNewTab = id;
openLinkInNewWindow = id;
reload = id;
saveImageAs = id;
saveLinkAs = id;
savePageAs = id;
stop = id;
toggleSidebar = id;
viewOnlyThisImage = id;
};
CLASS = BrowserWindowController;
LANGUAGE = ObjC;
OUTLETS = {
mAddBookmarkCheckbox = id;
mAddBookmarkFolderField = id;
mAddBookmarkSheetWindow = id;
mAddBookmarkTitleField = id;
mCachedBMDS = id;
mImageLinkMenu = id;
mImageMenu = id;
mInputMenu = id;
mLinkMenu = id;
mLocationSheetURLField = id;
mLocationSheetWindow = id;
mLocationToolbarView = id;
mPageMenu = id;
mPersonalToolbar = BookmarksToolbar;
mProgress = id;
mSidebarBookmarksDataSource = id;
mSidebarBrowserView = id;
mSidebarDrawer = NSDrawer;
mSidebarSourceTabView = id;
mSidebarTabView = id;
mStatus = id;
mTabBrowser = id;
mURLBar = id;
};
SUPERCLASS = NSWindowController;
},
{CLASS = CHExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = CHExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{CLASS = ExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = LocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = MJExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{CLASS = MainController; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {load = id; };
CLASS = MyBrowserView;
LANGUAGE = ObjC;
OUTLETS = {
mImageLinkMenu = id;
mImageMenu = id;
mInputMenu = id;
mLinkMenu = id;
mPageMenu = id;
mWindowController = id;
progress = id;
progressSuper = id;
status = id;
urlbar = id;
};
SUPERCLASS = NSView;
}
);
IBVersion = 1;
}

55
chimera/resources/localized/English.lproj/BrowserWindow.nib/info.nib сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>7 130 480 309 0 0 1152 746 </string>
<key>IBEditorPositions</key>
<dict>
<key>124</key>
<string>431 537 170 180 0 0 1152 746 </string>
<key>160</key>
<string>478 70 195 666 0 0 1152 746 </string>
<key>28</key>
<string>478 279 195 457 0 0 1152 746 </string>
<key>297</key>
<string>70 110 187 210 0 0 1152 746 </string>
<key>314</key>
<string>271 139 168 180 0 0 1152 746 </string>
<key>336</key>
<string>458 90 200 162 0 0 1152 746 </string>
<key>343</key>
<string>499 330 200 252 0 0 1152 746 </string>
<key>365</key>
<string>22 500 93 162 0 0 1152 746 </string>
<key>463</key>
<string>7 444 200 252 0 0 1152 746 </string>
<key>56</key>
<string>404 484 343 68 0 0 1152 746 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
<key>IBGroupedObjects</key>
<dict>
<key>3</key>
<array>
<string>8</string>
<string>9</string>
</array>
</dict>
<key>IBLastGroupID</key>
<string>4</string>
<key>IBLockedObjects</key>
<array>
<integer>252</integer>
</array>
<key>IBOpenObjects</key>
<array>
<integer>10</integer>
<integer>394</integer>
<integer>160</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
</dict>
</plist>

Двоичные данные
chimera/resources/localized/English.lproj/BrowserWindow.nib/objects.nib сгенерированный Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -14,7 +14,7 @@
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Copyright (C) 2002 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):

Просмотреть файл

@ -0,0 +1,35 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2002 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Hyatt <hyatt@netscape.com> (Original Author)
*/
#import <AppKit/AppKit.h>
@interface CHExtendedOutlineView : NSOutlineView {
SEL mDeleteAction;
}
-(void)keyDown:(NSEvent*)aEvent;
-(void)setDeleteAction: (SEL)deleteAction;
-(SEL)deleteAction;
@end

Просмотреть файл

@ -0,0 +1,93 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2002 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Hyatt <hyatt@netscape.com> (Original Author)
*/
#import "CHExtendedOutlineView.h"
@implementation CHExtendedOutlineView
- (id)initWithFrame:(NSRect)frame {
if ( (self = [super initWithFrame:frame]) ) {
mDeleteAction = 0;
}
return self;
}
-(void)setDeleteAction: (SEL)aDeleteAction
{
mDeleteAction = aDeleteAction;
}
-(SEL)deleteAction
{
return mDeleteAction;
}
int kReturnKeyCode = 0x24;
int kDeleteKeyCode = 0x33;
int kLeftArrowKeyCode = 0x7B;
int kRightArrowKeyCode = 0x7C;
-(void)keyDown:(NSEvent*)aEvent
{
// Check for a certain set of special keys.
//NSDeleteFunctionKey
if ([aEvent keyCode] == kDeleteKeyCode) {
if (mDeleteAction)
[NSApp sendAction: mDeleteAction to: [self target] from: self];
return;
}
else if ([aEvent keyCode] == kReturnKeyCode) {
// Override return to keep the goofy inline editing
// from happening.
if ([self numberOfSelectedRows] == 1)
[NSApp sendAction: [self doubleAction] to: [self target] from: self];
return;
}
else if ([aEvent keyCode] == kLeftArrowKeyCode ||
[aEvent keyCode] == kRightArrowKeyCode)
{
BOOL expand = ([aEvent keyCode] == kRightArrowKeyCode);
if ([self numberOfSelectedRows] == 1) {
int index = [self selectedRow];
if (index == -1)
return;
id item = [self itemAtRow: index];
if (!item)
return;
if (![self isExpandable: item])
return;
if (![self isItemExpanded: item] && expand)
[self expandItem: item];
else if ([self isItemExpanded: item] && !expand)
[self collapseItem: item];
}
}
return [super keyDown: aEvent];
}
@end