Class GSMenuControl
Extends GSControl.
A control for displaying a list of menu items to the user.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
GSMenuControl(name, options)
|
- Properties borrowed from class GSControl:
- parentPositioned
| Method Attributes | Method Name and Description |
|---|---|
|
addItem(menuItem)
Adds a menu item to this menu control
|
|
|
addItemAt(menuItem, index)
Adds a menu item to the menu at the position specified by the index
parameter (zero-based)
|
|
|
removeItem(menuItem)
Removes the specified menu item from this menu
|
|
|
removeItemAt(index)
Removes the menu item at the specified index (zero-based)
|
- Methods borrowed from class GSControl:
- getDefaultPosition, getHeight, getOrientation, getPosition, getWidth, hide, remove, render, show
Class Detail
GSMenuControl(name, options)
- Parameters:
- {String} name
- a unique name for the control
- {Object} options Optional
- an object literal specifying optional properties for this control.
- {boolean} options.open
trueif the menu should be rendered open, defaults tofalse- {int} options.menuItemWidth
- the width of the menu items
- {int} options.menuItemHeight
- the height of the menu items
- {int} options.menuItemPadding
- the padding around the content of each menu item
- {int} options.menuPadding
- the padding around the set of all menu items
- {String} options.fontFamily
- the font family to use for this control
- {String} options.fontSize
- the font size to use for this control
- {String} options.color
- the foreground color for this control
- {String} options.backgroundColor
- the background color for this control
- {String} options.activeColor
- the foreground color of an active menu item (
checktype only) - {String} options.highlightColor
- the foreground color of a selected menu item
- {String} options.highlightBackgroundColor
- the background color of a selected menu item
- {String} options.highlightBackgroundImage
- an image to use for the background of a selected menu item,
overrides the
highlightBackgroundColoroption - {boolean} options.useRollover
trueif a rollover effect should be used for the menu options.items- {boolean} options.hideOnAction
trueif the menu should be hidden when an action is performed on a menu item (defaults tofalse)
Method Detail
addItem(menuItem)
Adds a menu item to this menu control
- Parameters:
- {GSMenuItem} menuItem
- the menu item to add
addItemAt(menuItem, index)
Adds a menu item to the menu at the position specified by the index
parameter (zero-based)
- Parameters:
- {GSMenuItem} menuItem
- the menu item to add to the menu
- {int} index
- the position to add the menu item at
removeItem(menuItem)
Removes the specified menu item from this menu
- Parameters:
- {GSMenuItem} menuItem
- the menu item to remove from the menu
removeItemAt(index)
Removes the menu item at the specified index (zero-based)
- Parameters:
- {int} index
- the position of the menu item to remove