Skip to content

Toolbar

Overview

The Toolbar along the left edge of the screen with controls related to the sim or active screen. Currently, it only contains controls related to the Voicing feature. It isn't always displayed and the user must request it from the PreferencesDialog. In order to be used, both voicing AND the Toolbar must be enabled by the user. Voicing can be used without this shown.

When open, the sim will resize and shift to the right to create space. Screen bounds are adjusted so that simulation components will never overlap with the Toolbar.

@author Jesse Greenberg

Class Toolbar

import { Toolbar } from 'scenerystack/sim';

Constructor

new Toolbar( enabledProperty : TReadOnlyProperty<boolean>, selectedScreenProperty : TReadOnlyProperty<AnyScreen>, lookAndFeel : LookAndFeel, providedOptions? : ToolbarOptions )

Instance Methods

getDisplayedWidth() : number

Returns the width of the Toolbar that can be seen on screen. This can be any value from the full width of the Toolbar to zero width, depending on whether it is open, closed, removed entirely, or animating.

layout( scale : number, height : number )

Layout for the Toolbar, called whenever position changes or self is resized.

Instance Properties

rightPositionProperty : TProperty<number>

(readonly)

The position of the right edge of the backgroundRectangle in local coordinates. This is what controls the position of the Toolbar as it is open/closed/removed/animating.

Source Code

See the source for Toolbar.ts in the joist repository.