toolbar.js

Basic Toolbar control


Objects

Methods

CSS slasses


Toolbar()

Creates a Toolbar. Its main DIV is accessible as toolbar.div.

Toolbar::addIcon(twoStates, imagePath, tooltip, callback)

Adds a new icon to Toolbar. If twoStates == true, than this icon will have two states (otherwise 1). This icon will have image located at imagePath, it will display tooltip onHover and clicking it will execute callback (with state #, 0 or 1, as an argument).

Toolbar::addSeparator()

Adds a separator.

var callback = function(state) { alert(state); }
var t = new Toolbar();
t.addIcon(true, "", "some tooltip", callback);
document.body.appendChild(t.div);