sesaparcours
    Preparing search index...

    Fake class which should be extended to avoid inheriting static properties

    Hierarchy (View Summary)

    Index

    Constructors

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

      Parameters

      • workspace: WorkspaceSvg

        The workspace in which to create new blocks.

      Returns Toolbox

    Properties

    HtmlDiv: Element

    The html container for the toolbox.

    id: string

    The unique id for this component that is used to register with the ComponentManager.

    RTL: boolean

    Is RTL vs LTR.

    toolboxPosition: Blockly.utils.toolbox.Position

    Position of the toolbox and flyout relative to the workspace.

    Methods

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

      Parameters

      • style: string

        The name of the class to add.

      Returns void

    • Hides the component. Called in Blockly.hideChaff.

      Parameters

      • onlyClosePopups: boolean

        Whether only popups should be closed. Flyouts should not be closed if this is true.

      Returns void

    • Unhighlights any previously selected item.

      Returns void

    • Disposes of this toolbox.

      Returns void

    • Returns the bounding rectangle of the drag target area in pixel units relative to viewport.

      Returns Blockly.utils.Rect

      The component's bounding box. Null if drag target area should be ignored.

    • Gets the toolbox flyout.

      Returns IFlyout

      The toolbox flyout.

    • Gets the height of the toolbox.

      Returns number

      The width of the toolbox.

    • Gets the toolbox item with the given ID.

      Parameters

      • id: string

        The ID of the toolbox item.

      Returns IToolboxItem

      The toolbox item with the given ID, or null if no item exists.

    • Gets the width of the toolbox.

      Returns number

      The width of the toolbox.

    • Gets the workspace for the toolbox.

      Returns WorkspaceSvg

      The parent workspace for the toolbox.

    • Handles resizing the toolbox when a toolbox item resizes.

      Returns void

    • Initializes the toolbox

      Returns void

    • Gets whether or not the toolbox is horizontal.

      Returns boolean

      True if the toolbox is horizontal, false if the toolbox is vertical.

    • Handles when a cursor with a block or bubble enters this drag target.

      Parameters

      • _dragElement: IDraggable

        The block or bubble currently being dragged.

      Returns void

    • Handles when a cursor with a block or bubble exits this drag target.

      Parameters

      • _dragElement: IDraggable

        The block or bubble currently being dragged.

      Returns void

    • Handles when a cursor with a block or bubble is dragged over this drag target.

      Parameters

      • _dragElement: IDraggable

        The block or bubble currently being dragged.

      Returns void

    • Handles when a block or bubble is dropped on this component. Should not handle delete here.

      Parameters

      • _dragElement: IDraggable

        The block or bubble currently being dragged.

      Returns void

    • Handles the given keyboard shortcut.

      Parameters

      Returns boolean

      True if the shortcut has been handled, false otherwise.

    • Positions the toolbox based on whether it is a horizontal toolbox and whether the workspace is in rtl.

      Returns void

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

      Returns void

    • Updates the category colours and background colour of selected categories.

      Returns void

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

      Parameters

      • style: string

        The name of the class to remove.

      Returns void

    • Fills the toolbox with new toolbox items and removes any old contents.

      Parameters

      • toolboxDef: ToolboxInfo

        Object holding information for creating a toolbox.

      Returns void

    • Selects the toolbox item by its position in the list of toolbox items.

      Parameters

      • position: number

        The position of the item to select.

      Returns void

    • Sets the given item as selected. No-op if the item is not selectable.

      Parameters

      Returns void

    • Shows or hides the toolbox.

      Parameters

      • isVisible: boolean

        True if toolbox should be visible.

      Returns void

    • Returns whether the provided block or bubble should not be moved after being dropped on this component. If true, the element will return to where it was when the drag started.

      Parameters

      • _dragElement: IDraggable

        The block or bubble currently being dragged.

      Returns boolean

      Whether the block or bubble provided should be returned to drag start.

    • Returns whether the provided block or bubble would be deleted if dropped on this area. This method should check if the element is deletable and is always called before onDragEnter/onDragOver/onDragExit.

      Parameters

      • element: IDraggable

        The block or bubble currently being dragged.

      • couldConnect: boolean

        Whether the element could could connect to another.

      Returns boolean

      Whether the element provided would be deleted if dropped on this area.