Got containing view working for outline/icon view of objects

This commit is contained in:
Gregory John Casamento 2024-12-27 07:40:23 -05:00
parent 07d7b65a27
commit 00a962677a
5 changed files with 43 additions and 4 deletions

View file

@ -34,7 +34,7 @@
#include <GNUstepGUI/GSNibContainer.h>
@class GormClassManager, GormClassEditor, GormObjectProxy, GormFilesOwner,
GormFilePrefsManager, GormDocumentWindow;
GormFilePrefsManager, GormDocumentWindow, GormObjectViewController;
/*
* Trivial classes for connections from objects to their editors, and from
@ -99,6 +99,9 @@
NSMutableSet *topLevelObjects;
NSMutableSet *visibleWindows;
NSMutableSet *deferredWindows;
// Controllers...
GormObjectViewController *objectViewController;
}
/* Handle notifications */

View file

@ -56,6 +56,7 @@
#import "GormDocumentWindow.h"
#import "GormDocumentController.h"
#import "GormXLIFFDocument.h"
#import "GormObjectViewController.h"
@interface NSObject (GormNSCoding)
@end
@ -368,6 +369,11 @@ static NSImage *fileImage = nil;
[scrollView setAutoresizingMask:
NSViewHeightSizable|NSViewWidthSizable];
[scrollView setBorderType: NSBezelBorder];
objectViewController = [[GormObjectViewController alloc] initWithNibName: @"GormObjectOutlineView"
bundle: [NSBundle bundleForClass: [self class]]];
[objectViewController setDocument: self];
NSLog(@"objectViewController = %@, view = %@", objectViewController, [objectViewController view]);
objectsView = [[GormObjectEditor alloc] initWithObject: nil
inDocument: self];
@ -376,7 +382,8 @@ static NSImage *fileImage = nil;
NSViewHeightSizable|NSViewWidthSizable];
[scrollView setDocumentView: objectsView];
RELEASE(objectsView);
[objectViewController resetDisplayView: scrollView];
// images...
mainRect.origin = NSMakePoint(0,0);
imagesScrollView = [[NSScrollView alloc] initWithFrame: scrollRect];
@ -417,7 +424,7 @@ static NSImage *fileImage = nil;
/*
* Set the objects view as the initial view the user's see on startup.
*/
[selectionBox setContentView: scrollView];
[selectionBox setContentView: [objectViewController view]]; //scrollView];
// add to the objects view...
[objectsView addObject: filesOwner];
@ -952,7 +959,7 @@ static NSImage *fileImage = nil;
{
case 0: // objects
{
[selectionBox setContentView: scrollView];
[selectionBox setContentView: [objectViewController view]]; //scrollView];
[toolbar setSelectedItemIdentifier: @"ObjectsItem"];
if (![[NSApp delegate] isConnecting])
[self setSelectionFromEditor: objectsView];

View file

@ -5,13 +5,23 @@
#import <AppKit/AppKit.h>
@class GormDocument;
@interface GormObjectViewController : NSViewController
{
IBOutlet id displayView;
IBOutlet id iconButton;
IBOutlet id outlineButton;
// Document
GormDocument *_document;
}
- (GormDocument *) document;
- (void) setDocument: (GormDocument *)document;
- (void) resetDisplayView: (NSView *)view;
- (IBAction) iconView: (id)sender;
- (IBAction) outlineView: (id)sender;

View file

@ -1,15 +1,34 @@
/* All rights reserved */
#import "GormObjectViewController.h"
#import "GormDocument.h"
@implementation GormObjectViewController
- (GormDocument *) document
{
return _document;
}
- (void) setDocument: (GormDocument *)document
{
ASSIGN(_document, document);
}
- (IBAction) iconView: (id)sender
{
NSLog(@"Called %@", NSStringFromSelector(_cmd));
}
- (IBAction) outlineView: (id)sender
{
NSLog(@"Called %@", NSStringFromSelector(_cmd));
}
- (void) resetDisplayView: (NSView *)view
{
[displayView setContentView: view];
NSLog(@"displayView = %@", view);
}
@end