CPAlert Class Reference
[AppKit]

List of all members.

Public Member Functions

(void) - addButtonWithTitle: [implementation]
(CPAlertStyle) - alertStyle [implementation]
(void) - delegate [implementation]
(id) - init [implementation]
(CPString- messageText [implementation]
(void) - runModal [implementation]
(void) - setAlertStyle: [implementation]
(void) - setDelegate: [implementation]
(void) - setMessageText: [implementation]
(void) - setTitle: [implementation]
(void) - setWindowStyle: [implementation]
(CPString- title [implementation]
(int) - windowStyle [implementation]

Static Public Member Functions

(void) + initialize [implementation]

Detailed Description

CPAlert is an alert panel that can be displayed modally to present the user with a message and one or more options.

It can be used to display an information message CPInformationalAlertStyle, a warning message CPWarningAlertStyle (the default), or a critical alert CPCriticalAlertStyle. In each case the user can be presented with one or more options by adding buttons using the -addButtonWithTitle: method.

The panel is displayed modally by calling -runModal and once the user has dismissed the panel, a message will be sent to the panel's delegate (if set), informing it which button was clicked (see delegate methods).

-(void)alertDidEnd:(CPAlert)theAlert returnCode:(int)returnCode; Called when the user dismisses the alert by clicking one of the buttons.

Parameters:
theAlert the alert panel that the user dismissed
returnCode the index of the button that the user clicked (starting from 0, representing the first button added to the alert which appears on the right, 1 representing the next button to the left and so on)

Definition at line 81 of file CPAlert.j.


Member Function Documentation

- (void) addButtonWithTitle: (CPString title   [implementation]

Adds a button with a given title to the receiver. Buttons will be added starting from the right hand side of the CPAlert panel. The first button will have the index 0, the second button 1 and so on.

You really shouldn't need more than 3 buttons.

Definition at line 257 of file CPAlert.j.

- (CPAlertStyle) alertStyle   [implementation]

Gets the alert style.

Definition at line 228 of file CPAlert.j.

- (void) delegate   [implementation]

Gets the receiver's delegate.

Definition at line 211 of file CPAlert.j.

- (id) init   [implementation]

Initializes a CPAlert panel with the default alert style CPWarningAlertStyle.

Definition at line 117 of file CPAlert.j.

+ (void) initialize   [implementation]

Definition at line 97 of file CPAlert.j.

- (CPString) messageText   [implementation]

Return's the receiver's message text body.

Definition at line 245 of file CPAlert.j.

- (void) runModal   [implementation]

Displays the CPAlert panel as a modal dialog. The user will not be able to interact with any other controls until s/he has dismissed the alert by clicking on one of the buttons.

Definition at line 284 of file CPAlert.j.

- (void) setAlertStyle: (CPAlertStyle)  style   [implementation]

Sets the alert style of the receiver.

Parameters:
style - Alert style for the alert.

Definition at line 220 of file CPAlert.j.

- (void) setDelegate: (id)  delegate   [implementation]

Sets the receiver’s delegate.

Parameters:
delegate - Delegate for the alert. nil removes the delegate.

Definition at line 203 of file CPAlert.j.

- (void) setMessageText: (CPString messageText   [implementation]

Set’s the receiver’s message text, or title, to a given text.

Parameters:
messageText - Message text for the alert.

Definition at line 237 of file CPAlert.j.

- (void) setTitle: (CPString aTitle   [implementation]

Sets the window's title. If this is not defined, a default title based on your warning level will be used.

Parameters:
aTitle the title to use in place of the default. Set to nil to use default.

Definition at line 178 of file CPAlert.j.

- (void) setWindowStyle: (int)  styleMask   [implementation]

Sets the window appearance.

Parameters:
styleMask - Either CPHUDBackgroundWindowMask or nil for standard.

Definition at line 135 of file CPAlert.j.

- (CPString) title   [implementation]

Gets the window's title.

Definition at line 186 of file CPAlert.j.

- (int) windowStyle   [implementation]

Gets the window's style.

Definition at line 194 of file CPAlert.j.


The documentation for this class was generated from the following file:

Generated on Fri Apr 9 11:04:20 2010 for Cappuccino API by  doxygen 1.6.1