CPAlert Class Reference
[AppKit]

List of all members.

Public Member Functions

(id) - init [implementation]
(void) - setWindowStyle: [implementation]
(void) - setTitle: [implementation]
(CPString- title [implementation]
(int) - windowStyle [implementation]
(void) - setDelegate: [implementation]
(void) - delegate [implementation]
(void) - setAlertStyle: [implementation]
(CPAlertStyle) - alertStyle [implementation]
(void) - setMessageText: [implementation]
(CPString- messageText [implementation]
(void) - addButtonWithTitle: [implementation]
(void) - runModal [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
- which is 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 252 of file CPAlert.j.

- (CPAlertStyle) alertStyle   [implementation]

Gets the alert style.

Definition at line 223 of file CPAlert.j.

- (void) delegate   [implementation]

Gets the receiver's delegate.

Definition at line 206 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 240 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 276 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 215 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 198 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 232 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 173 of file CPAlert.j.

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

Sets the window appearance.

Parameters:
styleMask - Either CPHUDBackgroundWindowMask or nil for standard.

Definition at line 144 of file CPAlert.j.

- (CPString) title   [implementation]

Gets the window's title.

Definition at line 181 of file CPAlert.j.

- (int) windowStyle   [implementation]

Gets the window's style.

Definition at line 189 of file CPAlert.j.


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

Generated on Wed May 20 12:43:59 2009 for Cappuccino by  doxygen 1.5.8