CPMenu Class Reference

List of all members.

Public Member Functions

(float) - menuBarHeight [implementation]
(id) - initWithTitle: [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

(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 55 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 251 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 264 of file CPMenu.j.

- (CPMenu) attachedMenu   [implementation]

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

Definition at line 499 of file CPMenu.j.

- (BOOL) autoenablesItems   [implementation]

Returns YES if the menu auto enables items.

Definition at line 559 of file CPMenu.j.

- (void) cancelTracking   [implementation]

Cancels tracking.

Definition at line 693 of file CPMenu.j.

- (id) delegate   [implementation]

Definition at line 684 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 812 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 672 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 373 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 442 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 459 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 403 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 421 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 386 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 795 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 188 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 210 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 238 of file CPMenu.j.

- (BOOL) isAttached   [implementation]

Returns YES if the menu is attached to another menu.

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

- (CPArray) itemArray   [implementation]

Returns the array of menu items backing this menu

Definition at line 362 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 346 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 300 of file CPMenu.j.

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

Not yet implemented

Definition at line 515 of file CPMenu.j.

+ (CPDictionary) menuBarAttributes   [implementation]

Definition at line 163 of file CPMenu.j.

- (float) menuBarHeight   [implementation]

Definition at line 174 of file CPMenu.j.

+ (CPImage) menuBarIconImage   [implementation]

Definition at line 128 of file CPMenu.j.

+ (CPString) menuBarTitle   [implementation]

Definition at line 117 of file CPMenu.j.

+ (BOOL) menuBarVisible   [implementation]

Definition at line 73 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 317 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 332 of file CPMenu.j.

- (unsigned) numberOfItems   [implementation]

Returns the number of menu items in the menu

Definition at line 354 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 750 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 710 of file CPMenu.j.

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

Definition at line 592 of file CPMenu.j.

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

Definition at line 597 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 273 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 282 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 551 of file CPMenu.j.

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

Definition at line 679 of file CPMenu.j.

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

Definition at line 133 of file CPMenu.j.

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

Definition at line 122 of file CPMenu.j.

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

Definition at line 111 of file CPMenu.j.

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

Definition at line 78 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 654 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 477 of file CPMenu.j.

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

Sets the super menu.

Parameters:
aMenu the new super menu

Definition at line 532 of file CPMenu.j.

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

Sets the menu title.

Parameters:
the new title

Definition at line 577 of file CPMenu.j.

- (BOOL) showsStateColumn   [implementation]

Returns YES if the menu shows the state column

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

- (CPMenu) supermenu   [implementation]

Returns the super menu or nil if there is none.

Definition at line 523 of file CPMenu.j.

- (CPString) title   [implementation]

Returns the menu title

Definition at line 585 of file CPMenu.j.

- (void) update   [implementation]

Not implemented.

Definition at line 567 of file CPMenu.j.


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

Generated on Thu Dec 11 01:55:50 2008 for Cappuccino by  doxygen 1.5.7.1