CPMenu Class Reference
[AppKit]

List of all members.

Public Member Functions

(float) - menuBarHeight [implementation]
(id) - initWithTitle: [implementation]
(id) - init [implementation]
(void) - insertItem:atIndex: [implementation]
(CPMenuItem- insertItemWithTitle:action:keyEquivalent:atIndex: [implementation]
(void) - addItem: [implementation]
(CPMenuItem- addItemWithTitle:action:keyEquivalent: [implementation]
(void) - removeItem: [implementation]
(void) - removeItemAtIndex: [implementation]
(void) - itemChanged: [implementation]
(CPMenuItem- menuWithTag: [implementation]
(CPMenuItem- menuWithTitle: [implementation]
(CPMenuItem- itemAtIndex: [implementation]
(unsigned) - numberOfItems [implementation]
(CPArray- itemArray [implementation]
(int) - indexOfItem: [implementation]
(int) - indexOfItemWithTitle: [implementation]
(int) - indexOfItemWithTag: [implementation]
(int) - indexOfItemWithTarget:andAction: [implementation]
(int) - indexOfItemWithRepresentedObject: [implementation]
(int) - indexOfItemWithSubmenu: [implementation]
(void) - setSubmenu:forItem: [implementation]
(void) - submenuAction: [implementation]
(CPMenu- attachedMenu [implementation]
(BOOL) - isAttached [implementation]
(CGPoint) - locationOfSubmenu: [implementation]
(CPMenu- supermenu [implementation]
(void) - setSupermenu: [implementation]
(BOOL) - isTornOff [implementation]
(void) - setAutoenablesItems: [implementation]
(BOOL) - autoenablesItems [implementation]
(void) - update [implementation]
(void) - setTitle: [implementation]
(CPString- title [implementation]
(void) - setShowsStateColumn: [implementation]
(BOOL) - showsStateColumn [implementation]
(CPMenuItem- highlightedItem [implementation]
(void) - setDelegate: [implementation]
(id) - delegate [implementation]
(void) - cancelTracking [implementation]
(BOOL) - performKeyEquivalent: [implementation]
(void) - performActionForItemAtIndex: [implementation]
(id) - initWithCoder: [implementation]
(void) - encodeWithCoder: [implementation]

Static Public Member Functions

(void) + initialize [implementation]
(BOOL) + menuBarVisible [implementation]
(void) + setMenuBarVisible: [implementation]
(void) + setMenuBarTitle: [implementation]
(CPString+ menuBarTitle [implementation]
(void) + setMenuBarIconImage: [implementation]
(CPImage+ menuBarIconImage [implementation]
(void) + setMenuBarAttributes: [implementation]
(CPDictionary+ menuBarAttributes [implementation]
(void) + popUpContextMenu:withEvent:forView: [implementation]
(void) + popUpContextMenu:withEvent:forView:withFont: [implementation]


Detailed Description

Menus provide the user with a list of actions and/or submenus. Submenus themselves are full fledged menus and so a heirarchical structure appears.

Definition at line 58 of file CPMenu.j.


Member Function Documentation

- (void) addItem: (CPMenuItem aMenuItem   [implementation]

Adds a menu item at the end of the menu.

Parameters:
aMenuItem the menu item to add

Definition at line 308 of file CPMenu.j.

- (CPMenuItem) addItemWithTitle: (CPString aTitle
action: (SEL)  anAction
keyEquivalent: (CPString aKeyEquivalent 
[implementation]

Creates and adds a menu item with the specified attributes at the end of the menu.

Parameters:
aTitle the title of the new menu item
anAction the action initiated when the user selects the item
aKeyEquivalent the keyboard shortcut for the menu item
Returns:
the new menu item

Definition at line 321 of file CPMenu.j.

- (CPMenu) attachedMenu   [implementation]

Returns the attaced menu, or nil if there isn't one.

Definition at line 556 of file CPMenu.j.

- (BOOL) autoenablesItems   [implementation]

Returns YES if the menu auto enables items.

Definition at line 616 of file CPMenu.j.

- (void) cancelTracking   [implementation]

Cancels tracking.

Definition at line 740 of file CPMenu.j.

- (id) delegate   [implementation]

Definition at line 731 of file CPMenu.j.

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

Encodes the data of the menu into a coder

Parameters:
aCoder the coder to which the data will be written

Definition at line 862 of file CPMenu.j.

- (CPMenuItem) highlightedItem   [implementation]

Returns the currently highlighted menu item.

Returns:
the highlighted menu item or nil if no item is currently highlighted

Definition at line 719 of file CPMenu.j.

- (int) indexOfItem: (CPMenuItem aMenuItem   [implementation]

Returns the index of the specified menu item

Parameters:
aMenuItem the item to find the index for
Returns:
the item index or CPNotFound

Definition at line 430 of file CPMenu.j.

- (int) indexOfItemWithRepresentedObject: (id)  anObject   [implementation]

Returns the index of the menu item with the specified represented object.

Parameters:
anObject the represented object of the desired item
Returns:
the index of the item or CPNotFound

Definition at line 499 of file CPMenu.j.

- (int) indexOfItemWithSubmenu: (CPMenu aMenu   [implementation]

Returns the index of the item with the specified submenu.

Parameters:
the submenu of the desired menu item
Returns:
the index of the item or CPNotFound

Definition at line 516 of file CPMenu.j.

- (int) indexOfItemWithTag: (int)  aTag   [implementation]

Returns the index of the item with the specified tag

Parameters:
aTag the desired tag to match
Returns:
the index of the item or CPNotFound

Definition at line 460 of file CPMenu.j.

- (int) indexOfItemWithTarget: (id)  aTarget
andAction: (SEL)  anAction 
[implementation]

Returns the index of the item with the specified target and action.

Parameters:
aTarget the target of the desired menu item
anAction the action of the desired menu item
Returns:
the index of the item or CPNotFound

Definition at line 478 of file CPMenu.j.

- (int) indexOfItemWithTitle: (CPString aTitle   [implementation]

Returns the index of the item with the specified title.

Parameters:
aTitle the desired title to match
Returns:
the index of the item or CPNotFound

Definition at line 443 of file CPMenu.j.

- (id) init   [implementation]

Definition at line 256 of file CPMenu.j.

+ (void) initialize   [implementation]

Definition at line 78 of file CPMenu.j.

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

Initializes the menu with data from the specified coder.

Parameters:
aCoder the coder from which to read the data
Returns:
the initialized menu

Definition at line 843 of file CPMenu.j.

- (id) initWithTitle: (CPString aTitle   [implementation]

Initializes the menu with a specified title.

Parameters:
aTile the menu title
Returns:
the initialized menu

Definition at line 240 of file CPMenu.j.

- (void) insertItem: (CPMenuItem aMenuItem
atIndex: (unsigned)  anIndex 
[implementation]

Inserts a menu item at the specified index.

Parameters:
aMenuItem the item to insert
anIndex the index in the menu to insert the item.

Definition at line 267 of file CPMenu.j.

- (CPMenuItem) insertItemWithTitle: (CPString aTitle
action: (SEL)  anAction
keyEquivalent: (CPString aKeyEquivalent
atIndex: (unsigned)  anIndex 
[implementation]

Creates and inserts a new menu item with the specified attributes.

Parameters:
aTitle the title of the menu item
anAction the action initiated when the user selects the item
aKeyEquivalent the keyboard shortcut for the item
anIndex the index location in the menu for the new item
Returns:
the new menu item

Definition at line 295 of file CPMenu.j.

- (BOOL) isAttached   [implementation]

Returns YES if the menu is attached to another menu.

Definition at line 564 of file CPMenu.j.

- (BOOL) isTornOff   [implementation]

If there are two instances of this menu visible, return NO. Otherwise, return YES if we are a detached menu and visible.

Definition at line 598 of file CPMenu.j.

- (CPArray) itemArray   [implementation]

Returns the array of menu items backing this menu

Definition at line 419 of file CPMenu.j.

- (CPMenuItem) itemAtIndex: (int)  anIndex   [implementation]

Returns the menu item at the specified index

Parameters:
anIndex the index of the requested item

Definition at line 403 of file CPMenu.j.

- (void) itemChanged: (CPMenuItem aMenuItem   [implementation]

Called when a menu item has visually changed.

Parameters:
aMenuItem the item that changed

Definition at line 357 of file CPMenu.j.

- (CGPoint) locationOfSubmenu: (CPMenu aMenu   [implementation]

Not yet implemented

Definition at line 572 of file CPMenu.j.

+ (CPDictionary) menuBarAttributes   [implementation]

Definition at line 210 of file CPMenu.j.

- (float) menuBarHeight   [implementation]

Definition at line 221 of file CPMenu.j.

+ (CPImage) menuBarIconImage   [implementation]

Definition at line 143 of file CPMenu.j.

+ (CPString) menuBarTitle   [implementation]

Definition at line 132 of file CPMenu.j.

+ (BOOL) menuBarVisible   [implementation]

Definition at line 83 of file CPMenu.j.

- (CPMenuItem) menuWithTag: (int)  aTag   [implementation]

Returns the menu item with the specified tag

Parameters:
the tag of the desired menu item
Returns:
the menu item or nil if a match was not found

Definition at line 374 of file CPMenu.j.

- (CPMenuItem) menuWithTitle: (CPString aTitle   [implementation]

Returns the menu item with the specified title.

Parameters:
aTitle the title of the menu item
Returns:
the menu item or nil if a match was not found

Definition at line 389 of file CPMenu.j.

- (unsigned) numberOfItems   [implementation]

Returns the number of menu items in the menu

Definition at line 411 of file CPMenu.j.

- (void) performActionForItemAtIndex: (unsigned)  anIndex   [implementation]

Sends the action of the menu item at the specified index.

Parameters:
anIndex the index of the item

Definition at line 797 of file CPMenu.j.

- (BOOL) performKeyEquivalent: (CPEvent anEvent   [implementation]

Initiates the action of the menu item that has a keyboard shortcut equivalent to anEvent

Parameters:
anEvent the keyboard event
Returns:
YES if it was handled.

Definition at line 757 of file CPMenu.j.

+ (void) popUpContextMenu: (CPMenu aMenu
withEvent: (CPEvent anEvent
forView: (CPView aView 
[implementation]

Definition at line 649 of file CPMenu.j.

+ (void) popUpContextMenu: (CPMenu aMenu
withEvent: (CPEvent anEvent
forView: (CPView aView
withFont: (CPFont aFont 
[implementation]

Definition at line 654 of file CPMenu.j.

- (void) removeItem: (CPMenuItem aMenuItem   [implementation]

Removes the specified item from the menu

Parameters:
aMenuItem the item to remove

Definition at line 330 of file CPMenu.j.

- (void) removeItemAtIndex: (unsigned)  anIndex   [implementation]

Removes the item at the specified index from the menu

Parameters:
anIndex the index of the item to remove

Definition at line 339 of file CPMenu.j.

- (void) setAutoenablesItems: (BOOL)  aFlag   [implementation]

Sets whether the menu automatically enables menu items.

Parameters:
aFlag YES sets the menu to automatically enable items.

Definition at line 608 of file CPMenu.j.

- (void) setDelegate: (id)  aDelegate   [implementation]

Definition at line 726 of file CPMenu.j.

+ (void) setMenuBarAttributes: (CPDictionary attributes   [implementation]

Definition at line 149 of file CPMenu.j.

+ (void) setMenuBarIconImage: (CPImage anImage   [implementation]

Definition at line 137 of file CPMenu.j.

+ (void) setMenuBarTitle: (CPString aTitle   [implementation]

Definition at line 126 of file CPMenu.j.

+ (void) setMenuBarVisible: (BOOL)  menuBarShouldBeVisible   [implementation]

Definition at line 88 of file CPMenu.j.

- (void) setShowsStateColumn: (BOOL)  shouldShowStateColumn   [implementation]

Sets whether to show the state column

Parameters:
shouldShowStateColumn YES shows the state column

Definition at line 701 of file CPMenu.j.

- (void) setSubmenu: (CPMenu aMenu
forItem: (CPMenuItem aMenuItem 
[implementation]

Sets a submenu for a menu item

Parameters:
aMenu the submenu
aMenuItem the menu item to set the submenu on

Definition at line 534 of file CPMenu.j.

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

Sets the super menu.

Parameters:
aMenu the new super menu

Definition at line 589 of file CPMenu.j.

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

Sets the menu title.

Parameters:
the new title

Definition at line 634 of file CPMenu.j.

- (BOOL) showsStateColumn   [implementation]

Returns YES if the menu shows the state column

Definition at line 709 of file CPMenu.j.

- (void) submenuAction: (id)  aSender   [implementation]

The action method of menu items that open submenus. The default implementation does nothing, but it may be subclassed to provide different behavior.

Parameters:
aSender the object that sent the message

Definition at line 548 of file CPMenu.j.

- (CPMenu) supermenu   [implementation]

Returns the super menu or nil if there is none.

Definition at line 580 of file CPMenu.j.

- (CPString) title   [implementation]

Returns the menu title

Definition at line 642 of file CPMenu.j.

- (void) update   [implementation]

Not implemented.

Definition at line 624 of file CPMenu.j.


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

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