Constructor

FlyoutButton

new FlyoutButton(workspace, targetWorkspace, xml, isLabel)

Class for a button in the flyout.

Parameter

workspace

Blockly.WorkspaceSvg

The workspace in which to place this button.

Value must not be null.

targetWorkspace

Blockly.WorkspaceSvg

The flyout's target workspace.

Value must not be null.

xml

Element

The XML specifying the label/button.

Value must not be null.

isLabel

boolean

Whether this button should be styled as a label.

Properties

MARGIN

static

The margin around the text in the button.

height

number

The height of the button's rect.

width

number

The width of the button's rect.

Methods

createDom

createDom() returns Element

Create the button elements.

Returns

non-null Element The button's SVG group.

dispose

dispose()

Dispose of this button.

getPosition

getPosition() returns goog.math.Coordinate

Location of the button.

Returns

non-null goog.math.Coordinate x, y coordinates.

getTargetWorkspace

getTargetWorkspace() returns Blockly.WorkspaceSvg

Get the button's target workspace.

Returns

non-null Blockly.WorkspaceSvg The target workspace of the flyout where this button resides.

moveTo

moveTo(x, y)

Move the button to the given x, y coordinates.

Parameter

x

number

The new x coordinate.

y

number

The new y coordinate.

show

show()

Correctly position the flyout button and make it visible.