Class Menu
Object
|
+--Widget
|
+--Container
|
+--Menu
- class
Menu
- extends Container
Defined in menu.js
Constructor Summary |
Menu
()
The Menu constructor is inaccessible because menus must be
inserted into a special place in the document to make them work
properly.
|
Method Summary |
void
|
show(<Point> coords, <Rectangle> bounds)
Shows the menu at the given co-ordinates.
|
Methods inherited from class Container |
appendChild, clear, contains, insertAfter, insertAt, insertBefore, isEmpty, prependChild, removeChild, replaceChild, setLayout, setEnabled
|
Methods inherited from class Widget |
installContextMenu, installDefaultContextMenu, uninstallContextMenu, isDraggable, setDraggable, addEventListener, blur, createEventTable, dispose, focus, getAbsoluteBottom, getAbsoluteLeft, getAbsoluteRight, getAbsoluteTop, getBottom, getBounds, getClientHeight, getClientWidth, getCorner, getHeight, getLeft, getPixelsPerEm, getRight, getToolTip, getTop, getWidth, isDisposed, isEnabled, layout, moveToAbsolute, moveTo, raiseEvent, registerEventType, removeEventListener, setAbsoluteBottom, setAbsoluteLeft, setAbsoluteRight, setAbsoluteTop, setBottom, setBounds, setHeight, setLeft, setRight, setToolTip, setTop, setWidth, setParent, toString
|
Menu
function Menu()
The Menu
constructor is inaccessible because menus must be
inserted into a special place in the document to make them work
properly. To create a new menu, call
Menus.createMenu()
. It is an error to insert the
resulting widget into any other widget.
var c = new Container();
// Setup the container here
Create a new menu
var myMenu = Menus.createMenu();
// Add some menu items to the menu
myMenu.appendChild(new MenuItem('Item', null, function() { }));
// Install the menu as a context menu on the container.
c.installContextMenu(myMenu)
show
void show(<Point> coords, <Rectangle> bounds)
Shows the menu at the given co-ordinates.
Parameters:
coords
- the ideal point at which to put the top-left corner of the menu
bounds
- (Optional) - the bounds of a rectangle to avoid covering. This parameter should be used to specify the bounds of a button, or something, that was pressed to cause the menu to be shown. Defaults to a rectangle of zero width and height whose top-left corner is at coords
.
