mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
Got containing view working for outline/icon view of objects
This commit is contained in:
parent
07d7b65a27
commit
00a962677a
5 changed files with 43 additions and 4 deletions
Binary file not shown.
|
@ -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 */
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue