Adding NSOutlineView changes so far so that everyone can see the progress which has been made. GJC

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@12704 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2002-02-23 16:37:17 +00:00
parent 229c19e444
commit 275c7ff8d5
5 changed files with 1699 additions and 44 deletions

View file

@ -1,3 +1,11 @@
Sat Feb 23 11:28:32 2002 Gregory Casamento <greg_casamento@yahoo.com>
* Headers/gnustep/gui/AppKit.h: Added NSOutlineView header
* Headers/gnustep/gui/NSOutlineView.h: Added additional ivars and
corrected methods for delegate and data source.
* Source/NSOutlineView.m: Added lots of new code to handle the
outline view.
* Source/externs.m: Added definitions for notifications.
Sat Feb 23 12:20:28 2002 Nicola Pero <n.pero@mi.flashnet.it>
Patch by Alexander Malmberg <alexander@malmber.org> -
@ -57,6 +65,7 @@ Fri Feb 22 18:22:48 2002 Nicola Pero <nicola@brainstorm.co.uk>
* Source/NSApplication.m ([-terminate:]): Use an autorelease pool.
>>>>>>> 1.1360
Thu Feb 21 23:29:50 2002 Nicola Pero <n.pero@mi.flashnet.it>
* Headers/gnustep/gui/NSWindow.h (_originalResponder): Ivar removed.

View file

@ -139,6 +139,7 @@
#ifndef STRICT_OPENSTEP
#include <AppKit/NSDrawer.h>
#include <AppKit/NSLayoutManager.h>
#include <AppKit/NSOutlineView.h>
#include <AppKit/NSTextContainer.h>
#include <AppKit/NSTextStorage.h>
#include <AppKit/NSUserInterfaceValidation.h>

View file

