Public Member Functions | |
(void) | - abortModal [implementation] |
(void) | - activateIgnoringOtherApps: [implementation] |
(CPImage) | - applicationIconImage [implementation] |
(CPArray) | - arguments [implementation] |
(CPModalSession) | - beginModalSessionForWindow: [implementation] |
(void) | - beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: [implementation] |
(CPEvent) | - currentEvent [implementation] |
(void) | - deactivate [implementation] |
(id) | - delegate [implementation] |
(void) | - doCommandBySelector: [implementation] |
(void) | - endSheet: [implementation] |
(void) | - endSheet:returnCode: [implementation] |
(void) | - finishLaunching [implementation] |
(void) | - hide: [implementation] |
(void) | - hideOtherApplications: [implementation] |
(id) | - init [implementation] |
(void) | - isActive [implementation] |
(CPWindow) | - keyWindow [implementation] |
(CPMenu) | - mainMenu [implementation] |
(CPWindow) | - mainWindow [implementation] |
(CPWindow) | - modalWindow [implementation] |
(CPDictionary) | - namedArguments [implementation] |
(CPArray) | - orderedWindows [implementation] |
(void) | - orderFrontColorPanel: [implementation] |
(void) | - orderFrontStandardAboutPanel: [implementation] |
(void) | - orderFrontStandardAboutPanelWithOptions: [implementation] |
(void) | - replyToApplicationShouldTerminate: [implementation] |
(void) | - run [implementation] |
(void) | - runModalForWindow: [implementation] |
(void) | - runModalSession: [implementation] |
(BOOL) | - sendAction:to:from: [implementation] |
(void) | - sendEvent: [implementation] |
(void) | - setApplicationIconImage: [implementation] |
(void) | - setArguments: [implementation] |
(void) | - setCallback:forNextEventMatchingMask:untilDate:inMode:dequeue: [implementation] |
(void) | - setDelegate: [implementation] |
(void) | - setMainMenu: [implementation] |
(CPEvent) | - setTarget:selector:forNextEventMatchingMask:untilDate:inMode:dequeue: [implementation] |
(void) | - stopModal [implementation] |
(void) | - stopModalWithCode: [implementation] |
(id) | - targetForAction: [implementation] |
(id) | - targetForAction:to:from: [implementation] |
(void) | - terminate: [implementation] |
(BOOL) | - tryToPerform:with: [implementation] |
(CPArray) | - windows [implementation] |
(CPWindow) | - windowWithWindowNumber: [implementation] |
Static Public Member Functions | |
(CPString) | + defaultThemeName [implementation] |
(CPApplication) | + sharedApplication [implementation] |
CPApplication is THE way to start up the Cappucino framework for your application to use. Every GUI application has exactly one instance of CPApplication (or of a custom subclass of CPApplication). Your program's main() function can create that instance by calling the CPApplicationMain
function. A simple example looks like this:
function main(args, namedArgs) { CPApplicationMain(args, namedArgs); }
-(void)applicationDidFinishLaunching:(CPNotification)aNotification; Sent from the notification center after the app initializes, but before receiving events.
aNotification | contains information about the event |
-(void)applicationWillFinishLaunching:(CPNotification)aNotification; Sent from the notification center before the app is initialized.
aNotification | contains information about the event |
Definition at line 81 of file CPApplication.j.
- (void) abortModal | [implementation] |
Aborts the event loop started by -runModalForWindow
:
Definition at line 569 of file CPApplication.j.
- (void) activateIgnoringOtherApps: | (BOOL) | shouldIgnoreOtherApps | [implementation] |
Definition at line 475 of file CPApplication.j.
- (CPImage) applicationIconImage | [implementation] |
Definition at line 389 of file CPApplication.j.
- (CPArray) arguments | [implementation] |
Definition at line 973 of file CPApplication.j.
- (CPModalSession) beginModalSessionForWindow: | (CPWindow) | aWindow | [implementation] |
Sets up a modal session with theWindow
.
aWindow | the window to set up the modal session for |
Definition at line 578 of file CPApplication.j.
- (void) beginSheet: | (CPWindow) | aSheet | ||
modalForWindow: | (CPWindow) | aWindow | ||
modalDelegate: | (id) | aModalDelegate | ||
didEndSelector: | (SEL) | aDidEndSelector | ||
contextInfo: | (id) | aContextInfo | ||
[implementation] |
Displays a window as a sheet.
aSheet | the window to display as a sheet | |
aWindow | the window that will hold the sheet as a child | |
aModalDelegate | ||
aDidEndSelector | ||
aContextInfo |
Definition at line 937 of file CPApplication.j.
- (CPEvent) currentEvent | [implementation] |
Definition at line 922 of file CPApplication.j.
- (void) deactivate | [implementation] |
Definition at line 485 of file CPApplication.j.
+ (CPString) defaultThemeName | [implementation] |
Definition at line 1102 of file CPApplication.j.
- (id) delegate | [implementation] |
Returns the application's delegate. The app can only have one delegate at a time.
Definition at line 299 of file CPApplication.j.
- (void) doCommandBySelector: | (SEL) | aSelector | [implementation] |
Definition at line 662 of file CPApplication.j.
- (void) endSheet: | (CPWindow) | sheet | [implementation] |
Definition at line 968 of file CPApplication.j.
- (void) endSheet: | (CPWindow) | sheet | ||
returnCode: | (int) | returnCode | ||
[implementation] |
Definition at line 950 of file CPApplication.j.
- (void) finishLaunching | [implementation] |
This method is called by -run
before the event loop begins. When it successfully completes, it posts the notification CPApplicationDidFinishLaunchingNotification. If you override -finishLaunching
, the subclass method should invoke the superclass method.
Definition at line 310 of file CPApplication.j.
- (void) hide: | (id) | aSender | [implementation] |
Definition at line 710 of file CPApplication.j.
- (void) hideOtherApplications: | (id) | aSender | [implementation] |
Definition at line 500 of file CPApplication.j.
- (id) init | [implementation] |
Initializes the Document based application with basic menu functions. Functions are New
, Open
, Undo
, Redo
, Save
, Cut
, Copy
, Paste
.
Definition at line 130 of file CPApplication.j.
- (void) isActive | [implementation] |
Definition at line 495 of file CPApplication.j.
- (CPWindow) keyWindow | [implementation] |
Returns the key window.
Definition at line 673 of file CPApplication.j.
- (CPMenu) mainMenu | [implementation] |
Returns the application's main menu
Definition at line 719 of file CPApplication.j.
- (CPWindow) mainWindow | [implementation] |
Returns the main window.
Definition at line 681 of file CPApplication.j.
- (CPWindow) modalWindow | [implementation] |
Returns the window for the current modal session. If there is no modal session, it returns nil
.
Definition at line 606 of file CPApplication.j.
- (CPDictionary) namedArguments | [implementation] |
Definition at line 1022 of file CPApplication.j.
- (CPArray) orderedWindows | [implementation] |
Returns an array of visible CPWindow objects, ordered by their front to back order on the screen.
Definition at line 705 of file CPApplication.j.
- (void) orderFrontColorPanel: | (id) | aSender | [implementation] |
Definition at line 744 of file CPApplication.j.
- (void) orderFrontStandardAboutPanel: | (id) | sender | [implementation] |
Definition at line 401 of file CPApplication.j.
- (void) orderFrontStandardAboutPanelWithOptions: | (CPDictionary) | options | [implementation] |
Definition at line 406 of file CPApplication.j.
- (void) replyToApplicationShouldTerminate: | (BOOL) | terminate | [implementation] |
Definition at line 466 of file CPApplication.j.
- (void) run | [implementation] |
Calls -finishLaunching
method which results in starting the main event loop.
Definition at line 509 of file CPApplication.j.
- (void) runModalForWindow: | (CPWindow) | aWindow | [implementation] |
Starts a modal event loop for aWindow
aWindow | the window to start the event loop for |
Definition at line 519 of file CPApplication.j.
- (void) runModalSession: | (CPModalSession) | aModalSession | [implementation] |
Runs a modal session
CPModalSession | the session to run |
Definition at line 587 of file CPApplication.j.
- (BOOL) sendAction: | (SEL) | anAction | ||
to: | (id) | aTarget | ||
from: | (id) | aSender | ||
[implementation] |
Sends an action to a target.
anAction | the action to send | |
aTarget | the target for the action | |
aSender | the action sender |
YES
Definition at line 784 of file CPApplication.j.
- (void) sendEvent: | (CPEvent) | anEvent | [implementation] |
Dispatches events to other objects.
anEvent | the event to dispatch |
Definition at line 625 of file CPApplication.j.
- (void) setApplicationIconImage: | (CPImage) | anImage | [implementation] |
Definition at line 384 of file CPApplication.j.
- (void) setArguments: | (CPArray) | args | [implementation] |
Definition at line 981 of file CPApplication.j.
- (void) setCallback: | (Function) | aCallback | ||
forNextEventMatchingMask: | (unsigned int) | aMask | ||
untilDate: | (CPDate) | anExpiration | ||
inMode: | (CPString) | aMode | ||
dequeue: | (BOOL) | shouldDequeue | ||
[implementation] |
Definition at line 912 of file CPApplication.j.
- (void) setDelegate: | (id) | aDelegate | [implementation] |
Sets the delegate for this application. The delegate will receive various notifications caused by user interactions during the application's run. The delegate can choose to react to these events.
aDelegate | the delegate object |
Definition at line 211 of file CPApplication.j.
- (void) setMainMenu: | (CPMenu) | aMenu | [implementation] |
Sets the main menu for the application
aMenu | the menu to set for the application |
Definition at line 728 of file CPApplication.j.
- (CPEvent) setTarget: | (id) | aTarget | ||
selector: | (SEL) | aSelector | ||
forNextEventMatchingMask: | (unsigned int) | aMask | ||
untilDate: | (CPDate) | anExpiration | ||
inMode: | (CPString) | aMode | ||
dequeue: | (BOOL) | shouldDequeue | ||
[implementation] |
Definition at line 917 of file CPApplication.j.
+ (CPApplication) sharedApplication | [implementation] |
Returns the singleton instance of the running application. If it doesn't exist, it will be created, and then returned.
Definition at line 117 of file CPApplication.j.
- (void) stopModal | [implementation] |
Stops the modal event loop
Definition at line 561 of file CPApplication.j.
- (void) stopModalWithCode: | (int) | aCode | [implementation] |
Stops the event loop started by -runModalForWindow
: and sets the code that -runModalForWindow
: will return.
aCode | the return code for the modal event |
Definition at line 529 of file CPApplication.j.
- (id) targetForAction: | (SEL) | anAction | [implementation] |
Looks for a target that can handle the specified action. Checks for a target in the following order:
anAction | the action to handle |
nil
if no match could be found Definition at line 885 of file CPApplication.j.
- (id) targetForAction: | (SEL) | anAction | ||
to: | (id) | aTarget | ||
from: | (id) | aSender | ||
[implementation] |
Finds a target for the specified action. If the action is nil
, returns nil
. If the target is not nil
, aTarget
is returned. Otherwise, it calls -targetForAction
: to search for a target.
anAction | the action to find a target for | |
aTarget | if not nil , this will be returned not used |
Definition at line 807 of file CPApplication.j.
- (void) terminate: | (id) | aSender | [implementation] |
Definition at line 370 of file CPApplication.j.
- (BOOL) tryToPerform: | (SEL) | anAction | ||
with: | (id) | anObject | ||
[implementation] |
Tries to perform the action with an argument. Performs the action on itself (if it responds to it), then tries to perform the action on the delegate.
anAction | the action to perform. | |
anObject | the argument for the action method |
YES
if the action was performed Definition at line 759 of file CPApplication.j.
- (CPArray) windows | [implementation] |
Returns an array of the application's CPWindows
Definition at line 697 of file CPApplication.j.
- (CPWindow) windowWithWindowNumber: | (int) | aWindowNumber | [implementation] |
Returns the CPWindow object corresponding to aWindowNumber
.
Definition at line 689 of file CPApplication.j.