Constructor

Toolbox

new Toolbox(workspace)

Class for a Toolbox. Creates the toolbox's DOM.

Parameter

workspace

Blockly.Workspace

The workspace in which to create new blocks.

Value must not be null.

Classes

Properties

height

number

Height of the toolbox, which changes only in horizontal layout.

HtmlDiv

Element

HTML container for the Toolbox menu.

RTL

boolean

Is RTL vs LTR.

toolboxPosition

number

Position of the toolbox and flyout relative to the workspace.

width

number

Width of the toolbox, which changes only in vertical layout.

Methods

addStyle

addStyle(style)

Adds a style on the toolbox. Usually used to change the cursor.

Parameter

style

string

The name of the class to add.

clearSelection

clearSelection()

Unhighlight any previously specified option.

dispose

dispose()

Dispose of this toolbox.

getClientRect

getClientRect() returns goog.math.Rect

Return the deletion rectangle for this toolbox.

Returns

goog.math.Rect Rectangle in which to delete.

getHeight

getHeight() returns number

Get the height of the toolbox.

Returns

number The width of the toolbox.

getWidth

getWidth() returns number

Get the width of the toolbox.

Returns

number The width of the toolbox.

init

init()

Initializes the toolbox.

position

position()

Move the toolbox to the edge.

refreshSelection

refreshSelection()

Update the flyout's contents without closing it. Should be used in response to a change in one of the dynamic categories, such as variables or procedures.

removeStyle

removeStyle(style)

Removes a style from the toolbox. Usually used to change the cursor.

Parameter

style

string

The name of the class to remove.