<menubar>

A menubar that contains menus.

JavaScript: menubar

Extends Basecomponent

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.

Example 1. Simple menubar
<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>	
See Also:
Attributes

Attributes inherited from Basecomponent

doesenter, enabled, hasdefault, isdefault, style, styleable, text

Attributes inherited from Node

class, classroot, cloneManager, datapath, id, ignoreAttribute, ignoreplacement, immediateparent, initstage, name, nodeLevel, onconstruct, oninit, parent, placement, subnodes

Attributes inherited from View

aaactive, aadescription, aaname, aasilent, aatabindex, align, bgcolor, clickable, clickregion, clip, cursor, defaultplacement, fgcolor, focusable, focustrap, font, fontsize, fontstyle, frame, framesloadratio, hassetheight, hassetwidth, height, layout, loadratio, mask, onblur, onclick, ondata, ondblclick, onfocus, onkeydown, onkeyup, onmousedown, onmouseout, onmouseover, onmouseup, onselect, opacity, options, pixellock, play, resource, resourceheight, resourcewidth, rotation, selectiontype, showhandcursor, source, stretches, subviews, totalframes, unstretchedheight, unstretchedwidth, valign, visible, width, x, xoffset, y, yoffset


Methods

openMenu()
menubar.openMenu(menuref, openit)

opens ( or closes ) requested menu and closes any other menus that are currently opened

Parameters
Name Type Desc
menuref Menu the menu to be opened or closed
openit Boolean true to open menu, false to close it


Methods inherited from basecomponent

doEnterDown, doEnterUp, doSpaceDown, doSpaceUp, setStyle, setTint, updateDefault

Methods inherited from LzNode

animate, applyConstraint, applyData, childOf, completeInstantiation, createChildren, dataBindAttribute, destroy, determinePlacement, getAttribute, getOption, getUID, lookupSourceLocator, searchImmediateSubnodes, searchSubnodes, setAttribute, setDatapath, setID, setName, setOption

Methods inherited from LzView

addProxyPolicy, addSubview, bringToFront, construct, containsPt, getAttributeRelative, getBounds, getColor, getColorTransform, getContextMenu, getCurrentTime, getDepthList, getHeight, getID3, getMouse, getPan, getTotalTime, getVolume, getWidth, init, measureHeight, measureWidth, play, releaseLayouts, removeProxyPolicy, searchParents, searchSubviews, seek, sendBehind, sendInFrontOf, sendToBack, setAAActive, setAADescription, setAAName, setAASilent, setAATabIndex, setAlign, setAttributeRelative, setBGColor, setClickable, setColor, setColorTransform, setContextMenu, setCursor, setHeight, setLayout, setOpacity, setPan, setPlay, setResource, setResourceNumber, setRotation, setShowHandCursor, setSource, setValign, setVisible, setVolume, setWidth, setX, setY, shouldYieldFocus, stop, stretchResource, unload, updateResourceSize


Events

Events inherited from LzNode

onconstruct, ondata, oninit

Events inherited from LzView

onaddsubresource, onaddsubview, onblur, onclick, ondblclick, onerror, onfocus, onframe, onheight, onlastframe, onload, onmousedown, onmousedragin, onmousedragout, onmouseout, onmouseover, onmouseup, onmouseupoutside, onopacity, onplay, onremovesubview, onstop, ontimeout, onwidth, onx, ony