Creates a toolbar inside a given DOM node. The toolbar may contain icons, buttons and combo boxes.
mxToolbar | Creates a toolbar inside a given DOM node. |
Events | |
mxEvent. | Fires when an item was selected in the toolbar. |
Functions | |
mxToolbar | Constructs a toolbar in the specified container. |
Variables | |
container | Reference to the DOM nodes that contains the toolbar. |
enabled | Specifies if events are handled. |
noReset | Specifies if resetMode requires a forced flag of true for resetting the current mode in the toolbar. |
updateDefaultMode | Boolean indicating if the default mode should be the last selected switch mode or the first inserted switch mode. |
Functions | |
addItem | Adds the given function as an image with the specified title and icon and returns the new image node. |
addCombo | Adds and returns a new SELECT element using the given style. |
addCombo | Adds and returns a new SELECT element using the given title as the default element. |
addOption | Adds and returns a new OPTION element inside the given SELECT element. |
addSwitchMode | Adds a new selectable item to the toolbar. |
addMode | Adds a new item to the toolbar. |
selectMode | Resets the state of the previously selected mode and displays the given DOM node as selected. |
resetMode | Selects the default mode and resets the state of the previously selected mode. |
addSeparator | Adds the specifies image as a separator. |
addBreak | Adds a break to the container. |
addLine | Adds a horizontal line to the container. |
destroy | Removes the toolbar and all its associated resources. |
Fires when an item was selected in the toolbar. The <code>function</code> property contains the function that was selected in selectMode.
mxToolbar.prototype.noReset
Specifies if resetMode requires a forced flag of true for resetting the current mode in the toolbar. Default is false. This is set to true if the toolbar item is double clicked to avoid a reset after a single use of the item.
mxToolbar.prototype.updateDefaultMode
Boolean indicating if the default mode should be the last selected switch mode or the first inserted switch mode. Default is true, that is the last selected switch mode is the default mode. The default mode is the mode to be selected after a reset of the toolbar. If this is false, then the default mode is the first inserted mode item regardless of what was last selected. Otherwise, the selected item after a reset is the previously selected item.
mxToolbar.prototype.addItem = function( title, icon, funct, pressedIcon, style, factoryMethod )
Adds the given function as an image with the specified title and icon and returns the new image node.
title | Optional string that is used as the tooltip. |
icon | Optional URL of the image to be used. If no URL is given, then a button is created. |
funct | Function to execute on a mouse click. |
pressedIcon | Optional URL of the pressed image. Default is a gray background. |
style | Optional style classname. Default is mxToolbarItem. |
factoryMethod | Optional factory method for popup menu, eg. function(menu, evt, cell) { menu.addItem(‘Hello, World!’); } |
mxToolbar.prototype.addOption = function( combo, title, value )
Adds and returns a new OPTION element inside the given SELECT element. If the given value is a function then it is stored in the option’s funct field.
combo | SELECT element that will contain the new entry. |
title | String that specifies the title of the option. |
value | Specifies the value associated with this option. |
mxToolbar.prototype.addMode = function( title, icon, funct, pressedIcon, style, toggle )
Adds a new item to the toolbar. The selection is typically reset after the item has been consumed, for example by adding a new vertex to the graph. The reset is not carried out if the item is double clicked.
The function argument uses the following signature: funct(evt, cell) where evt is the native mouse event and cell is the cell under the mouse.
Constructs a toolbar in the specified container.
function mxToolbar( container )
Reference to the DOM nodes that contains the toolbar.
mxToolbar.prototype.container
Specifies if events are handled.
mxToolbar.prototype.enabled
Specifies if resetMode requires a forced flag of true for resetting the current mode in the toolbar.
mxToolbar.prototype.noReset
Selects the default mode and resets the state of the previously selected mode.
mxToolbar.prototype.resetMode = function( forced )
Boolean indicating if the default mode should be the last selected switch mode or the first inserted switch mode.
mxToolbar.prototype.updateDefaultMode
Adds the given function as an image with the specified title and icon and returns the new image node.
mxToolbar.prototype.addItem = function( title, icon, funct, pressedIcon, style, factoryMethod )
Adds and returns a new SELECT element using the given style.
mxToolbar.prototype.addCombo = function( style )
Adds and returns a new OPTION element inside the given SELECT element.
mxToolbar.prototype.addOption = function( combo, title, value )
Adds a new selectable item to the toolbar.
mxToolbar.prototype.addSwitchMode = function( title, icon, funct, pressedIcon, style )
Adds a new item to the toolbar.
mxToolbar.prototype.addMode = function( title, icon, funct, pressedIcon, style, toggle )
Resets the state of the previously selected mode and displays the given DOM node as selected.
mxToolbar.prototype.selectMode = function( domNode, funct )
Adds the specifies image as a separator.
mxToolbar.prototype.addSeparator = function( icon )
Adds a break to the container.
mxToolbar.prototype.addBreak = function()
Adds a horizontal line to the container.
mxToolbar.prototype.addLine = function()
Removes the toolbar and all its associated resources.
mxToolbar.prototype.destroy = function ()