The Toolbar Object
var toolBar1 = new TToolBar('IconTitle', null, true);
var toolBar2 = new TToolBar('Icon', null, false);
var wndToolbarSample = createWindow('Toolbar Sample');

toolBar1.add('upload', 'Upload', 'images/upload.png');
toolBar1.add('refresh', 'Refresh', 'images/refresh.png');
toolBar1.add('settings', 'Settings', 'images/settings.png');
toolBar1.add('help', 'Help', 'images/help.png');
toolBar1.add('close', 'Close', 'images/exit.png');

toolBar2.add('upload', 'Upload', 'images/upload.png');
toolBar2.add('refresh', 'Refresh', 'images/refresh.png');
toolBar2.insertSeparator();
toolBar2.add('settings', 'Settings', 'images/settings.png');
toolBar2.add('help', 'Help', 'images/help.png');
toolBar2.insertSeparator();
toolBar2.add('close', 'Close', 'images/exit.png');

wndToolbarSample.add(new TText('IconTitle mode Toolbar:'));
wndToolbarSample.add(toolBar1);
wndToolbarSample.add(new TText('Icon mode Toolbar:'));
wndToolbarSample.add(toolBar2);
showModal(wndToolbarSample);

Toolbar constructor takes four parameters:

var toolBar = new TToolBar(mode, backgroundColor, roundedCorners, padding);

Toolbar Methods and Properties
Method/Property Description
add Adds items to the list. Form:

add(itemId, ItemTitle, icon, highlightedIcon, activeIcon, callback)

Where:
  • itemId is the item identity. Tip: you may use: TUniqueId.getUniqueId() to generate identity.
  • ItemTitle is the item title.
  • icon is the main item icon URL (size 24*24).
  • highlightedIcon is the highlighted item icon URL.
  • activeIcon is the active item icon URL.
  • callback is the click event handler that will be called when the item is clicked.
disable Disables an item button by item id. Form:disable(itemId)
enable Enables an item button by item id. Form:enable(itemId)
insertSeparator Inserts a line seperator between items
setBackgroundColor Sets background color of the toolbar object. Form:
setBackgroundColor(color)
setDirection Sets the direction of the toolbar object from left to right ltr or from right to left rtl. Default value is ltr
setPadding Sets toolbar padding between items
setRoundedCorners Sets rounded corners for the toolbar object. Form:
setRoundedCorners(degree)