RasterToolbar( [parent [, size]] )
Creates a toolbar. Toolbars are usually placed in DIV elements somewhere in the document. Theid
of the DIV is given to the constructor
via the parent
argument.
Toolbars will take all the horizontal space of its parent container. The height of the parent container should be set according to the toolbar's size (see
size
argument below).
The next code fragment illustrates how to create a commands in a group and add the commands to a toolbar:
// create command group
var commands = RasterCommand.createGroup
( myHandler )
// add commands to the group
// args: id icon icon32 text
commands.add( "new", ICONS16.PAGE, null, "New" );
commands.add( "open", ICONS16.FOLDER, null, "Open" );
commands.add( "save", ICONS16.FLOPPY, null, "Save" );
// Create toolbar in DIV#toolbar container
var tBar = new RasterToolbar("toolbar", "small");
tBar.add( commands('new') );
tBar.add( commands('open') );
tBar.add( commands('save') );
:
<body>
<div id="toolbar" style="height:28px"></div>
Parameters
Name | Type | Description | |
---|---|---|---|
parent | object | optional |
One of the following: a string containing the ID
of a DOM element, a reference to a DOM element, or another
control object. If this argument is null , the control is
created but not attached to the DOM tree.
The RasterControl.setParent() method can be used later to
specify a parent container. |
size | string | optional |
Specifies the size of the toolbar. The possible
values are "small ", "medium ", or
"large ".
null or not set, a small toolbar is created.
This argument is not case-sensitive. |