@ -31,11 +31,16 @@
#include <AppKit/NSTableView.h>
@class NSMutableArray;
@class NSString;
@interface NSOutlineView : NSTableView
{
NSMutableArray *_items;
NSMutableArray *_expandedItems;
BOOL _resize;
BOOL _followsCell;
BOOL _autosave;
BOOL _autosaveExpandedItems;
float _indentLevel;
NSTableColumn *_outlineTableColumn;
BOOL _shouldCollapse;
@ -67,7 +72,7 @@
- (void)setOutlineTableColumn: (NSTableColumn *)outlineTableColumn;
- (BOOL)shouldCollapseAutoExpandedItemsForDeposited: (BOOL)deposited;
@end /* interface of NSTableView */
@end /* interface of NSOutlineView */
/*
* Informal protocol NSOutlineViewDataSource
@ -78,19 +83,23 @@
item: (id)item
childIndex: (int)index;
// required method
- (id)outlineView: (NSOutlineView *)outlineView
child: (int)index
ofItem:(id)item;
ofItem: (id)item;
// required method
- (BOOL)outlineView: (NSOutlineView *)outlineView
isItemExpandable: (id)item;
- (id)outlineView: (NSOutlineView *)outlineView
itemForPersistentObject:(id)object;
// required method
- (int)outlineView: (NSOutlineView *)outlineView
numberOfChildrenOfItem: (id)item;
// required method
- (id)outlineView: (NSOutlineView *)outlineView
objectValueForTableColumn:(NSTableColumn *)tableColumn
byItem:(id)item;
@ -99,12 +108,14 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
persistentObjectForItem: (id)item;
- (void)outlineView: (NSOutlineView *)outlineView
setObjectView: (id)object
forTableColumn: (NSTableColumn *)tableColumn;
setObjectValue: (id)object
forTableColumn: (NSTableColumn *)tableColumn
byItem: (id)item;
- (NSDragOperation)outlineView: (NSOutlineView*)outlineView
validateDrop: (id <NSDraggingInfo>)info
proposedItem: (id)item proposedChildIndex:(int)index;
proposedItem: (id)item
proposedChildIndex: (int)index;
- (BOOL)outlineView: (NSOutlineView *)outlineView
writeItems: (NSArray*)items
@ -125,29 +136,44 @@ APPKIT_EXPORT NSString *NSOutlineViewSelectionDidChangeNotification;
APPKIT_EXPORT NSString *NSOutlineViewSelectionIsChangingNotification;
APPKIT_EXPORT NSString *NSOutlineViewItemDidExpandNotification;
APPKIT_EXPORT NSString *NSOutlineViewItemDidCollapseNotification;
APPKIT_EXPORT NSString *NSOutlineViewItemWillExpandNotification;
APPKIT_EXPORT NSString *NSOutlineViewItemWillCollapseNotification;
/*
* Methods Implemented by the Delegate
*/
@interface NSObject (NSOutlineViewDelegate)
- (BOOL) outlineView: (NSOutlineView *)aOutlineView
shouldEditTableColumn: (NSTableColumn *)aTableColumn
row: (int)rowIndex;
- (BOOL) outlineView: (NSOutlineView *)aOutlineView
shouldSelectRow: (int)rowIndex;
- (BOOL) outlineView: (NSOutlineView *)aOutlineView
shouldSelectTableColumn: (NSTableColumn *)aTableColumn;
- (void) outlineView: (NSOutlineView *)aOutlineView
willDisplayCell: (id)aCell
forTableColumn: (NSTableColumn *)aTableColumn
row: (int)rowIndex;
// notification methods
- (void) outlineViewColumnDidMove: (NSNotification *)aNotification;
- (void) outlineViewColumnDidResize: (NSNotification *)aNotification;
- (void) outlineViewItemDidCollapse: (NSNotification *)aNotification;
- (void) outlineViewItemDidExpand: (NSNotification *)aNotification;
- (void) outlineViewItemWillCollapse: (NSNotification *)aNotification;
- (void) outlineViewItemWillExpand: (NSNotification *)aNotification;
- (void) outlineViewSelectionDidChange: (NSNotification *)aNotification;
- (void) outlineViewSelectionIsChanging: (NSNotification *)aNotification;
- (void) outlineViewItemDidExpand: (NSNotification *)aNotification;
- (void) outlineViewItemDidCollapse: (NSNotification *)aNotification;
// delegate methods
- (BOOL) outlineView: (NSOutlineView *)outlineView
shouldCollapseItem: (id)item;
- (BOOL) outlineView: (NSOutlineView *)outlineView
shouldEditTableColumn: (NSTableColumn *)tableColumn
item: (id)item;
- (BOOL) outlineView: (NSOutlineView *)outlineView
shouldExpandItem: (id)item;
- (BOOL) outlineView: (NSOutlineView *)outlineView
shouldSelectItem: (id)item;
- (BOOL) outlineView: (NSOutlineView *)outlineView
shouldSelectTableColumn: (NSTableColumn *)tableColumn;
- (BOOL) outlineView: (NSOutlineView *)outlineView
willDisplayCell: (id)cell
forTableColumn: (NSTableColumn *)tableColumn
item: (id)item;
- (BOOL) outlineView: (NSOutlineView *)outlineView
willDisplayOutlineCell: (id)cell
forTableColumn: (NSTableColumn *)tableColumn
item: (id)item;
- (BOOL) selectionShouldChangeInOutlineView: (NSOutlineView *)outlineView;
@end
#endif /* _GNUstep_H_NSOutlineView */

File diff suppressed because it is too large Load diff

View file

@ -342,6 +342,16 @@ NSString *NSTableViewColumnDidMoveNotification = @"TableViewColumnDidMove";
NSString *NSTableViewColumnDidResizeNotification = @"TableViewColumnDidResize";
NSString *NSTableViewSelectionIsChangingNotification = @"TableViewSelectionIsChanging";
// NSOutlineView notifications
NSString *NSOutlineViewSelectionDidChangeNotification = @"OutlineViewSelectionDidChange";
NSString *NSOutlineViewColumnDidMoveNotification = @"OutlineViewColumnDidMove";
NSString *NSOutlineViewColumnDidResizeNotification = @"OutlineViewColumnDidResize";
NSString *NSOutlineViewSelectionIsChangingNotification = @"OutlineViewSelectionIsChanging";
NSString *NSOutlineViewItemDidExpandNotification = @"OutlineViewItemDidExpand";
NSString *NSOutlineViewItemDidCollapseNotification = @"OutlineViewItemDidCollapse";
NSString *NSOutlineViewItemWillExpandNotification = @"OutlineViewItemWillExpand";
NSString *NSOutlineViewItemWillCollapseNotification = @"OutlineViewItemWillCollapse";
// NSWindow notifications
NSString *NSWindowDidBecomeKeyNotification = @"WindowDidBecomeKey";
NSString *NSWindowDidBecomeMainNotification = @"WindowDidBecomeMain";