PERGOLA LOGO

pergola.Menu

System events: YES.

User events and functions: NO (callback functions are defined for each of the menu items defined in the initialization object).

An object requiring an instance of this class must also define a Menubar instance, which manages the layout of the contained menus. The menu bar may not be visible. See also Menu in the tutorial.

Example.

Listed: class properties/methods; prototype properties and methods; instance properties. Prototype properties and methods inherited by the Class superclass are not listed.

class

active

false – boolean; used by system to collapse open menu lists.

handle

null – reference to current menu (open or highlighted).

prototype

PROPERTIES

parent

pergola.user. When defining a menu as a component of a Window instance you don't need to specify the parent node as it is automatically overridden. When defining a system menu you must specify pergola.menubar.container as parent node.

"font-size"

Defined in pergola.presentationAttributes – string or number (user space units).

fill

Defined in pergola.presentationAttributes – string.

stroke

Defined in pergola.presentationAttributes – string.

rx

Defined in pergola.presentationAttributes – number (user space units).

textFill

Defined in pergola.presentationAttributes (text object property) – string.

METHODS

close(evt)

Collapses active menu. You never need to invoke this method explicitly.

handleEvent(evt)

build(object)

this inherits the properties specified in object. Prototype properties specified in object are overridden. Creates elements. Returns this.

instance

name

String. If not passed to the constructor, gets a generated XML name (Class).

id

String. The return value of this name.toXML(). This container ID. Used as prefix where other elements' IDs are attributed.

owner

Must be specified in the initialization object, designates the owner object.

parent

If specified, overrides the default parent node pergola.user. When defining a menu as a component of a Window instance you don't need to specify the parent node. When defining a system menu you must specify pergola.menubar.container as parent node.

container

<g> element.

button

<rect> element.

list

pergola.MenuList instance, which inherits and builds this items.

items

Must be specified in the initialization object; an object defining menu items object properties. The pergola.MenuItem instances are built by (and are properties of) this list.