<menubar>
A menubar that contains menus.

JavaScript: lz.menubar
extends <basecomponent> » <view> » <node> » lz.Eventable »

The <menubar> tag creates a menubar that can be placed within any view, but is most commonly found within a window. By default, a menubar adjusts to the width of its parent unless otherwise directed. Within a window a menubar has its own placement="menubar" so that it lives above the contents of the window.

<canvas debug="true" height="250">
  <debug y="120"/>
  <menubar width="200">
    <menu text="Menu 1" width="100">
      <menuitem text="Item 1" onselect="canvas.whichOne(this);"/>
      <menuitem text="Item 2" onselect="canvas.whichOne(this);"/>
      <menuitem text="Item 3" onselect="canvas.whichOne(this);"/>
      <menuseparator/>
      <menuitem text="Item 4" onselect="canvas.whichOne(this);"/>
    </menu>
    <menu text="Menu 2" width="100">
      <menuitem text="More items..." onselect="canvas.whichOne(this);"/>
    </menu>
  </menubar>

  <method name="whichOne" args="vThis">
    Debug.debug("%w - %w", vThis.parent.owner.text, vThis.text);
  </method>
</canvas>

See Also:

Methods

openMenu()
menubar.openMenu(menuref : Menu, openit : Boolean);
opens ( or closes ) requested menu and closes any other menus that are currently opened
Parameter Name Type Description
menuref Menu the menu to be opened or closed
openit Boolean true to open menu, false to close it

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy