Skip to main content

Home > blockly > FlyoutButton

FlyoutButton class

Class for a button or label in the flyout.

Signature:

export declare class FlyoutButton implements IBoundedElement, IRenderedElement, IFocusableNode 

Implements: IBoundedElement, IRenderedElement, IFocusableNode

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the FlyoutButton class.

Properties

PropertyModifiersTypeDescription
BORDER_RADIUSstaticnumberThe radius of the flyout button's borders.
callbackKeyreadonlystringThe key to the function called when this button is activated.
cursorSvgSVGElement | nullHolds the cursors svg element when the cursor is attached to the button. This is null if there is no cursor on the button.
heightnumberThe height of the button's rect.
infotoolbox.ButtonOrLabelInfo
TEXT_MARGIN_XstaticnumberThe horizontal margin around the text in the button.
TEXT_MARGIN_YstaticnumberThe vertical margin around the text in the button.
widthnumberThe width of the button's rect.

Methods

MethodModifiersDescription
canBeFocused()See IFocusableNode.canBeFocused.
createDom()
dispose()Dispose of this button.
getBoundingRectangle()Returns the coordinates of a bounded element describing the dimensions of the element. Coordinate system: workspace coordinates.
getButtonText()
getFocusableElement()See IFocusableNode.getFocusableElement.
getFocusableTree()See IFocusableNode.getFocusableTree.
getSvgRoot()
getTargetWorkspace()Get the button's target workspace.
getWorkspace()Get the button's workspace.
isLabel()
moveBy(dx, dy, _reason)Move the element by a relative offset.
moveTo(x, y)Move the button to the given x, y coordinates.
onNodeBlur()See IFocusableNode.onNodeBlur.
onNodeFocus()See IFocusableNode.onNodeFocus.
setCursorSvg(cursorSvg)Add the cursor SVG to this buttons's SVG group.
show()Correctly position the flyout button and make it visible.