The GDDocument is the controller for a document-based cocoa application, this is the equivalent of GDApplicationController (but for document architecture). More...
#import <GDDocument.h>
Public Member Functions | |
| (void) | - lazyInitWithModel:mainMenu:modals:operations:windows:drawers:views:sounds:contexts: |
| Designated lazy initializer to provide values for all needed properties. | |
| (void) | - initDocument |
| A hook you should use to initialize your document's "gd" properties, and call [self lazyInitWithModel:mainMenu:modals:operations:windows:drawers:views:sounds:]. | |
| (void) | - initModel |
| A hook to initialize a GDModel. | |
| (void) | - initControllers |
| A hook to initializes any other controllers (maybe external nib controllers) your using - make sure they also get lazyInited as well. | |
| (void) | - initWindows |
| A hook to initialize any windows. | |
| (void) | - initViews |
| A hook to initialize any views - this is specifically for initializing views that don't have "gd" references from nib creation time. | |
| (void) | - startDocument |
| A hook to start your document - this is called after all initialization logic hooks. | |
| (void) | - windowControllerDidLoadNib: |
| This triggers the [self initDocument];. | |
| (void) | - windowDidBecomeMain: |
| When a window becomes main. | |
Protected Attributes | |
| BOOL | documentHasBeenActive |
| Whether or not this document has been active yet (loaded from nib). | |
| BOOL | awokeFromNib |
| Whether or not this application has awoken from a nib. | |
Properties | |
| id | model |
| A GDModel. | |
| id | operations |
| A GDOperationsController. | |
| id | mainMenu |
| A GDMainMenuController. | |
| id | modals |
| A GDModalController. | |
| id | sounds |
| A GDSoundController. | |
| IBOutlet id | views |
| A GDViewController. | |
| IBOutlet id | wins |
| A GDWindowController. | |
| IBOutlet id | drawers |
| A GDDrawerController. | |
| IBOutlet id | contexts |
| A GDContextMenuController. | |
The GDDocument is the controller for a document-based cocoa application, this is the equivalent of GDApplicationController (but for document architecture).
This class is also the NSWindowDelegate
| - (void) initDocument |
A hook you should use to initialize your document's "gd" properties, and call [self lazyInitWithModel:mainMenu:modals:operations:windows:drawers:views:sounds:].
You should call [super lazyInitWithModel(...)] as the last call.
This method calls the other initializers:
[self initModel]; [self initControllers]; [self initWindows]; [self initViews]; [self startDocument];
| - (void) initModel |
A hook to initialize a GDModel.
This is a good place to initialize A GDApplicationInfo instance and save it on the model.
| - (void) initViews |
A hook to initialize any views - this is specifically for initializing views that don't have "gd" references from nib creation time.
IE: calling lazyInitWithGD:
| - (void) lazyInitWithModel: | (id) | _model | ||
| mainMenu: | (id) | _mainMenu | ||
| modals: | (id) | _modals | ||
| operations: | (id) | _operations | ||
| windows: | (id) | _windows | ||
| drawers: | (id) | _drawers | ||
| views: | (id) | _views | ||
| sounds: | (id) | _sounds | ||
| contexts: | (id) | _contexts | ||
Designated lazy initializer to provide values for all needed properties.
nil's are ok.
All parameters are sent [obj performSelector:@selector(lazyInitWithGD:) withObject:self]
All parameters are retained, so please send in autoreleased instances.
If you send in any objects that are already properties (from IBOutlets) they are not retained, but they are sent the designated lazy initializer.
| _model | A GDModel or subclassed instance. | |
| _modals | A GDModalController or subclassed instance. | |
| _operations | A GDOperationsController or subclassed instance. | |
| _windows | A GDWindowController or subclassed instance. | |
| _drawers | A GDDrawerController or subclassed instance. | |
| _views | A GDViewController or subclassed instance. | |
| _sounds | A GDSoundController or subclassed instance. | |
| _contexts | A GDContextMenuController or subclassed instance. |
| - (void) windowDidBecomeMain: | (NSNotification *) | notification |
When a window becomes main.
This triggers a [mainMenu invalidate] call.
- (BOOL) documentHasBeenActive [protected] |
Whether or not this document has been active yet (loaded from nib).
This is used to stop mainMenu invalidation happening on first nib load.