Skip to content

Commit

Permalink
Got containing view working for outline/icon view of objects
Browse files Browse the repository at this point in the history
  • Loading branch information
gcasa committed Dec 27, 2024
1 parent 07d7b65 commit 00a9626
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 4 deletions.
Binary file modified GormCore/English.lproj/GormObjectOutlineView.gorm/objects.gorm
Binary file not shown.
5 changes: 4 additions & 1 deletion GormCore/GormDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -99,6 +99,9 @@
NSMutableSet *topLevelObjects;
NSMutableSet *visibleWindows;
NSMutableSet *deferredWindows;

// Controllers...
GormObjectViewController *objectViewController;
}

/* Handle notifications */
Expand Down
13 changes: 10 additions & 3 deletions GormCore/GormDocument.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#import "GormDocumentWindow.h"
#import "GormDocumentController.h"
#import "GormXLIFFDocument.h"
#import "GormObjectViewController.h"

@interface NSObject (GormNSCoding)
@end
Expand Down Expand Up @@ -368,6 +369,11 @@ - (void) awakeFromNib
[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];
Expand All @@ -376,7 +382,8 @@ - (void) awakeFromNib
NSViewHeightSizable|NSViewWidthSizable];
[scrollView setDocumentView: objectsView];
RELEASE(objectsView);

[objectViewController resetDisplayView: scrollView];

// images...
mainRect.origin = NSMakePoint(0,0);
imagesScrollView = [[NSScrollView alloc] initWithFrame: scrollRect];
Expand Down Expand Up @@ -417,7 +424,7 @@ - (void) awakeFromNib
/*
* 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];
Expand Down Expand Up @@ -952,7 +959,7 @@ - (void) changeToViewWithTag: (int)tag
{
case 0: // objects
{
[selectionBox setContentView: scrollView];
[selectionBox setContentView: [objectViewController view]]; //scrollView];
[toolbar setSelectedItemIdentifier: @"ObjectsItem"];
if (![[NSApp delegate] isConnecting])
[self setSelectionFromEditor: objectsView];
Expand Down
10 changes: 10 additions & 0 deletions GormCore/GormObjectViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
19 changes: 19 additions & 0 deletions GormCore/GormObjectViewController.m
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 00a9626

Please sign in to comment.