API 0.9.5
CPMenuItem Class Reference

#import <CPMenuItem.h>

Inheritance diagram for CPMenuItem:

List of all members.

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

Class Methods

(CPMenuItem+ separatorItem

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

Returns the item's action.

Definition at line 231 of file CPMenuItem.j.

- (CPImage) alternateImage

Returns the menu item's alternate image

Definition at line 393 of file CPMenuItem.j.

- (id) copy

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

Definition at line 810 of file CPMenuItem.j.

- (CPString) description

Definition at line 869 of file CPMenuItem.j.

- (void) encodeWithCoder: (CPCoder aCoder

Writes the menu item out to a coder.

Parameters:
aCoderthe coder to write the menu item out to

Definition at line 965 of file CPMenuItem.j.

- (CPFont) font

Returns the menu item's font

Definition at line 290 of file CPMenuItem.j.

- (BOOL) hasSubmenu

Returns YES if the menu item has a submenu.

Definition at line 511 of file CPMenuItem.j.

- (CPImage) image

Returns the menu item's image

Definition at line 376 of file CPMenuItem.j.

- (unsigned) indentationLevel

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

Definition at line 97 of file CPMenuItem.j.

- (id) initWithCoder: (CPCoder aCoder

Initializes the menu item from a coder.

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

Definition at line 911 of file CPMenuItem.j.

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

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

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

Definition at line 704 of file CPMenuItem.j.

- (BOOL) isEnabled

Returns YES if the item is enabled.

Definition at line 157 of file CPMenuItem.j.

- (BOOL) isHidden

Returns YES if the item is hidden.

Definition at line 180 of file CPMenuItem.j.

- (BOOL) isHiddenOrHasHiddenAncestor

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

Returns YES if the menu item is highlighted.

Definition at line 800 of file CPMenuItem.j.

- (BOOL) isSeparatorItem

Returns YES if the menu item is a separator.

Definition at line 533 of file CPMenuItem.j.

- (CPString) keyEquivalent

Returns the keyboard shortcut for this menu item

Definition at line 570 of file CPMenuItem.j.

- (unsigned) keyEquivalentModifierMask

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

Definition at line 605 of file CPMenuItem.j.

- (CPMenu) menu

Returns the container menu of this item

Definition at line 551 of file CPMenuItem.j.

- (CPImage) mixedStateImage

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

Definition at line 458 of file CPMenuItem.j.

- (CPString) mnemonic

Returns the menu items mnemonic character

Definition at line 685 of file CPMenuItem.j.

- (unsigned) mnemonicLocation

Returns the index of the mnemonic character in the title.

Definition at line 660 of file CPMenuItem.j.

- (id) mutableCopy

Definition at line 841 of file CPMenuItem.j.

- (CPImage) offStateImage

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

Definition at line 436 of file CPMenuItem.j.

- (CPImage) onStateImage

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

Definition at line 415 of file CPMenuItem.j.

- (id) representedObject

Returns the item's represented object.

Definition at line 764 of file CPMenuItem.j.

+ (CPMenuItem) separatorItem

Returns a new menu item separator.

Definition at line 521 of file CPMenuItem.j.

- (void) setAction: (SEL)  anAction

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

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

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

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

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

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

Sets the menu item's image

Parameters:
anImagethe menu item's image

Definition at line 361 of file CPMenuItem.j.

- (void) setIndentationLevel: (unsigned)  aLevel

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

Sets the keyboard shortcut for this menu item

Parameters:
aStringthe keyboard shortcut

Definition at line 562 of file CPMenuItem.j.

- (void) setKeyEquivalentModifierMask: (unsigned)  aMask

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

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

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

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

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

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

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

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

Sets the submenu for this item

Parameters:
aMenuthe submenu

Definition at line 468 of file CPMenuItem.j.

- (void) setTag: (int)  aTag

Sets the menu item's tag

Parameters:
aTagthe tag for the item

Definition at line 310 of file CPMenuItem.j.

- (void) setTarget: (id)  aTarget

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

Set's the item's text color

Definition at line 266 of file CPMenuItem.j.

- (void) setTitle: (CPString aTitle

Sets the item's title.

Parameters:
aTitlethe item's new title

Definition at line 241 of file CPMenuItem.j.

- (void) setTitleWithMnemonicLocation: (CPString aTitle

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

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

Sets the view for the menu item

Parameters:
aViewthe menu's item's view

Definition at line 775 of file CPMenuItem.j.

- (int) state

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

CPMixedState
CPOnState
CPOffState

Definition at line 351 of file CPMenuItem.j.

- (CPMenu) submenu

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

Definition at line 503 of file CPMenuItem.j.

- (int) tag

Returns the item's tag

Definition at line 318 of file CPMenuItem.j.

- (id) target

Returns the item's action target

Definition at line 214 of file CPMenuItem.j.

- (CPString) title

Returns the menu item's title.

Definition at line 258 of file CPMenuItem.j.

- (CPString) toolTip

Returns the item's tooltip

Definition at line 745 of file CPMenuItem.j.

- (CPView) view

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:
 All Classes Files Functions Variables Defines