Class GSButton
Extends GSPanel.
Generic button suitable for overlaying on the map.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
GSButton(name, parent, options)
Constructs a new
GSButton instance |
| Property Attributes | Property Name and Description |
|---|---|
| <static> |
GSButton.INNER
Button styling constant for inner buttons
|
| <static> |
GSButton.LEFT
Button styling constant for left-most button
|
| <static> |
GSButton.NORMAL
Button styling constant for normal buttons
|
| <static> |
GSButton.RIGHT
Button styling constant for right-most button
|
| Method Attributes | Method Name and Description |
|---|---|
|
setActive(active)
Sets the active state of this button
|
|
|
setName(name)
Set's the button name
|
- Methods borrowed from class GSPanel:
- addEventListener, disableEventPropagation, getContentElement, getElement, getSize, setBackgroundColor, setContent, setPosition, setSize, setVisible
Class Detail
GSButton(name, parent, options)
Constructs a new
GSButton instance
- Parameters:
- {String} name
- the button name
- {HTMLElement} parent
- the button parent element
- {Object} options Optional
- optional configuration properties
- {int} options.buttonType
- can be used to define button appearance when used within a button bar. Supported values are: GSButton.NORMAL | GSButton.LEFT | GSButton.INNER | GSButton.RIGHT
- {boolean} options.active
- whether the button is currently in an active state, defaults to
false - {int} options.x
- the button x position (in pixels) relative to it's parent's coordinate system
- {int} options.y
- the button y position (in pixels) relative to it's parent's coordinate system
- {int} options.width
- the width of the button in pixels
- {int} options.height
- the height of the button in pixels
- {int} options.zIndex
- the button z-index
- {String} options.color
- the foreground color of the button
- {String} options.backgroundColor
- the background color of the button (specified as an RGBa value if transparency required)
- {boolean} options.visible
- the initial visibility of this button
- {Object} options.styles
- an object literal specifying CSS styles to be set on the button
- {Object} options.events
- an object literal specifying event handlers to be added to the button root element
Property Detail
<static>
{int}
GSButton.INNER
Button styling constant for inner buttons
<static>
{int}
GSButton.LEFT
Button styling constant for left-most button
<static>
{int}
GSButton.NORMAL
Button styling constant for normal buttons
<static>
{int}
GSButton.RIGHT
Button styling constant for right-most button
Method Detail
setActive(active)
Sets the active state of this button
- Parameters:
- {Boolean} active
trueif this button should be active
setName(name)
Set's the button name
- Parameters:
- {String} name
- the name to set