onDockEvents([callback], [remove])
Class: ToolBar.
Description:
Gets, registers or unregisters a docking event handler function. This event handler is called when the ToolBar gets attached/detached.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
|
|
function |
The event handler function. Receives an event object. |
|
|
|
boolean |
false |
Set to |
Returns:
An array of handler functions if no arguments are passed, otherwise this component for method chaining.
Type: ToolBar | Array.<function()>
Examples:
// 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`.
};
