API 0.9.5
CPPopUpButton Class Reference

#import <CPPopUpButton.h>

Inheritance diagram for CPPopUpButton:

List of all members.

Instance Methods

(void) - addItem:
(void) - addItemsWithTitles:
(void) - addItemWithTitle:
(int) - indexOfItem:
(int) - indexOfItemWithRepresentedObject:
(int) - indexOfItemWithTag:
(int) - indexOfItemWithTarget:action:
(int) - indexOfItemWithTitle:
(int) - indexOfSelectedItem
(id) - initWithCoder:
(id) - initWithFrame:
(id) - initWithFrame:pullsDown:
(void) - insertItemWithTitle:atIndex:
(CPArray- itemArray
(CPMenuItem- itemAtIndex:
(CPString- itemTitleAtIndex:
(CPArray- itemTitles
(CPMenuItem- itemWithTitle:
(CPMenuItem- lastItem
(void) - mouseDown:
(int) - numberOfItems
(id) - objectValue
(void) - observeValueForKeyPath:ofObject:change:context:
(CPRectEdge) - preferredEdge
(BOOL) - pullsDown
(void) - removeAllItems
(void) - removeItemAtIndex:
(void) - removeItemWithTitle:
(void) - rightMouseDown:
(CPUInteger) - selectedIndex
(CPMenuItem- selectedItem
(int) - selectedTag
(void) - selectItem:
(void) - selectItemAtIndex:
(void) - selectItemWithTag:
(void) - selectItemWithTitle:
(void) - setImage:
(void) - setObjectValue:
(void) - setPreferredEdge:
(void) - setPullsDown:
(void) - setSelectedIndex:
(void) - setTitle:
(void) - synchronizeTitleAndSelectedItem
(void) - takeValueFromKeyPath:ofObjects:
(CPString- titleOfSelectedItem

Class Methods

(CPString+ defaultThemeClass
(CPSet+ keyPathsForValuesAffectingSelectedIndex
(CPSet+ keyPathsForValuesAffectingSelectedItem
(CPSet+ keyPathsForValuesAffectingSelectedTag

Detailed Description

A CPPopUpButton contains a pop-up menu of items that a user can select from.

Definition at line 2 of file CPPopUpButton.h.


Method Documentation

- (void) addItem: (CPMenuItem anItem

Adds a new menu item using a CPMenuItem object.

Definition at line 142 of file CPPopUpButton.j.

- (void) addItemsWithTitles: (CPArray titles

Adds multiple new menu items with the titles specified in the provided array.

Parameters:
titlesan array of names for the new items

Definition at line 160 of file CPPopUpButton.j.

- (void) addItemWithTitle: (CPString aTitle

Adds a new menu item with the specified title.

Parameters:
thenew menu item's title

Definition at line 151 of file CPPopUpButton.j.

+ (CPString) defaultThemeClass

Reimplemented from CPButton.

Definition at line 41 of file CPPopUpButton.j.

- (int) indexOfItem: (CPMenuItem aMenuItem

Returns the index of the specified item or CPNotFound if the item is not in the list.

Parameters:
aMenuItemthe item to obtain the index for

Definition at line 417 of file CPPopUpButton.j.

- (int) indexOfItemWithRepresentedObject: (id)  anObject

Returns the index of the item with the specified represented object or CPNotFound if a match does not exist.

Parameters:
anObjectthe item's represented object

Definition at line 446 of file CPPopUpButton.j.

- (int) indexOfItemWithTag: (int)  aTag

Returns the index of the item with the specified tag or CPNotFound if the item is not in the list.

Parameters:
aTagthe item's tag

Definition at line 426 of file CPPopUpButton.j.

- (int) indexOfItemWithTarget: (id)  aTarget
action: (SEL)  anAction 

Returns the index of the item with the specified target and action. Returns CPNotFound if the no such item is in the list.

Parameters:
aTargetthe item's target
anActionthe item's action

Definition at line 458 of file CPPopUpButton.j.

- (int) indexOfItemWithTitle: (CPString aTitle

Returns the index of the item with the specified title or CPNotFound.

Parameters:
aTitlethe item's title

Definition at line 435 of file CPPopUpButton.j.

- (int) indexOfSelectedItem

Returns the index of the selected item. If no item is selected, it returns CPNotFound.

Definition at line 240 of file CPPopUpButton.j.

- (id) initWithCoder: (CPCoder aCoder

Initializes the pop-up button with data from the specified coder.

Parameters:
aCoderthe coder from which to read the data
Returns:
the initialized pop-up button

Reimplemented from CPButton.

Definition at line 788 of file CPPopUpButton.j.

- (id) initWithFrame: (CGRect)  aFrame

Initializes and returns a newly allocated CPButton object with a specified frame rectangle.

Parameters:
aFrameThe frame rectangle for the created button object.
Returns:
An initialized CPView object or nil if the object couldn't be created.

Reimplemented from CPButton.

Definition at line 94 of file CPPopUpButton.j.

- (id) initWithFrame: (CGRect)  aFrame
pullsDown: (BOOL)  shouldPullDown 

Initializes the pop-up button to the specified size.

Parameters:
aFramethe size for the button
shouldPullDownYES makes this a pull-down menu, NO makes it a pop-up menu.
Returns:
the initialized pop-up button

Definition at line 67 of file CPPopUpButton.j.

- (void) insertItemWithTitle: (CPString aTitle
atIndex: (int)  anIndex 

Inserts a new item with the specified title and index location.

Parameters:
aTitlethe new item's title
anIndexthe item's index in the menu

Definition at line 174 of file CPPopUpButton.j.

- (CPArray) itemArray

Returns an array of the items in the menu

Definition at line 350 of file CPPopUpButton.j.

- (CPMenuItem) itemAtIndex: (unsigned)  anIndex

Returns the item at the specified index or nil if the item does not exist.

Parameters:
anIndexthe index of the item to obtain

Definition at line 359 of file CPPopUpButton.j.

- (CPString) itemTitleAtIndex: (unsigned)  anIndex

Returns the title of the item at the specified index or nil if no item exists.

Parameters:
anIndexthe index of the item

Definition at line 368 of file CPPopUpButton.j.

- (CPArray) itemTitles

Returns an array of all the menu item titles.

Definition at line 376 of file CPPopUpButton.j.

- (CPMenuItem) itemWithTitle: (CPString aTitle

Returns the menu item with the specified title.

Parameters:
aTitlethe title of the desired menu item

Definition at line 393 of file CPPopUpButton.j.

+ (CPSet) keyPathsForValuesAffectingSelectedIndex

Definition at line 46 of file CPPopUpButton.j.

+ (CPSet) keyPathsForValuesAffectingSelectedItem

Definition at line 56 of file CPPopUpButton.j.

+ (CPSet) keyPathsForValuesAffectingSelectedTag

Definition at line 51 of file CPPopUpButton.j.

- (CPMenuItem) lastItem

Returns the last menu item

Definition at line 407 of file CPPopUpButton.j.

- (void) mouseDown: (CPEvent anEvent

Notifies the receiver that the user has clicked the mouse down in its area.

Parameters:
anEventcontains information about the click

Reimplemented from CPButton.

Definition at line 669 of file CPPopUpButton.j.

- (int) numberOfItems

Returns a count of the number of items in the button's menu.

Definition at line 342 of file CPPopUpButton.j.

- (id) objectValue

Returns the receiver's object value.

Reimplemented from CPControl.

Definition at line 314 of file CPPopUpButton.j.

- (void) observeValueForKeyPath: (CPString aKeyPath
ofObject: (id)  anObject
change: (CPDictionary changes
context: (id)  aContext 

Definition at line 556 of file CPPopUpButton.j.

- (CPRectEdge) preferredEdge

Returns the button's edge where the pop-up menu will be displayed when there is not enough room to display directly above the button.

Definition at line 469 of file CPPopUpButton.j.

- (BOOL) pullsDown

Returns YES if the button is a pull-down menu. NO if the button is a pop-up menu.

Definition at line 132 of file CPPopUpButton.j.

- (void) removeAllItems

Removes all menu items from the pop-up button's menu

Definition at line 189 of file CPPopUpButton.j.

- (void) removeItemAtIndex: (int)  anIndex

Removes the menu item at the specified index

Parameters:
anIndexthe index of the item to remove

Definition at line 209 of file CPPopUpButton.j.

- (void) removeItemWithTitle: (CPString aTitle

Removes a menu item with the specified title from the button.

Parameters:
aTitlethe title of the item to remove

Definition at line 199 of file CPPopUpButton.j.

- (void) rightMouseDown: (CPEvent anEvent

Notifies the receiver that the user has clicked the right mouse down in its area.

Parameters:
anEventcontains information about the right click

Reimplemented from CPView.

Definition at line 736 of file CPPopUpButton.j.

- (CPUInteger) selectedIndex

Definition at line 285 of file CPPopUpButton.j.

- (CPMenuItem) selectedItem

Returns the selected item or nil if no item is selected.

Definition at line 219 of file CPPopUpButton.j.

- (int) selectedTag

Definition at line 248 of file CPPopUpButton.j.

- (void) selectItem: (CPMenuItem aMenuItem

Selects the specified menu item.

Parameters:
aMenuItemthe item to select

Definition at line 266 of file CPPopUpButton.j.

- (void) selectItemAtIndex: (CPUInteger)  anIndex

Selects the item at the specified index

Parameters:
anIndexthe index of the item to select

Definition at line 275 of file CPPopUpButton.j.

- (void) selectItemWithTag: (int)  aTag

Selects the menu item with the specified tag

Parameters:
thetag of the item to select

Definition at line 323 of file CPPopUpButton.j.

- (void) selectItemWithTitle: (CPString aTitle

Selects the item with the specified title

Parameters:
thetitle of the item to select

Definition at line 332 of file CPPopUpButton.j.

- (void) setImage: (CPImage anImage

This method has no effect. Because the image is taken from the currently selected item, this method serves no purpose.

Reimplemented from CPButton.

Definition at line 528 of file CPPopUpButton.j.

- (void) setObjectValue: (int)  anIndex

Selects the item at the specified index

Parameters:
anIndexthe index of the item to select

Definition at line 294 of file CPPopUpButton.j.

- (void) setPreferredEdge: (CPRectEdge)  aRectEdge

Sets the preferred edge of the button to display the pop-up when there is a limited amount of screen space. By default, the pop-up should draw on top of the button.

Definition at line 479 of file CPPopUpButton.j.

- (void) setPullsDown: (BOOL)  shouldPullDown

Specifies whether the object is a pull-down or a pop-up menu. If the button pulls down the menu items represent actions, not states. So the text in the button will NOT change when the user selects something different.

Parameters:
shouldPullDownYES makes the pop-up button a pull-down menu. NO makes it a pop-up menu.

Definition at line 109 of file CPPopUpButton.j.

- (void) setSelectedIndex: (CPUInteger)  anIndex

Definition at line 280 of file CPPopUpButton.j.

- (void) setTitle: (CPString aTitle

Sets the pop-up button's title.

Parameters:
aTitlethe new title

Reimplemented from CPButton.

Definition at line 489 of file CPPopUpButton.j.

- (void) synchronizeTitleAndSelectedItem

Makes sure the selected item and the item being displayed are one and the same.

Definition at line 538 of file CPPopUpButton.j.

- (void) takeValueFromKeyPath: (CPString aKeyPath
ofObjects: (CPArray objects 

Definition at line 762 of file CPPopUpButton.j.

- (CPString) titleOfSelectedItem

Returns the title of the selected item or nil if no item is selected.

Definition at line 232 of file CPPopUpButton.j.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Defines