blockly > FlyoutButton

FlyoutButton class

Class for a button or label in the flyout.

Signature:

export declare class FlyoutButton implements IASTNodeLocationSvg 

Implements: IASTNodeLocationSvg

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

Property Modifiers Type Description
BORDER_RADIUS static number The radius of the flyout button's borders.
cursorSvg SVGElement | null Holds the cursors svg element when the cursor is attached to the button. This is null if there is no cursor on the button.
height number The height of the button's rect.
info toolbox.ButtonOrLabelInfo
TEXT_MARGIN_X static number The horizontal margin around the text in the button.
TEXT_MARGIN_Y static number The vertical margin around the text in the button.
width number The width of the button's rect.

Methods

Method Modifiers Description
createDom() Create the button elements.
dispose() Dispose of this button.
getButtonText()
getTargetWorkspace() Get the button's target workspace.
getWorkspace() Get the button's workspace.
isLabel()
moveTo(x, y) Move the button to the given x, y coordinates.
setCursorSvg(cursorSvg) Add the cursor SVG to this buttons's SVG group.
setMarkerSvg() Required by IASTNodeLocationSvg, but not used. A marker cannot be set on a button. If the 'mark' shortcut is used on a button, its associated callback function is triggered.
show() Correctly position the flyout button and make it visible.