Class CPWindowController

CPObject
    extended byCPResponder
        extended byCPWindowController

@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.

Methods inherited from class CPObject
initialize, alloc, class, instanceMethodForSelector, instancesRespondToSelector, isSubclassOfClass, load, new, setVersion, superclass, version, init, autorelease, awakeAfterUsingCoder, class, classForCoder, classForKeyedArchiver, className, copy, dealloc, description, doesNotRecognizeSelector, forwardInvocation, hash, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableCopy, performSelector, performSelector, performSelector, release, replacementObjectForArchiver, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, retain, self, superclass

Methods inherited from class CPResponder
acceptsFirstResponder, becomeFirstResponder, deleteBackward, doCommandBySelector, insertLineBreak, insertText, interpretKeyEvents, keyDown, keyUp, menu, mouseDown, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseUp, nextResponder, noResponderFor, performKeyEquivalent, resignFirstResponder, scrollWheel, setMenu, setNextResponder, tryToPerform, undoManager


Method Detail

initWithWindow

-(id)initWithWindow:(CPWindow)aWindow
Initializes the controller with a window.
Parameters:
aWindow - the window to control
Returns:
the initialzed window controller

initWithWindowCibName

-(id)initWithWindowCibName:(CPString)aWindowCibName
Initializes the controller with a Capppuccino Interface Builder name.
Parameters:
aWindowCibName - the cib name of the window to control
Returns:
the initialized window controller

initWithWindowCibName

-(id)initWithWindowCibName:(CPString)aWindowCibName owner:(id)anOwner
Initializes the controller with a cafe name.
Parameters:
aWindowCibName - the cib name of the window to control
anOwner - the owner of the cib file
Returns:
the initialized window controller

document

-(CPDocument)document
Returns the document in the controlled window.

isWindowLoaded

-(BOOL)isWindowLoaded
Returns YES if the window has been loaded. Specifically, if loadWindow has been called.

loadWindow

-(void)loadWindow
Loads the window

setDocument

-(void)setDocument:(CPDocument)aDocument
Sets the document that is inside the controlled window.
Parameters:
aDocument - the document in the controlled window

setDocumentEdited

-(void)setDocumentEdited:(BOOL)isEdited
Sets whether the document has unsaved changes. The window can use this as a hint to
Parameters:
isEdited - YES means the document has unsaved changes.

setWindow

-(void)setWindow:(CPWindow)aWindow
Sets the window to be controlled.
Parameters:
aWindow - the new window to control

showWindow

-(CFAction)showWindow:(id)aSender
Shows the window.
Parameters:
aSender - the object requesting the show

synchronizeWindowTitleWithDocumentName

-(void)synchronizeWindowTitleWithDocumentName
Sets the title of the window as the name of the document.

window

-(CPWindow)window
Returns the window this object controls.

windowDidLoad

-(void)windowDidLoad
The method notifies the controller that it's window has loaded.

windowTitleForDocumentDisplayName

-(CPString)windowTitleForDocumentDisplayName:(CPString)aDisplayName
Returns the window title based on the document's name.
Parameters:
aDisplayName - the document's filename

windowWillLoad

-(void)windowWillLoad
The method notifies the controller that it's window is about to load.

Created on Sat Sep 13 14:15:43 PDT 2008