Update controller / document. Add outlineView

This commit is contained in:
Gregory John Casamento 2024-12-27 21:49:16 -05:00
parent 77497d00ff
commit 226d5d3067
3 changed files with 51 additions and 1 deletions

View file

@ -327,6 +327,7 @@ static NSImage *fileImage = nil;
NSMenu *mainMenu = nil;
NSEnumerator *en = nil;
id o = nil;
NSOutlineView *outlineView = [[NSOutlineView alloc] init];
// get the window and cache it...
window = (GormDocumentWindow *)[self _docWindow];
@ -382,6 +383,15 @@ static NSImage *fileImage = nil;
NSViewHeightSizable|NSViewWidthSizable];
[scrollView setDocumentView: objectsView];
RELEASE(objectsView);
[objectViewController setIconView: scrollView];
RELEASE(scrollView);
[objectViewController setOutlineView: outlineView];
[outlineView setDataSource: self];
[outlineView reloadData];
RELEASE(outlineView);
[[objectViewController view] setAutoresizingMask:
NSViewHeightSizable|NSViewWidthSizable];
[objectViewController resetDisplayView: scrollView];

View file

@ -15,11 +15,19 @@
// Document
GormDocument *_document;
id _iconView;
id _outlineView;
}
- (GormDocument *) document;
- (void) setDocument: (GormDocument *)document;
- (id) iconView;
- (void) setIconView: (id)iconView;
- (id) outlineView;
- (void) setOutlineView: (id)outlineView;
- (void) resetDisplayView: (NSView *)view;
- (IBAction) iconView: (id)sender;

View file

@ -2,9 +2,19 @@
#import "GormObjectViewController.h"
#import "GormDocument.h"
#import "GormObjectEditor.h"
@implementation GormObjectViewController
- (void) dealloc
{
RELEASE(_document);
RELEASE(_iconView);
RELEASE(_outlineView);
[super dealloc];
}
- (GormDocument *) document
{
return _document;
@ -15,14 +25,36 @@
ASSIGN(_document, document);
}
- (id) iconView
{
return _iconView;
}
- (void) setIconView: (id)iconView
{
ASSIGN(_iconView, iconView);
}
- (id) outlineView
{
return _outlineView;
}
- (void) setOutlineView: (id)outlineView
{
ASSIGN(_outlineView, outlineView);
}
- (IBAction) iconView: (id)sender
{
NSLog(@"Called %@", NSStringFromSelector(_cmd));
[self resetDisplayView: _iconView];
}
- (IBAction) outlineView: (id)sender
{
NSLog(@"Called %@", NSStringFromSelector(_cmd));
[self resetDisplayView: _outlineView];
}
- (void) resetDisplayView: (NSView *)view