CPMenuItem Class Reference
[AppKit]

List of all members.

Public Member Functions

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

Static Public Member Functions

(CPMenuItem+ separatorItem [implementation]


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 39 of file CPMenuItem.j.


Member Function Documentation

- (SEL) action   [implementation]

Returns the item's action.

Definition at line 203 of file CPMenuItem.j.

- (CPImage) alternateImage   [implementation]

Returns the menu item's alternate image

Definition at line 365 of file CPMenuItem.j.

- (void) encodeWithCoder: (CPCoder aCoder   [implementation]

Writes the menu item out to a coder.

Parameters:
aCoder the coder to write the menu item out to

Definition at line 833 of file CPMenuItem.j.

- (CPFont) font   [implementation]

Returns the menu item's font

Definition at line 262 of file CPMenuItem.j.

- (BOOL) hasSubmenu   [implementation]

Returns YES if the menu item has a submenu.

Definition at line 470 of file CPMenuItem.j.

- (CPImage) image   [implementation]

Returns the menu item's image

Definition at line 348 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 641 of file CPMenuItem.j.

- (id) initWithCoder: (CPCoder aCoder   [implementation]

Initializes the menu item from a coder.

Parameters:
aCoder the coder from which to initialize
Returns:
the initialized menu item

Definition at line 784 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:
aTitle the menu item's title
anAction the action that gets triggered when the item is selected
aKeyEquivalent the keyboard shortcut for the item
Returns:
the initialized menu item

Definition at line 86 of file CPMenuItem.j.

- (BOOL) isAlternate   [implementation]

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

Definition at line 618 of file CPMenuItem.j.

- (BOOL) isEnabled   [implementation]

Returns YES if the item is enabled.

Definition at line 129 of file CPMenuItem.j.

- (BOOL) isHidden   [implementation]

Returns YES if the item is hidden.

Definition at line 152 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 160 of file CPMenuItem.j.

- (BOOL) isHighlighted   [implementation]

Returns YES if the menu item is highlighted.

Definition at line 714 of file CPMenuItem.j.

- (BOOL) isSeparatorItem   [implementation]

Returns YES if the menu item is a separator.

Definition at line 488 of file CPMenuItem.j.

- (CPString) keyEquivalent   [implementation]

Returns the keyboard shortcut for this menu item

Definition at line 525 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 555 of file CPMenuItem.j.

- (CPMenu) menu   [implementation]

Returns the container menu of this item

Definition at line 506 of file CPMenuItem.j.

- (CPImage) mixedStateImage   [implementation]

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

Definition at line 430 of file CPMenuItem.j.

- (CPString) mnemonic   [implementation]

Returns the menu items mnemonic character

Definition at line 599 of file CPMenuItem.j.

- (unsigned) mnemonicLocation   [implementation]

Returns the index of the mnemonic character in the title.

Definition at line 574 of file CPMenuItem.j.

- (CPImage) offStateImage   [implementation]

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

Definition at line 408 of file CPMenuItem.j.

- (CPImage) onStateImage   [implementation]

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

Definition at line 387 of file CPMenuItem.j.

- (id) representedObject   [implementation]

Returns the item's represented object.

Definition at line 678 of file CPMenuItem.j.

+ (CPMenuItem) separatorItem   [implementation]

Returns a new menu item separator.

Definition at line 480 of file CPMenuItem.j.

- (void) setAction: (SEL)  anAction   [implementation]

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

Parameters:
anAction the action to send

Definition at line 195 of file CPMenuItem.j.

- (void) setAlternate: (BOOL)  isAlternate   [implementation]

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

Parameters:
isAlternate YES denotes that this menu item is an alternate

Definition at line 610 of file CPMenuItem.j.

- (void) setAlternateImage: (CPImage anImage   [implementation]

Sets the menu item's alternate image

Parameters:
anImage the menu item's alternate image

Definition at line 357 of file CPMenuItem.j.

- (void) setEnabled: (BOOL)  isEnabled   [implementation]

Sets whether the menu item is enabled or not

Parameters:
isEnabled YES enables the item. NO disables it.

Definition at line 114 of file CPMenuItem.j.

- (void) setFont: (CPFont aFont   [implementation]

Sets the font for the text of this menu item

Parameters:
aFont the font for the menu item

Definition at line 247 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:
isHidden YES hides the item. NO reveals it.

Definition at line 139 of file CPMenuItem.j.

- (void) setImage: (CPImage anImage   [implementation]

Sets the menu item's image

Parameters:
anImage the menu item's image

Definition at line 333 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:
aLevel the item's new indentation level
Exceptions:
CPInvalidArgumentException if aLevel is less than 0

Definition at line 630 of file CPMenuItem.j.

- (void) setKeyEquivalent: (CPString aString   [implementation]

Sets the keyboard shortcut for this menu item

Parameters:
aString the keyboard shortcut

Definition at line 517 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 540 of file CPMenuItem.j.

- (void) setMenu: (CPMenu aMenu   [implementation]

Set the container menu of this item.

Parameters:
aMenu the item's container menu

Definition at line 498 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:
anImage the image to show

Definition at line 417 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:
aLocation the index of the character in the title

Definition at line 566 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:
anImage the image to show

Definition at line 396 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:
anImage the image to show

Definition at line 375 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:
anObject the represented object

Definition at line 670 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 303 of file CPMenuItem.j.

- (void) setSubmenu: (CPMenu aMenu   [implementation]

Sets the submenu for this item

Parameters:
aMenu the submenu

Definition at line 440 of file CPMenuItem.j.

- (void) setTag: (int)  aTag   [implementation]

Sets the menu item's tag

Parameters:
aTag the tag for the item

Definition at line 282 of file CPMenuItem.j.

- (void) setTarget: (id)  aTarget   [implementation]

Sets the menu item's action target.

Parameters:
aTarget the target for the action

Definition at line 178 of file CPMenuItem.j.

- (void) setTextColor: (CPString aColor   [implementation]

Set's the item's text color

Definition at line 238 of file CPMenuItem.j.

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

Sets the item's title.

Parameters:
aTitle the item's new title

Definition at line 213 of file CPMenuItem.j.

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

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

Parameters:
aTitle the title string with a denoted mnemonic

Definition at line 583 of file CPMenuItem.j.

- (void) setToolTip: (CPString aToolTip   [implementation]

Sets the tooltip for the menu item.

Parameters:
aToolTip the tool tip for the item

Definition at line 651 of file CPMenuItem.j.

- (void) setView: (CPView aView   [implementation]

Sets the view for the menu item

Parameters:
aView the menu's item's view

Definition at line 689 of file CPMenuItem.j.

- (int) state   [implementation]

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

CPMixedState
CPOnState
CPOffState

Definition at line 323 of file CPMenuItem.j.

- (CPMenu) submenu   [implementation]

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

Definition at line 462 of file CPMenuItem.j.

- (int) tag   [implementation]

Returns the item's tag

Definition at line 290 of file CPMenuItem.j.

- (id) target   [implementation]

Returns the item's action target

Definition at line 186 of file CPMenuItem.j.

- (CPString) title   [implementation]

Returns the menu item's title.

Definition at line 230 of file CPMenuItem.j.

- (CPString) toolTip   [implementation]

Returns the item's tooltip

Definition at line 659 of file CPMenuItem.j.

- (CPView) view   [implementation]

Returns the menu item's view

Definition at line 704 of file CPMenuItem.j.


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

Generated on Wed May 20 12:44:01 2009 for Cappuccino by  doxygen 1.5.8