<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.write(vThis.parent.owner.text + " - "+ vThis.text);
  </method>
</canvas>
edit

See Also:

Attributes

Name Type (tag) Type (js) Default Category
defaultplacement string String mbarcontent read/write
   
height expression any 20 read/write
  the default height is 20 pixels
width expression any immediateparent.width + 1 read/write
  in a window, the menubar's width needs to extend one more pixel past its container ( which has the same width as the content ) so it's default width is immediateparent.width + 1

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