RasterMenu( [parent] )

Creates a popup menu. The next code fragment illustrates how to create a commands in a group and add the commands to a menu:
// create command group
var commands = RasterCommand.createGroup( myHandler )

// add commands to the group
// args:      id      icon           icon32  text
commands.add( "new",  ICONS16.PAGE,    null, "New" );
commands.add( "open", ICONS16.FOLDER,  null, "Open" );
commands.add( "save", ICONS16.FLOPPY,  null, "Save As..." );

// Disable the "save" command until there is something to save...
commands("save").setEnabled( false );

// create menu
var menu = new RasterMenu();

// Add commands to the menu
menu.add( commands("new") );
menu.add( commands("open") );
menu.add( commands("save") );

:

menu.showAt( 50, 50); //Show menu at given x,y coords.
 

Parameters

Name Type   Description
parent object optional One of the following: a string containing the ID of a DOM element, a reference to a DOM element, or another control object. If this argument is not specified or set null, the menu is created in the BODY element.
Home Examples Download License
 
Copyright © 2010-2017 Edwin R. López