API  0.9.6
 All Classes Files Functions Variables Macros Modules Pages
CPAlert Class Reference

#import <CPAlert.h>

+ Inheritance diagram for CPAlert:

Instance Methods

(CPView- accessoryView
 
(void) - addButtonWithTitle:
 
(CPAlertStyle) - alertStyle
 
(void) - beginSheetModalForWindow:
 
(void) - beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:
 
(CPArray- buttons
 
(id) - delegate
 
(CPImage- icon
 
(CPString- informativeText
 
(id) - init
 
(void) - layout
 
(CPString- messageText
 
(void) - runModal
 
(void) - setAccessoryView:
 
(void) - setAlertStyle:
 
(void) - setDelegate:
 
(void) - setIcon:
 
(void) - setInformativeText:
 
(void) - setMessageText:
 
(void) - setShowsHelp:
 
(void) - setShowsSuppressionButton:
 
(void) - setTheme:
 
(void) - setTitle:
 
(void) - setValue:forThemeAttribute:
 
(void) - setValue:forThemeAttribute:inState:
 
(void) - setWindowStyle:
 
(BOOL) - showsHelp
 
(BOOL) - showsSuppressionButton
 
(CPCheckBox- suppressionButton
 
(CPTheme- theme
 
(_CPAlertThemeView) - themeView
 
(CPString- title
 
(CPWindow- window
 
(int) - windowStyle
 
- Instance Methods inherited from CPObject
(void) - addObserver:forKeyPath:options:context:
 
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - awakeFromCib
 
(void) - bind:toObject:withKeyPath:options:
 
(Class) - classForCoder
 
(Class) - classForKeyedArchiver
 
(CPString- className
 
(id) - copy
 
(void) - dealloc
 
(CPString- description
 
(CPDictionary- dictionaryWithValuesForKeys:
 
(void) - didChange:valuesAtIndexes:forKey:
 
(void) - didChangeValueForKey:
 
(void) - didChangeValueForKey:withSetMutation:usingObjects:
 
(void) - doesNotRecognizeSelector:
 
(CPArray- exposedBindings
 
(id) - forwardingTargetForSelector:
 
(void) - forwardInvocation:
 
(unsigned) - hash
 
(BOOL) - implementsSelector:
 
(CPDictionary- infoForBinding:
 
(BOOL) - isEqual:
 
(BOOL) - isKindOfClass:
 
(BOOL) - isMemberOfClass:
 
(BOOL) - isProxy
 
(IMP) - methodForSelector:
 
(CPMethodSignature) - methodSignatureForSelector:
 
(id) - mutableArrayValueForKey:
 
(id) - mutableArrayValueForKeyPath:
 
(id) - mutableCopy
 
(id) - mutableSetValueForKey:
 
(id) - mutableSetValueForKeyPath:
 
(id) - performSelector:
 
(id) - performSelector:withObject:
 
(id) - performSelector:withObject:withObject:
 
(id) - performSelector:withObjects:
 
(void) - release
 
(void) - removeObserver:forKeyPath:
 
(id) - replacementObjectForArchiver:
 
(id) - replacementObjectForCoder:
 
(id) - replacementObjectForKeyedArchiver:
 
(BOOL) - respondsToSelector:
 
(id) - retain
 
(id) - self
 
(void) - setValue:forKey:
 
(void) - setValue:forKeyPath:
 
(void) - setValue:forUndefinedKey:
 
(void) - setValuesForKeysWithDictionary:
 
(CPString- UID
 
(void) - unbind:
 
(Class) - valueClassForBinding:
 
(id) - valueForKey:
 
(id) - valueForKeyPath:
 
(id) - valueForUndefinedKey:
 
(void) - willChange:valuesAtIndexes:forKey:
 
(void) - willChangeValueForKey:
 
(void) - willChangeValueForKey:withSetMutation:usingObjects:
 

Class Methods

(CPAlert+ alertWithError:
 
(CPAlert+ alertWithMessageText:defaultButton:alternateButton:otherButton:informativeTextWithFormat:
 
- Class Methods inherited from CPObject
(BOOL) + accessInstanceVariablesDirectly
 
(id) + alloc
 
(id) + allocWithCoder:
 
(BOOL) + automaticallyNotifiesObserversForKey:
 
(Class) + class
 
(void) + exposeBinding:
 
(void) + initialize
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isSubclassOfClass:
 
(CPSet+ keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

Additional Inherited Members

- Instance Variables inherited from CPObject
Class isa
 

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
theAlertthe alert panel that the user dismissed
returnCodethe 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 2 of file CPAlert.h.

Method Documentation

- (CPView) accessoryView
implementation

Synthesized accessor method.

Provided by category CPAlert(CPSynthesizedAccessors).

Definition at line 814 of file CPAlert.j.

- (void) addButtonWithTitle: (CPString aTitle
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.

The first button will automatically be given a key equivalent of Return, and any button titled "Cancel" will be given a key equivalent of Escape.

You really shouldn't need more than 3 buttons.

Parameters
titlethe title of the button

Definition at line 316 of file CPAlert.j.

- (CPAlertStyle) alertStyle
implementation

Synthesized accessor method.

Provided by category CPAlert(CPSynthesizedAccessors).

Definition at line 782 of file CPAlert.j.

+ (CPAlert) alertWithError: (CPString anErrorMessage
implementation

Return an CPAlert with type error

Parameters
anErrorMessagethe message of the alert
Returns
fully initialized CPAlert

Definition at line 134 of file CPAlert.j.

+ (CPAlert) alertWithMessageText: (CPString aMessage
defaultButton: (CPString defaultButtonTitle
alternateButton: (CPString alternateButtonTitle
otherButton: (CPString otherButtonTitle
informativeTextWithFormat: (CPString informativeText 
implementation

Returns a CPAlert object with the provided info

Parameters
aMessagethe main body text of the alert
defaultButtonthe title of the default button
alternateButtonif not nil, the title of a second button
otherButtonif not nil, the title of the third button
informativeTextif not nil the informative text of the alert
Returns
fully initialized CPAlert

Definition at line 109 of file CPAlert.j.

- (void) beginSheetModalForWindow: (CPWindow aWindow
implementation

Runs the receiver modally as an alert sheet attached to a specified window.

Parameters
windowThe parent window for the sheet.

Definition at line 590 of file CPAlert.j.

- (void) beginSheetModalForWindow: (CPWindow aWindow
modalDelegate: (id)  modalDelegate
didEndSelector: (SEL)  alertDidEndSelector
contextInfo: (id)  contextInfo 
implementation

Runs the receiver modally as an alert sheet attached to a specified window.

Parameters
windowThe parent window for the sheet.
modalDelegateThe delegate for the modal-dialog session.
alertDidEndSelectorMessage the alert sends to modalDelegate after the sheet is dismissed.
contextInfoContextual data passed to modalDelegate in didEndSelector message.

Definition at line 569 of file CPAlert.j.

- (CPArray) buttons
implementation

Synthesized accessor method.

Provided by category CPAlert(CPSynthesizedAccessors).

Definition at line 846 of file CPAlert.j.

- (id) delegate
implementation

Synthesized accessor method.

Provided by category CPAlert(CPSynthesizedAccessors).

Definition at line 862 of file CPAlert.j.

- (CPImage) icon
implementation

Synthesized accessor method.

Provided by category CPAlert(CPSynthesizedAccessors).

Definition at line 830 of file CPAlert.j.

- (CPString) informativeText
implementation

return the content of the message text

Returns
CPString containing the message text

Definition at line 264 of file CPAlert.j.

- (id) init
implementation

Initializes a CPAlert panel with the default alert style CPWarningAlertStyle.

Reimplemented from CPObject.

Definition at line 147 of file CPAlert.j.

- (void) layout
implementation

Definition at line 490 of file CPAlert.j.

- (CPString) messageText
implementation

return the content of the message text

Returns
CPString containing the message text

Definition at line 243 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 549 of file CPAlert.j.

- (void) setAccessoryView: (CPView aView
implementation

set the accessory view

Parameters
aViewthe accessory view

Provided by category CPAlert(CPSynthesizedAccessors).

Definition at line 285 of file CPAlert.j.

- (void) setAlertStyle: (CPAlertStyle)  aValue
implementation

Synthesized accessor method.

Provided by category CPAlert(CPSynthesizedAccessors).

Definition at line 790 of file CPAlert.j.

- (void) setDelegate: (id)  aValue
implementation

Synthesized accessor method.

Provided by category CPAlert(CPSynthesizedAccessors).

Definition at line 870 of file CPAlert.j.

- (void) setIcon: (CPImage aValue
implementation

Synthesized accessor method.

Provided by category CPAlert(CPSynthesizedAccessors).

Definition at line 838 of file CPAlert.j.

- (void) setInformativeText: (CPString aText
implementation

set the text of the alert's informative text

Parameters
aTextCPString containing the informative text

Definition at line 253 of file CPAlert.j.

- (void) setMessageText: (CPString aText
implementation

set the text of the alert's message

Parameters
aTextCPString containing the text

Definition at line 233 of file CPAlert.j.

- (void) setShowsHelp: (BOOL)  aValue
implementation

Synthesized accessor method.

Provided by category CPAlert(CPSynthesizedAccessors).

Definition at line 758 of file CPAlert.j.

- (void) setShowsSuppressionButton: (BOOL)  shouldShowSuppressionButton
implementation

set if alert shows the suppression button

Parameters
shouldShowSuppressionButtonYES or NO

Provided by category CPAlert(CPSynthesizedAccessors).

Definition at line 296 of file CPAlert.j.

- (void) setTheme: (CPTheme aTheme
implementation

set the theme to use

Parameters
thetheme to use

Definition at line 185 of file CPAlert.j.

- (void) setTitle: (CPString aTitle
implementation

Sets the title of the alert window. This API is not present in Cocoa.

Parameters
aTitleCPString containing the window title

Provided by category CPAlert(CPSynthesizedAccessors).

Definition at line 274 of file CPAlert.j.

- (void) setValue: (id)  aValue
forThemeAttribute: (CPString aName 
implementation

Definition at line 200 of file CPAlert.j.

- (void) setValue: (id)  aValue
forThemeAttribute: (CPString aName
inState: (CPThemeState aState 
implementation

Definition at line 205 of file CPAlert.j.

- (void) setWindowStyle: (int)  aStyle
implementation
Deprecated:

Definition at line 213 of file CPAlert.j.

- (BOOL) showsHelp
implementation

Synthesized accessor method.

Provided by category CPAlert(CPSynthesizedAccessors).

Definition at line 750 of file CPAlert.j.

- (BOOL) showsSuppressionButton
implementation

Synthesized accessor method.

Provided by category CPAlert(CPSynthesizedAccessors).

Definition at line 766 of file CPAlert.j.

- (CPCheckBox) suppressionButton
implementation

Synthesized accessor method.

Provided by category CPAlert(CPSynthesizedAccessors).

Definition at line 854 of file CPAlert.j.

- (CPTheme) theme
implementation

Definition at line 175 of file CPAlert.j.

- (_CPAlertThemeView) themeView
implementation

Synthesized accessor method.

Provided by category CPAlert(CPSynthesizedAccessors).

Definition at line 878 of file CPAlert.j.

- (CPString) title
implementation

Synthesized accessor method.

Provided by category CPAlert(CPSynthesizedAccessors).

Definition at line 798 of file CPAlert.j.

- (CPWindow) window
implementation

Synthesized accessor method.

Provided by category CPAlert(CPSynthesizedAccessors).

Definition at line 886 of file CPAlert.j.

- (int) windowStyle
implementation
Deprecated:

Definition at line 221 of file CPAlert.j.


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