CPMenu Class Reference
[AppKit]

List of all members.

Public Member Functions

(void) - addItem: [implementation]
(CPMenuItem- addItemWithTitle:action:keyEquivalent: [implementation]
(BOOL) - autoenablesItems [implementation]
(void) - awakeFromCib [implementation]
(void) - cancelTracking [implementation]
(id) - delegate [implementation]
(void) - encodeWithCoder: [implementation]
(CPFont- font [implementation]
(CPMenuItem- highlightedItem [implementation]
(int) - indexOfItem: [implementation]
(int) - indexOfItemWithRepresentedObject: [implementation]
(int) - indexOfItemWithSubmenu: [implementation]
(int) - indexOfItemWithTag: [implementation]
(int) - indexOfItemWithTarget:andAction: [implementation]
(int) - indexOfItemWithTitle: [implementation]
(id) - init [implementation]
(id) - initWithCoder: [implementation]
(id) - initWithTitle: [implementation]
(void) - insertItem:atIndex: [implementation]
(CPMenuItem- insertItemWithTitle:action:keyEquivalent:atIndex: [implementation]
(BOOL) - isTornOff [implementation]
(CPArray- itemArray [implementation]
(CPMenuItem- itemAtIndex: [implementation]
(void) - itemChanged: [implementation]
(CPMenuItem- itemWithTag: [implementation]
(CPMenuItem- itemWithTitle: [implementation]
(float) - menuBarHeight [implementation]
(float) - minimumWidth [implementation]
(unsigned) - numberOfItems [implementation]
(void) - performActionForItemAtIndex: [implementation]
(BOOL) - performKeyEquivalent: [implementation]
(void) - popUpMenuPositioningItem:atLocation:inView:callback: [implementation]
(void) - removeItem: [implementation]
(void) - removeItemAtIndex: [implementation]
(void) - setAutoenablesItems: [implementation]
(void) - setDelegate: [implementation]
(void) - setFont: [implementation]
(void) - setMinimumWidth: [implementation]
(void) - setShowsStateColumn: [implementation]
(void) - setSubmenu:forItem: [implementation]
(void) - setSupermenu: [implementation]
(void) - setTitle: [implementation]
(BOOL) - showsStateColumn [implementation]
(void) - submenuAction: [implementation]
(CPMenu- supermenu [implementation]
(CPString- title [implementation]
(void) - update [implementation]

Static Public Member Functions

(void) + initialize [implementation]
(CPDictionary+ menuBarAttributes [implementation]
(CPImage+ menuBarIconImage [implementation]
(CPString+ menuBarTitle [implementation]
(BOOL) + menuBarVisible [implementation]
(void) + popUpContextMenu:withEvent:forView: [implementation]
(void) + popUpContextMenu:withEvent:forView:withFont: [implementation]
(void) + setMenuBarAttributes: [implementation]
(void) + setMenuBarIconImage: [implementation]
(void) + setMenuBarTitle: [implementation]
(void) + setMenuBarVisible: [implementation]
(Function) + trackingCallbackWithCallback: [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 60 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 319 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 332 of file CPMenu.j.

- (BOOL) autoenablesItems   [implementation]

Returns YES if the menu auto enables items.

Definition at line 603 of file CPMenu.j.

- (void) awakeFromCib   [implementation]

Definition at line 1018 of file CPMenu.j.

- (void) cancelTracking   [implementation]

Cancels tracking.

Definition at line 872 of file CPMenu.j.

- (id) delegate   [implementation]

Definition at line 863 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 1081 of file CPMenu.j.

- (CPFont) font   [implementation]

Definition at line 909 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 851 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 441 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 510 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 527 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 471 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 489 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 454 of file CPMenu.j.

- (id) init   [implementation]

Definition at line 267 of file CPMenu.j.

+ (void) initialize   [implementation]

Definition at line 84 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 1058 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 249 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 278 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 306 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 585 of file CPMenu.j.

- (CPArray) itemArray   [implementation]

Returns the array of menu items backing this menu

Definition at line 430 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 414 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 368 of file CPMenu.j.

- (CPMenuItem) itemWithTag: (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 385 of file CPMenu.j.

- (CPMenuItem) itemWithTitle: (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 400 of file CPMenu.j.

+ (CPDictionary) menuBarAttributes   [implementation]

Definition at line 219 of file CPMenu.j.

- (float) menuBarHeight   [implementation]

Definition at line 230 of file CPMenu.j.

+ (CPImage) menuBarIconImage   [implementation]

Definition at line 152 of file CPMenu.j.

+ (CPString) menuBarTitle   [implementation]

Definition at line 141 of file CPMenu.j.

+ (BOOL) menuBarVisible   [implementation]

Definition at line 89 of file CPMenu.j.

- (float) minimumWidth   [implementation]

Definition at line 639 of file CPMenu.j.

- (unsigned) numberOfItems   [implementation]

Returns the number of menu items in the menu

Definition at line 422 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 969 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 920 of file CPMenu.j.

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

Definition at line 776 of file CPMenu.j.

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

Definition at line 781 of file CPMenu.j.

- (void) popUpMenuPositioningItem: (CPMenuItem anItem
atLocation: (CGPoint)  aLocation
inView: (CPView aView
callback: (Function)  aCallback 
[implementation]

Definition at line 667 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 341 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 350 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 595 of file CPMenu.j.

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

Definition at line 858 of file CPMenu.j.

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

Definition at line 904 of file CPMenu.j.

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

Definition at line 158 of file CPMenu.j.

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

Definition at line 146 of file CPMenu.j.

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

Definition at line 135 of file CPMenu.j.

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

Definition at line 94 of file CPMenu.j.

- (void) setMinimumWidth: (float)  aMinimumWidth   [implementation]

Definition at line 634 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 833 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 545 of file CPMenu.j.

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

Sets the super menu.

Parameters:
aMenu the new super menu

Definition at line 576 of file CPMenu.j.

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

Sets the menu title.

Parameters:
the new title

Definition at line 621 of file CPMenu.j.

- (BOOL) showsStateColumn   [implementation]

Returns YES if the menu shows the state column

Definition at line 841 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 559 of file CPMenu.j.

- (CPMenu) supermenu   [implementation]

Returns the super menu or nil if there is none.

Definition at line 567 of file CPMenu.j.

- (CPString) title   [implementation]

Returns the menu title

Definition at line 629 of file CPMenu.j.

+ (Function) trackingCallbackWithCallback: (Function)  aCallback   [implementation]

Definition at line 760 of file CPMenu.j.

- (void) update   [implementation]

Not implemented.

Definition at line 611 of file CPMenu.j.


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

Generated on Fri Apr 9 11:04:21 2010 for Cappuccino API by  doxygen 1.6.1