CPObjectCPResponder
CPWindowController
@implementation CPWindowController : CPResponder
An instance of a CPWindowController
manages a CPWindow
. It has methods
that get called when the window is loading, and after the window has loaded. In the
Model-View-Controller method of program design, the CPWindowController
would be
considered the 'Controller' and the CPWindow
the 'Model.'
Method Summary | |
---|---|
-(id) | initWithWindow:(CPWindow)aWindow Initializes the controller with a window. |
-(id) | initWithWindowCibName:(CPString)aWindowCibName Initializes the controller with a Capppuccino Interface Builder name. |
-(id) | initWithWindowCibName:(CPString)aWindowCibName owner:(id)anOwner Initializes the controller with a cafe name. |
-(CPDocument) | document Returns the document in the controlled window. |
-(BOOL) | isWindowLoaded Returns YES if the window has been loaded. |
-(void) | loadWindow Loads the window. |
-(void) | setDocument:(CPDocument)aDocument Sets the document that is inside the controlled window. |
-(void) | setDocumentEdited:(BOOL)isEdited Sets whether the document has unsaved changes. |
-(void) | setWindow:(CPWindow)aWindow Sets the window to be controlled. |
-(CFAction) | showWindow:(id)aSender Shows the window. |
-(void) | synchronizeWindowTitleWithDocumentName Sets the title of the window as the name of the document. |
-(CPWindow) | window Returns the window this object controls. |
-(void) | windowDidLoad The method notifies the controller that it's window has loaded. |
-(CPString) | windowTitleForDocumentDisplayName:(CPString)aDisplayName Returns the window title based on the document's name. |
-(void) | windowWillLoad The method notifies the controller that it's window is about to load. |
Method Detail |
---|
-(id)initWithWindow:(CPWindow)aWindow
aWindow
- the window to control-(id)initWithWindowCibName:(CPString)aWindowCibName
aWindowCibName
- the cib name of the window to control-(id)initWithWindowCibName:(CPString)aWindowCibName owner:(id)anOwner
aWindowCibName
- the cib name of the window to controlanOwner
- the owner of the cib file-(CPDocument)document
-(BOOL)isWindowLoaded
YES
if the window has been loaded. Specifically,
if loadWindow
has been called.-(void)loadWindow
-(void)setDocument:(CPDocument)aDocument
aDocument
- the document in the controlled window-(void)setDocumentEdited:(BOOL)isEdited
isEdited
- YES
means the document has unsaved changes.-(void)setWindow:(CPWindow)aWindow
aWindow
- the new window to control-(CFAction)showWindow:(id)aSender
aSender
- the object requesting the show-(void)synchronizeWindowTitleWithDocumentName
-(CPWindow)window
-(void)windowDidLoad
-(CPString)windowTitleForDocumentDisplayName:(CPString)aDisplayName
aDisplayName
- the document's filename-(void)windowWillLoad
Created on Sat Sep 13 14:15:43 PDT 2008