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

#import <CPMenuItem.h>

+ Inheritance diagram for CPMenuItem:

Instance Methods

(SEL) - action
 
(CPImage- alternateImage
 
(id) - copy
 
(CPString- description
 
(void) - encodeWithCoder:
 
(CPFont- font
 
(BOOL) - hasSubmenu
 
(CPImage- image
 
(unsigned) - indentationLevel
 
(id) - init
 
(id) - initWithCoder:
 
(id) - initWithTitle:action:keyEquivalent:
 
(BOOL) - isAlternate
 
(BOOL) - isEnabled
 
(BOOL) - isHidden
 
(BOOL) - isHiddenOrHasHiddenAncestor
 
(BOOL) - isHighlighted
 
(BOOL) - isSeparatorItem
 
(CPString- keyEquivalent
 
(unsigned) - keyEquivalentModifierMask
 
(CPString- keyEquivalentStringRepresentation
 
(CPMenu- menu
 
(CPImage- mixedStateImage
 
(CPString- mnemonic
 
(unsigned) - mnemonicLocation
 
(id) - mutableCopy
 
(CPImage- offStateImage
 
(CPImage- onStateImage
 
(id) - representedObject
 
(void) - setAction:
 
(void) - setAlternate:
 
(void) - setAlternateImage:
 
(void) - setEnabled:
 
(void) - setFont:
 
(void) - setHidden:
 
(void) - setImage:
 
(void) - setIndentationLevel:
 
(void) - setKeyEquivalent:
 
(void) - setKeyEquivalentModifierMask:
 
(void) - setMenu:
 
(void) - setMixedStateImage:
 
(void) - setMnemonicLocation:
 
(void) - setOffStateImage:
 
(void) - setOnStateImage:
 
(void) - setRepresentedObject:
 
(void) - setState:
 
(void) - setSubmenu:
 
(void) - setTag:
 
(void) - setTarget:
 
(void) - setTextColor:
 
(void) - setTitle:
 
(void) - setTitleWithMnemonicLocation:
 
(void) - setToolTip:
 
(void) - setView:
 
(int) - state
 
(CPMenu- submenu
 
(int) - tag
 
(id) - target
 
(CPString- title
 
(CPString- toolTip
 
(CPView- view
 
- 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
 
(void) - dealloc
 
(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) - 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

(CPMenuItem+ separatorItem
 
- 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

A CPMenuItem is added to a CPMenu. It has an action and a target for that action to be sent to whenever the item is 'activated'.

Definition at line 2 of file CPMenuItem.h.

Method Documentation

- (SEL) action
implementation

Returns the item's action.

Definition at line 231 of file CPMenuItem.j.

- (CPImage) alternateImage
implementation

Returns the menu item's alternate image

Definition at line 393 of file CPMenuItem.j.

- (id) copy
implementation

Returns a copy of the item. The copy does not belong If the item has a submenu, it is NOT copied.

Reimplemented from CPObject.

Definition at line 810 of file CPMenuItem.j.

- (CPString) description
implementation

Returns a human readable string describing the receiver

Reimplemented from CPObject.

Definition at line 869 of file CPMenuItem.j.

- (void) encodeWithCoder: (CPCoder aCoder
implementation

Writes the menu item out to a coder.

Parameters
aCoderthe coder to write the menu item out to

Provided by category CPMenuItem(CPCoding).

Definition at line 964 of file CPMenuItem.j.

- (CPFont) font
implementation

Returns the menu item's font

Definition at line 290 of file CPMenuItem.j.

- (BOOL) hasSubmenu
implementation

Returns YES if the menu item has a submenu.

Definition at line 511 of file CPMenuItem.j.

- (CPImage) image
implementation

Returns the menu item's image

Definition at line 376 of file CPMenuItem.j.

- (unsigned) indentationLevel
implementation

Returns the menu item's indentation level. This is a value between 0 and 15 (inclusive).

Definition at line 727 of file CPMenuItem.j.

- (id) init
implementation

Initializes the receiver

Returns
the initialized receiver

Reimplemented from CPObject.

Definition at line 97 of file CPMenuItem.j.

- (id) initWithCoder: (CPCoder aCoder
implementation

Initializes the menu item from a coder.

Parameters
aCoderthe coder from which to initialize
Returns
the initialized menu item

Provided by category CPMenuItem(CPCoding).

Definition at line 911 of file CPMenuItem.j.

- (id) initWithTitle: (CPString aTitle
action: (SEL)  anAction
keyEquivalent: (CPString aKeyEquivalent 
implementation

Initializes the menu item with a title, action, and keyboard equivalent.

Parameters
aTitlethe menu item's title
anActionthe action that gets triggered when the item is selected
aKeyEquivalentthe keyboard shortcut for the item
Returns
the initialized menu item

Definition at line 109 of file CPMenuItem.j.

- (BOOL) isAlternate
implementation

Returns YES if the menu item is an alternate for the previous item.

Definition at line 704 of file CPMenuItem.j.

- (BOOL) isEnabled
implementation

Returns YES if the item is enabled.

Definition at line 157 of file CPMenuItem.j.

- (BOOL) isHidden
implementation

Returns YES if the item is hidden.

Definition at line 180 of file CPMenuItem.j.

- (BOOL) isHiddenOrHasHiddenAncestor
implementation

Returns YES if the item is hidden or if one of it's supermenus is hidden.

Definition at line 188 of file CPMenuItem.j.

- (BOOL) isHighlighted
implementation

Returns YES if the menu item is highlighted.

Definition at line 800 of file CPMenuItem.j.

- (BOOL) isSeparatorItem
implementation

Returns YES if the menu item is a separator.

Definition at line 533 of file CPMenuItem.j.

- (CPString) keyEquivalent
implementation

Returns the keyboard shortcut for this menu item

Definition at line 570 of file CPMenuItem.j.

- (unsigned) keyEquivalentModifierMask
implementation

Returns the item's keyboard shortcut modifier mask. Can be a combination of:

CPShiftKeyMask
CPAlternateKeyMask
CPCommandKeyMask
CPControlKeyMask

Definition at line 600 of file CPMenuItem.j.

- (CPString) keyEquivalentStringRepresentation
implementation

Definition at line 605 of file CPMenuItem.j.

- (CPMenu) menu
implementation

Returns the container menu of this item

Definition at line 551 of file CPMenuItem.j.

- (CPImage) mixedStateImage
implementation

Returns the image shown when the menu item is in the 'mixed' state.

Definition at line 458 of file CPMenuItem.j.

- (CPString) mnemonic
implementation

Returns the menu items mnemonic character

Definition at line 685 of file CPMenuItem.j.

- (unsigned) mnemonicLocation
implementation

Returns the index of the mnemonic character in the title.

Definition at line 660 of file CPMenuItem.j.

- (id) mutableCopy
implementation

Creates a deep mutable copy of the receiver.

Returns
the mutable copy of the receiver

Reimplemented from CPObject.

Definition at line 841 of file CPMenuItem.j.

- (CPImage) offStateImage
implementation

Returns the image shown when the menu item is in the 'off' state.

Definition at line 436 of file CPMenuItem.j.

- (CPImage) onStateImage
implementation

Returns the image shown when the menu item is in the 'on' state.

Definition at line 415 of file CPMenuItem.j.

- (id) representedObject
implementation

Returns the item's represented object.

Definition at line 764 of file CPMenuItem.j.

+ (CPMenuItem) separatorItem
implementation

Returns a new menu item separator.

Definition at line 521 of file CPMenuItem.j.

- (void) setAction: (SEL)  anAction
implementation

Sets the action that gets sent to the item's target when triggered.

Parameters
anActionthe action to send

Definition at line 223 of file CPMenuItem.j.

- (void) setAlternate: (BOOL)  isAlternate
implementation

Sets whether this item is an alternate for the previous menu item.

Parameters
isAlternateYES denotes that this menu item is an alternate

Definition at line 696 of file CPMenuItem.j.

- (void) setAlternateImage: (CPImage anImage
implementation

Sets the menu item's alternate image

Parameters
anImagethe menu item's alternate image

Definition at line 385 of file CPMenuItem.j.

- (void) setEnabled: (BOOL)  isEnabled
implementation

Sets whether the menu item is enabled or not

Parameters
isEnabledYES enables the item. NO disables it.

Definition at line 143 of file CPMenuItem.j.

- (void) setFont: (CPFont aFont
implementation

Sets the font for the text of this menu item

Parameters
aFontthe font for the menu item

Definition at line 275 of file CPMenuItem.j.

- (void) setHidden: (BOOL)  isHidden
implementation

Sets whether the item should be hidden. A hidden item can not be triggered by keyboard shortcuts.

Parameters
isHiddenYES hides the item. NO reveals it.

Definition at line 167 of file CPMenuItem.j.

- (void) setImage: (CPImage anImage
implementation

Sets the menu item's image

Parameters
anImagethe menu item's image

Definition at line 361 of file CPMenuItem.j.

- (void) setIndentationLevel: (unsigned)  aLevel
implementation

Sets the indentation level of the menu item. Must be a value between 0 and 15 (inclusive).

Parameters
aLevelthe item's new indentation level
Exceptions
CPInvalidArgumentExceptionif aLevel is less than 0

Definition at line 716 of file CPMenuItem.j.

- (void) setKeyEquivalent: (CPString aString
implementation

Sets the keyboard shortcut for this menu item

Parameters
aStringthe keyboard shortcut

Definition at line 562 of file CPMenuItem.j.

- (void) setKeyEquivalentModifierMask: (unsigned)  aMask
implementation

Sets the modifier mask used for the item's keyboard shortcut. Can be a combination of:

CPShiftKeyMask
CPAlternateKeyMask
CPCommandKeyMask
CPControlKeyMask

Definition at line 585 of file CPMenuItem.j.

- (void) setMenu: (CPMenu aMenu
implementation

Set the container menu of this item.

Parameters
aMenuthe item's container menu

Definition at line 543 of file CPMenuItem.j.

- (void) setMixedStateImage: (CPImage anImage
implementation

Sets the image that is shown when the menu item is in the 'mixed' state.

Parameters
anImagethe image to show

Definition at line 445 of file CPMenuItem.j.

- (void) setMnemonicLocation: (unsigned)  aLocation
implementation

Sets the index of the mnemonic character in the title. The character will be underlined and is used as a shortcut for navigation.

Parameters
aLocationthe index of the character in the title

Definition at line 652 of file CPMenuItem.j.

- (void) setOffStateImage: (CPImage anImage
implementation

Sets the image that is shown when the menu item is in the 'off' state.

Parameters
anImagethe image to show

Definition at line 424 of file CPMenuItem.j.

- (void) setOnStateImage: (CPImage anImage
implementation

Sets the image that is shown when the menu item is in the 'on' state.

Parameters
anImagethe image to show

Definition at line 403 of file CPMenuItem.j.

- (void) setRepresentedObject: (id)  anObject
implementation

Sets the menu item's represented object. This is a kind of tag for the developer. Not a UI feature.

Parameters
anObjectthe represented object

Definition at line 756 of file CPMenuItem.j.

- (void) setState: (int)  aState
implementation

Sets the state of the menu item. Possible states are:

CPMixedState
CPOnState
CPOffState

Definition at line 331 of file CPMenuItem.j.

- (void) setSubmenu: (CPMenu aMenu
implementation

Sets the submenu for this item

Parameters
aMenuthe submenu

Definition at line 468 of file CPMenuItem.j.

- (void) setTag: (int)  aTag
implementation

Sets the menu item's tag

Parameters
aTagthe tag for the item

Definition at line 310 of file CPMenuItem.j.

- (void) setTarget: (id)  aTarget
implementation

Sets the menu item's action target.

Parameters
aTargetthe target for the action

Definition at line 206 of file CPMenuItem.j.

- (void) setTextColor: (CPString aColor
implementation

Set's the item's text color

Definition at line 266 of file CPMenuItem.j.

- (void) setTitle: (CPString aTitle
implementation

Sets the item's title.

Parameters
aTitlethe item's new title

Definition at line 241 of file CPMenuItem.j.

- (void) setTitleWithMnemonicLocation: (CPString aTitle
implementation

Sets the title of the menu item and the mnemonic character. The mnemonic character should be preceded by an '&'.

Parameters
aTitlethe title string with a denoted mnemonic

Definition at line 669 of file CPMenuItem.j.

- (void) setToolTip: (CPString aToolTip
implementation

Sets the tooltip for the menu item.

Parameters
aToolTipthe tool tip for the item

Definition at line 737 of file CPMenuItem.j.

- (void) setView: (CPView aView
implementation

Sets the view for the menu item

Parameters
aViewthe menu's item's view

Definition at line 775 of file CPMenuItem.j.

- (int) state
implementation

Returns the menu item's current state. Possible states are:

CPMixedState
CPOnState
CPOffState

Definition at line 351 of file CPMenuItem.j.

- (CPMenu) submenu
implementation

Returns the submenu of the item. nil if there is no submenu.

Definition at line 503 of file CPMenuItem.j.

- (int) tag
implementation

Returns the item's tag

Definition at line 318 of file CPMenuItem.j.

- (id) target
implementation

Returns the item's action target

Definition at line 214 of file CPMenuItem.j.

- (CPString) title
implementation

Returns the menu item's title.

Definition at line 258 of file CPMenuItem.j.

- (CPString) toolTip
implementation

Returns the item's tooltip

Definition at line 745 of file CPMenuItem.j.

- (CPView) view
implementation

Returns the menu item's view

Definition at line 790 of file CPMenuItem.j.


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