A Button item can be easily added to the toolbar with the help of the following method:
<script> toolbar.addButton(id, pos, text, imgEnabled, imgDisabled); </script>
Parameters that should be passed are:
A Text Item can be added to the toolbar by calling addText() method:
<script> toolbar.addText(id, pos, text); </scrip>
The following parameters should be passed to this method:
There is one simple method that adds a Select Button to the toolbar:
<script> toolbar.addButtonSelect(id, pos, text, opts, imgEnabled, imgDisabled); </script>
The following parameters should be passed to this method:
The opts parameter requires more detailed description as the user should specify the following for each listed option:
Several options can be set at once as opts variable:
<script> var opts = [['id1', 'obj', 'option1', 'img1'], ['sep01', 'sep', '', ''], ['id2', 'obj', 'option2', 'img2'] ... ]; </script>
This line of code should be written before we invoke addButtonSelect() method. This code is very useful, as instead of writing all the arrays for the opts parameter in addButtonSelect() method, we can use opts variable, declared before.
The following method should be used to add a new Two-State Button:
<script> toolbar.addButtonTwoState(id, pos, text, imgEnabled, imgDisabled); </script>
The user should pass a number of parameters to this method:
Note: if the user wants the Two-State Button to be created text-free, it's necessary to write an empty string as text parameter.
A new Separator can be created by calling the following method:
<script> toolbar.addSeparator(id, pos); </script>
This method has two input parameters:
addSlider() method should be used to create a new Slider:
<script> toolbar.addSlider(id, pos, len, valueMin, valueMax, valueNow, textMin, textMax, tip); </script>
As for input parameters the user should set, they are as follows:
Note: if the user wants the Slider to be created tooltip text-free, it's necessary to write an empty string as tip parameter.
The following syntax shows the user how an Input item can be easily added:
<script> toolbar.addInput(id, pos, value, width); </script>
This method has the following input parameters:
Note: if the user wants the Input item to be created text-free, it's necessary to write an empty string as value parameter. For example:
<script> toolbar.addInput("input_new",3,"",100); </script>
A simple tool for item's removal from the toolbar is removeItem() method:
<script> toolbar.removeItem(itemId); </script>