The Menu Class

The Menu class represents a menu and is a direct subclass of Basecomponent. Its attributes are given in Table 9.1.

Table 9.1. The attributes of the Menu class
NameUsageTypeDefaultAccessibility
attachTag and JSstringbottomread-write
 Description. Specifies how a popup or floating menu attaches to a view. Valid values are “top”, “bottom”, “left”, and “right”.
openedTag and JSbooleanfalseread-write
 Description. Indicates whether or not this menu is open.

The following are the methods defined in the Menu class:

close()

Closes this menu and all its children.

createChildren(array)

Adds children specified in array to this menu.

getTopMenu()

Returns the topmost menu in the hierarchy.

open(open)

Shows this menu and other menus up in the hierarchy if open is true or hides them if open is false.

setOpen(open)

Shows this menu, without affecting other menus in the hierarchy, if open is true or close it if open is false.

Most of the time, you don’t need to do anything other than adding the menu tag to the menubar tag and inserting menu items. OpenLaszlo will take care of displaying the menu and menu items in the correct place.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset