This project is read-only.



Adds a button to the toolbar.


of_addButton(String name, {String image}, {String toolTip}, {Integer position})


Name Type Description
name String The name of the button to be added. The name is also the text displayed for a toolbar button when display text is enabled
image String The name of the image file to be displayed for the button. This parameter is optional and has no default value. The valid fileTypes are GIF, PNG, JPG, BMP, WMF and RLE. Support for PB internal pictures has been added, i.e. Open!, Comment!, etc.
toolTip String The text to be used when displaying the button's toolTip. This parameter is optional and defaults to the button's name
position Integer Indicates which "side" of the toolbar to which the button is to be anchored. Values allowed for this parameter are LEFT (1) and RIGHT (2). This parameter is optional and the default value is LEFT

Return Value

Returns a long containing the index of the item.


While the name parameter is NOT optional, it can have an empty value. When the name is empty, the program assigns the name using "ToolBarItem" + String(item), i.e. if the item is the 3rd item added the name will be "ToolBarItem_3".

Another consideration when using this method is that when using the RIGHT position, buttons are added from right-to-left, like a pop stack. When buttons are added using the LEFT position, they are added left-to-right.


of_addButton('',     'open.bmp',     LEFT)
of_addButton('Save', 'save.bmp',     LEFT)
of_addButton('Exit', 'powerOff.bmp', 'Close the window', RIGHT)


of_addButton('Exit', 'powerOff.bmp', 'Close the window', RIGHT)
of_addButton('Save', 'save.bmp',     RIGHT)
of_addButton('',     'open.bmp',     RIGHT)


See Also

Last edited Sep 28, 2016 at 12:25 PM by cjharris02892, version 5