Toolbar

Overview

The toolbar is a strip applied to the top of a window allowing elements to be added and customized per the user preferences. Note that items in the toolbar are not guaranteed to show depending on how the user decides to remove/add items. A toolbar can be assigned to a window using Window.toolbar. Note, the toolbar supports adding two special "identifier" components with "appendChild". The first is "space" which provides a consistant OS defined space between two items in the toolbar, and the second "flex-space" which defines a flexible (expands and collapses as needed) space.

Ancestors

  1. Control
  2. Container
 

Descendants

  1. None
 

See Also

  1. Window

Constructors

new Toolbar
Description

Creates a new toolbar.

Definition

new Toolbar()

Example

require('Common');
var win = new Window();
win.visible = true;
var urlLocation = new TextInput();
var toolbar = new Toolbar();
var backButton = new Button();
var forwardButton = new Button();

backButton.image = 'back'; // named system icon
forwardButton.image = 'forward'; // named system icon

// Use 'space' for a OS-determined variable length space between items.
toolbar.appendChild([backButton, forwardButton, 'space', urlLocation, 'space']);
win.toolbar = toolbar;

urlLocation.alignment = 'center';
urlLocation.linewrap = false;
urlLocation.scrollable = true;
urlLocation.value = 'A text input field';
MacOS X Yosemite
Windows 7

Members

size
Description

Gets or sets the size of the toolbar based on OS recommended values. The values for this can be "regular", "small" or "default".

Definition

string toolbar.size
state
Description

Gets or sets the style of the toolbar, the values can be "iconandlabel", "icon" "default" or "label".

Definition

string toolbar.state