Constructor
new ToolBar()
Create an instance of ToolBar component object.
Classes
Methods
addSpacer(width, height) → {ToolBar}
Add an invisible spacer of specified width and height.
| Name | Type | Description |
|---|---|---|
width | number | Width of the spacer block |
height | number | Height of the spacer block |
Returns this ToolBar component for method chaining.
- Type:
- ToolBar
alignment(alignmentopt) → {string|ToolBar}
Set or get alignment of components within toolbar.
| Name | Type | Attributes | Description |
|---|---|---|---|
alignment | string | <optional> | "leading|trailing|left|center|right" |
If no parameters were passed, current alignment is returned; otherwise this Toolbar component is returned for method chaining.
- Type:
- string |
ToolBar
attached(attachedopt, floating_positionopt) → {boolean|ToolBar}
Sets or gets boolean whether the toolbar is attached to main Window. Has no affect if not attached to a Window yet.
| Name | Type | Attributes | Description |
|---|---|---|---|
attached | boolean | <optional> |
|
floating_position | Object | <optional> | Position on screen where toolbar should float {x:number, y:number}. |
If no parameters were passed, current state is returned; otherwise this Toolbar component is returned for method chaining.
- Type:
- boolean |
ToolBar
detachable(detachableopt) → {boolean|ToolBar}
Sets of gets whether the ToolBar can be detached from the Window it was added to.
| Name | Type | Attributes | Description |
|---|---|---|---|
detachable | boolean | <optional> |
|
If no parameters were passed, current value is returned, otherwise this Toolbar component is returned for method chaining.
- Type:
- boolean |
ToolBar
onDockEvents(callbackopt, removeopt) → {ToolBar|Array.<function()>}
Gets, registers or unregisters a docking event handler function. This event handler is called when the ToolBar gets attached/detached.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
callback | function | <optional> | The event handler function. Receives an event object. | |
remove | boolean | <optional> | false | Set to |
An array of handler functions if no arguments are passed, otherwise this component for method chaining.
- Type:
- ToolBar |
Array.<function()>
// Event object format:
const e = {
target: object, // The ToolBar component that triggered the event.
type: string, // "attached", "detached".
interactive: boolean // Only when type is "update". `true` when update was made by the user interacting with the GUI. `false` when update was made programmatically.
orientation: Orientation // current orientation
location: string // "top", "bottom", "left", "right". Only when `e.interactive` is `true`.
mouseX: number // Mouse X position relative to Window's content area. Only when `e.interactive` is `true`.
mouseY: number // Mouse Y position relative to Window's content area. Only when `e.interactive` is `true`.
};orientation(orientationopt) → {Orientation|ToolBar}
Sets or gets vertical or horizontal orientation of the ToolBar.
| Name | Type | Attributes | Description |
|---|---|---|---|
orientation | Orientation | <optional> | One of these values: Orientation.Horizontal (default) or Orientation.Vertical |
- See
If no parameters were passed, current orientation is returned; otherwise this Toolbar component is returned for method chaining.
- Type:
- Orientation |
ToolBar
padding(padding) → {number|ToolBar}
Sets or gets a padding size between edge of the component and items inside it, and spacing between items.
| Name | Type | Description |
|---|---|---|
padding | number | Padding size in pixels. |
If no parameters were passed, current padding is returned; otherwise this Toolbar component is returned for method chaining.
- Type:
- number |
ToolBar