#import <CPPopUpButton.h>
A CPPopUpButton contains a pop-up menu of items that a user can select from.
Definition at line 2 of file CPPopUpButton.h.
- (void) addItemsWithTitles: |
|
(CPArray) |
titles |
|
|
implementation |
Adds multiple new menu items with the titles specified in the provided array.
- Parameters
-
titles | an array of names for the new items |
Definition at line 159 of file CPPopUpButton.j.
- (void) addItemWithTitle: |
|
(CPString) |
aTitle |
|
|
implementation |
Adds a new menu item with the specified title.
- Parameters
-
Definition at line 150 of file CPPopUpButton.j.
Returns the index of the specified item or CPNotFound if the item is not in the list.
- Parameters
-
aMenuItem | the item to obtain the index for |
Definition at line 400 of file CPPopUpButton.j.
- (int) indexOfItemWithRepresentedObject: |
|
(id) |
anObject |
|
|
implementation |
Returns the index of the item with the specified represented object or CPNotFound if a match does not exist.
- Parameters
-
anObject | the item's represented object |
Definition at line 429 of file CPPopUpButton.j.
- (int) indexOfItemWithTag: |
|
(int) |
aTag |
|
|
implementation |
Returns the index of the item with the specified tag or CPNotFound if the item is not in the list.
- Parameters
-
Definition at line 409 of file CPPopUpButton.j.
- (int) indexOfItemWithTarget: |
|
(id) |
aTarget |
action: |
|
(SEL) |
anAction |
|
|
| |
|
implementation |
Returns the index of the item with the specified target and action. Returns CPNotFound if the no such item is in the list.
- Parameters
-
aTarget | the item's target |
anAction | the item's action |
Definition at line 441 of file CPPopUpButton.j.
- (int) indexOfItemWithTitle: |
|
(CPString) |
aTitle |
|
|
implementation |
Returns the index of the item with the specified title or CPNotFound.
- Parameters
-
Definition at line 418 of file CPPopUpButton.j.
- (int) indexOfSelectedItem |
|
|
|
|
implementation |
Returns the index of the selected item. If no item is selected, it returns CPNotFound.
Definition at line 239 of file CPPopUpButton.j.
- (id) initWithCoder: |
|
(CPCoder) |
aCoder |
|
|
implementation |
Initializes the pop-up button with data from the specified coder.
- Parameters
-
aCoder | the coder from which to read the data |
- Returns
- the initialized pop-up button
Reimplemented from CPButton.
Provided by category CPPopUpButton(CPCoding).
Definition at line 1064 of file CPPopUpButton.j.
- (id) initWithFrame: |
|
(CGRect) |
aFrame |
|
|
implementation |
Initializes and returns a newly allocated CPButton object with a specified frame rectangle.
- Parameters
-
aFrame | The 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 93 of file CPPopUpButton.j.
- (id) initWithFrame: |
|
(CGRect) |
aFrame |
pullsDown: |
|
(BOOL) |
shouldPullDown |
|
|
| |
|
implementation |
Initializes the pop-up button to the specified size.
- Parameters
-
aFrame | the size for the button |
shouldPullDown | YES makes this a pull-down menu, NO makes it a pop-up menu. |
- Returns
- the initialized pop-up button
Definition at line 66 of file CPPopUpButton.j.
- (void) insertItemWithTitle: |
|
(CPString) |
aTitle |
atIndex: |
|
(int) |
anIndex |
|
|
| |
|
implementation |
Inserts a new item with the specified title and index location.
- Parameters
-
aTitle | the new item's title |
anIndex | the item's index in the menu |
Definition at line 173 of file CPPopUpButton.j.
Returns the item at the specified index or nil
if the item does not exist.
- Parameters
-
anIndex | the index of the item to obtain |
Definition at line 342 of file CPPopUpButton.j.
- (CPString) itemTitleAtIndex: |
|
(CPUInteger) |
anIndex |
|
|
implementation |
Returns the title of the item at the specified index or nil
if no item exists.
- Parameters
-
anIndex | the index of the item |
Definition at line 351 of file CPPopUpButton.j.
Returns an array of all the menu item titles.
Definition at line 359 of file CPPopUpButton.j.
Returns the menu item with the specified title.
- Parameters
-
aTitle | the title of the desired menu item |
Definition at line 376 of file CPPopUpButton.j.
+ (CPSet) keyPathsForValuesAffectingSelectedIndex |
|
|
|
|
implementation |
+ (CPSet) keyPathsForValuesAffectingSelectedItem |
|
|
|
|
implementation |
+ (CPSet) keyPathsForValuesAffectingSelectedTag |
|
|
|
|
implementation |
- (void) mouseDown: |
|
(CPEvent) |
anEvent |
|
|
implementation |
Returns a count of the number of items in the button's menu.
Definition at line 325 of file CPPopUpButton.j.
- (void) observeValueForKeyPath: |
|
(CPString) |
aKeyPath |
ofObject: |
|
(id) |
anObject |
change: |
|
(CPDictionary) |
changes |
context: |
|
(id) |
aContext |
|
|
| |
|
implementation |
- (CPRectEdge) preferredEdge |
|
|
|
|
implementation |
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 452 of file CPPopUpButton.j.
Returns YES
if the button is a pull-down menu. NO
if the button is a pop-up menu.
Definition at line 131 of file CPPopUpButton.j.
Removes all menu items from the pop-up button's menu
Definition at line 188 of file CPPopUpButton.j.
- (void) removeItemAtIndex: |
|
(int) |
anIndex |
|
|
implementation |
Removes the menu item at the specified index
- Parameters
-
anIndex | the index of the item to remove |
Definition at line 208 of file CPPopUpButton.j.
- (void) removeItemWithTitle: |
|
(CPString) |
aTitle |
|
|
implementation |
Removes a menu item with the specified title from the button.
- Parameters
-
aTitle | the title of the item to remove |
Definition at line 198 of file CPPopUpButton.j.
- (void) rightMouseDown: |
|
(CPEvent) |
anEvent |
|
|
implementation |
- (CPUInteger) selectedIndex |
|
|
|
|
implementation |
Returns the selected item or nil
if no item is selected.
Definition at line 218 of file CPPopUpButton.j.
Selects the specified menu item.
- Parameters
-
aMenuItem | the item to select |
Definition at line 249 of file CPPopUpButton.j.
- (void) selectItemAtIndex: |
|
(CPUInteger) |
anIndex |
|
|
implementation |
Selects the item at the specified index
- Parameters
-
anIndex | the index of the item to select |
Definition at line 258 of file CPPopUpButton.j.
- (void) selectItemWithTag: |
|
(int) |
aTag |
|
|
implementation |
Selects the menu item with the specified tag
- Parameters
-
the | tag of the item to select |
Definition at line 306 of file CPPopUpButton.j.
- (void) selectItemWithTitle: |
|
(CPString) |
aTitle |
|
|
implementation |
Selects the item with the specified title
- Parameters
-
the | title of the item to select |
Definition at line 315 of file CPPopUpButton.j.
- (void) setImage: |
|
(CPImage) |
anImage |
|
|
implementation |
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 511 of file CPPopUpButton.j.
- (void) setObjectValue: |
|
(id) |
anIndex |
|
|
implementation |
Selects the item at the specified index
- Parameters
-
anIndex | the index of the item to select |
Reimplemented from CPButton.
Definition at line 277 of file CPPopUpButton.j.
- (void) setPreferredEdge: |
|
(CPRectEdge) |
aRectEdge |
|
|
implementation |
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 462 of file CPPopUpButton.j.
- (void) setPullsDown: |
|
(BOOL) |
shouldPullDown |
|
|
implementation |
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
-
shouldPullDown | YES makes the pop-up button a pull-down menu. NO makes it a pop-up menu. |
Definition at line 108 of file CPPopUpButton.j.
- (void) setSelectedIndex: |
|
(CPUInteger) |
anIndex |
|
|
implementation |
- (void) synchronizeTitleAndSelectedItem |
|
|
|
|
implementation |
Makes sure the selected item and the item being displayed are one and the same.
Definition at line 521 of file CPPopUpButton.j.
- (void) takeValueFromKeyPath: |
|
(CPString) |
aKeyPath |
ofObjects: |
|
(CPArray) |
objects |
|
|
| |
|
implementation |
Returns the title of the selected item or nil
if no item is selected.
Definition at line 231 of file CPPopUpButton.j.
The documentation for this class was generated from the following files: