<!-- saved from url=(0026)http://www.naturaldocs.org -->
<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxToolbar"></a>mxToolbar</h1><divclass=CBody><p>Creates a toolbar inside a given DOM node. The toolbar may contain icons, buttons and combo boxes.</p><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxToolbar">mxToolbar</a></td><tdclass=SDescription>Creates a toolbar inside a given DOM node. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxToolbar.Events">Events</a></td><tdclass=SDescription></td></tr><trclass="SEvent SIndent2 SMarked"><tdclass=SEntry><ahref="#mxToolbar.mxEvent.SELECT">mxEvent.<wbr>SELECT</a></td><tdclass=SDescription>Fires when an item was selected in the toolbar. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxToolbar.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxToolbar.mxToolbar"id=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">mxToolbar</a></td><tdclass=SDescription>Constructs a toolbar in the specified container.</td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxToolbar.Variables">Variables</a></td><tdclass=SDescription></td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxToolbar.container"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">container</a></td><tdclass=SDescription>Reference to the DOM nodes that contains the toolbar.</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxToolbar.enabled"id=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">enabled</a></td><tdclass=SDescription>Specifies if events are handled. </td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxToolbar.noReset"id=link4onMouseOver="ShowTip(event, 'tt4', 'link4')"onMouseOut="HideTip('tt4')">noReset</a></td><tdclass=SDescription>Specifies if <ahref="#mxToolbar.resetMode"class=LFunctionid=link5onMouseOver="ShowTip(event, 'tt5', 'link5')"onMouseOut="HideTip('tt5')">resetMode</a> requires a forced flag of true for resetting the current mode in the toolbar. </td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxToolbar.updateDefaultMode"id=link6onMouseOver="ShowTip(event, 'tt6', 'link6')"onMouseOut="HideTip('tt6')">updateDefaultMode</a></td><tdclass=SDescription>Boolean indicating if the default mode should be the last selected switch mode or the first inserted switch mode. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxToolbar.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxToolbar.addItem"id=link7onMouseOver="ShowTip(event, 'tt7', 'link7')"onMouseOut="HideTip('tt7')">addItem</a></td><tdclass=SDescription>Adds the given function as an image with the specified title and icon and returns the new image node.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxToolbar.addCombo"id=link8onMouseOver="ShowTip(event, 'tt8', 'link8')"onMouseOut="HideTip('tt8')">addCombo</a></td><tdclass=SDescription>Adds and returns a new SELECT element using the given style. </td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxToolbar.addCombo">addCombo</a></td><tdclass=SDescription>Adds and returns a new SELECT element using the given title as the default element. </td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxToolbar.addOption"id=link9onMouseOver="ShowTip(event, 'tt9', 'link9')"onMouseOut="HideTip('tt9')">addOption</a></td><tdclass=SDescription>Adds and returns a new OPTION element inside the given SELECT element. </td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxToolbar.addSwitchMode"id=link10onMouseOver="ShowTip(event, 'tt10', 'link10')"onMouseOut="HideTip('tt10'
<divclass="CEvent"><divclass=CTopic><h3class=CTitle><aname="mxToolbar.mxEvent.SELECT"></a>mxEvent.<wbr>SELECT</h3><divclass=CBody><p>Fires when an item was selected in the toolbar. The <code>function</code> property contains the function that was selected in <ahref="#mxToolbar.selectMode"class=LFunctionid=link18onMouseOver="ShowTip(event, 'tt12', 'link18')"onMouseOut="HideTip('tt12')">selectMode</a>.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxToolbar.mxToolbar"></a>mxToolbar</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function mxToolbar(</td><tdclass=PParameternowrap>container</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Constructs a toolbar in the specified container.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>container</td><tdclass=CDLDescription>DOM node that contains the toolbar.</td></tr></table></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxToolbar.container"></a>container</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxToolbar.prototype.container</td></tr></table></blockquote><p>Reference to the DOM nodes that contains the toolbar.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxToolbar.enabled"></a>enabled</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxToolbar.prototype.enabled</td></tr></table></blockquote><p>Specifies if events are handled. Default is true.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxToolbar.noReset"></a>noReset</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxToolbar.prototype.noReset</td></tr></table></blockquote><p>Specifies if <ahref="#mxToolbar.resetMode"class=LFunctionid=link19onMouseOver="ShowTip(event, 'tt5', 'link19')"onMouseOut="HideTip('tt5')">resetMode</a> 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.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxToolbar.updateDefaultMode"></a>updateDefaultMode</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxToolbar.prototype.updateDefaultMode</td></tr></table></blockquote><p>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.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxToolbar.addItem"></a>addItem</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxToolbar.prototype.addItem = function(</td><tdclass=PParameternowrap>title,</td></tr><tr><td></td><tdclass=PParameternowrap>icon,</td></tr><tr><td></td><tdclass=PParameternowrap>funct,</td></tr><tr><td></td><tdclass=PParameternowrap>pressedIcon,</td></tr><tr><td></td><tdclass=PParameternowrap>style,</td></tr><tr><td></td><tdclass=PParameternowrap>factoryMethod</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds the given function as an image with the specified title and icon and returns the new image node.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>title</td><tdclass=CDLDescription>Optional string that is used as the tooltip.</td></tr><tr><tdclass=CDLEntry>icon</td><tdclass=CDLDescription>Optional URL of the image to be used. If no URL is given, then a button is created.</td></tr><tr><tdclass=CDLEntry>funct</td><tdclass=CDLDescription>Function to execute on a mouse click.</td></tr><tr><tdclass=CDLEntry>pressedIcon</td><tdclass=CDLDescription>Optional URL of the pressed image. Default is a gray background.</td></tr><tr><tdclass=CDLEntry>style</td><tdclass=CDLDescription>Optional style classname. Default is mxToolbarItem.</td></tr><tr><tdclass=CDLEntry>factoryMethod</td><tdclass=CDLDescription>Optional factory method for popup menu, eg. function(menu, evt, cell) { menu.addItem(‘Hello, World!’); }</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxToolbar.addCombo"></a>addCombo</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxToolbar.prototype.addCombo = function(</td><tdclass=PParameternowrap>style</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds and returns a new SELECT element using the given style. The element is placed inside a DIV with the mxToolbarComboContainer style classname.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>style</td><tdclass=CDLDescription>Optional style classname. Default is mxToolbarCombo.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxToolbar.addCombo"></a>addCombo</h3><divclass=CBody><p>Adds and returns a new SELECT element using the given title as the default element. The selection is reset to this element after each change.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>title</td><tdclass=CDLDescription>String that specifies the title of the default element.</td></tr><tr><tdclass=CDLEntry>style</td><tdclass=CDLDescription>Optional style classname. Default is mxToolbarCombo.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxToolbar.addOption"></a>addOption</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxToolbar.prototype.addOption = function(</td><tdclass=PParameternowrap>combo,</td></tr><tr><td></td><tdclass=PParameternowrap>title,</td></tr><tr><td></td><tdclass=PParameternowrap>value</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>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.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>combo</td><tdclass=CDLDescription>SELECT element that will contain the new entry.</td></tr><tr><tdclass=CDLEntry>title</td><tdclass=CDLDescription>String that specifies the title of the option.</td></tr><tr><tdclass=CDLEntry>value</td><tdclass=CDLDescription>Specifies the value associated with this option.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxToolbar.addSwitchMode"></a>addSwitchMode</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxToolbar.prototype.addSwitchMode = function(</td><tdclass=PParameternowrap>title,</td></tr><tr><td></td><tdclass=PParameternowrap>icon,</td></tr><tr><td></td><tdclass=PParameternowrap>funct,</td></tr><tr><td></td><tdclass=PParameternowrap>pressedIcon,</td></tr><tr><td></td><tdclass=PParameternowrap>style</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds a new selectable item to the toolbar. Only one switch mode item may be selected at a time. The currently selected item is the default item after a reset of the toolbar.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxToolbar.addMode"></a>addMode</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxToolbar.prototype.addMode = function(</td><tdclass=PParameternowrap>title,</td></tr><tr><td></td><tdclass=PParameternowrap>icon,</td></tr><tr><td></td><tdclass=PParameternowrap>funct,</td></tr><tr><td></td><tdclass=PParameternowrap>pressedIcon,</td></tr><tr><td></td><tdclass=PParameternowrap>style,</td></tr><tr><td></td><tdclass=PParameternowrap>toggle</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>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.</p><p>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.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxToolbar.selectMode"></a>selectMode</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxToolbar.prototype.selectMode = function(</td><tdclass=PParameternowrap>domNode,</td></tr><tr><td></td><tdclass=PParameternowrap>funct</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Resets the state of the previously selected mode and displays the given DOM node as selected. This function fires a select event with the given function as a parameter.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxToolbar.resetMode"></a>resetMode</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxToolbar.prototype.resetMode = function(</td><tdclass=PParameternowrap>forced</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Selects the default mode and resets the state of the previously selected mode.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxToolbar.addSeparator"></a>addSeparator</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxToolbar.prototype.addSeparator = function(</td><tdclass=PParameternowrap>icon</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds the specifies image as a separator.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>icon</td><tdclass=CDLDescription>URL of the separator icon.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxToolbar.addBreak"></a>addBreak</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxToolbar.prototype.addBreak = function()</td></tr></table></blockquote><p>Adds a break to the container.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxToolbar.addLine"></a>addLine</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxToolbar.prototype.addLine = function()</td></tr></table></blockquote><p>Adds a horizontal line to the container.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxToolbar.destroy"></a>destroy</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxToolbar.prototype.destroy = function ()</td></tr></table></blockquote><p>Removes the toolbar and all its associated resources.</p></div></div></div>
</div><!--Content-->
<divid=Footer><ahref="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
<divclass=CToolTipid="tt1"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function mxToolbar(</td><tdclass=PParameternowrap>container</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Constructs a toolbar in the specified container.</div></div><divclass=CToolTipid="tt2"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxToolbar.prototype.container</td></tr></table></blockquote>Reference to the DOM nodes that contains the toolbar.</div></div><divclass=CToolTipid="tt3"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxToolbar.prototype.enabled</td></tr></table></blockquote>Specifies if events are handled. </div></div><divclass=CToolTipid="tt4"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxToolbar.prototype.noReset</td></tr></table></blockquote>Specifies if resetMode requires a forced flag of true for resetting the current mode in the toolbar. </div></div><divclass=CToolTipid="tt5"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxToolbar.prototype.resetMode = function(</td><tdclass=PParameternowrap>forced</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Selects the default mode and resets the state of the previously selected mode.</div></div><divclass=CToolTipid="tt6"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxToolbar.prototype.updateDefaultMode</td></tr></table></blockquote>Boolean indicating if the default mode should be the last selected switch mode or the first inserted switch mode. </div></div><divclass=CToolTipid="tt7"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxToolbar.prototype.addItem = function(</td><tdclass=PParameternowrap>title,</td></tr><tr><td></td><tdclass=PParameternowrap>icon,</td></tr><tr><td></td><tdclass=PParameternowrap>funct,</td></tr><tr><td></td><tdclass=PParameternowrap>pressedIcon,</td></tr><tr><td></td><tdclass=PParameternowrap>style,</td></tr><tr><td></td><tdclass=PParameternowrap>factoryMethod</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Adds the given function as an image with the specified title and icon and returns the new image node.</div></div><divclass=CToolTipid="tt8"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxToolbar.prototype.addCombo = function(</td><tdclass=PParameternowrap>style</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Adds and returns a new SELECT element using the given style. </div></div><divclass=CToolTipid="tt9"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxToolbar.prototype.addOption = function(</td><tdclass=PParameternowrap>combo,</td></tr><tr><td></td><tdclass=PParameternowrap>title,</td></tr><tr><td></td><tdclass=PParameternowrap>value</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Adds and returns a new OPTION element inside the given SELECT element. </div></div><divclass=CToolTipid="tt10"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr