Child pages
  • MenuItem
Skip to end of metadata
Go to start of metadata


Constants Summery
Number #ALIGN_CENTER
Number #ALIGN_LEFT
Number #ALIGN_RIGHT

Property Summery
Boolean #enabled
Object[] #methodArguments
Set the arguments that can be read by the defined method.
String #name
Boolean #selected
String #text

Method Summery
void #doClick()
Script the selection (emulate a mouse click) of the item.
MenuItem #setAccelerator(key)
Set the accelerator key of the item.
MenuItem #setIcon(icon)
Set the icon of the item.
MenuItem #setMethod(method)
Set the method for the item.
MenuItem #setMnemonic(key)
Set the mnemonic key of the item.
MenuItem #setVisible(visible)
Set the item visible.

Constants Details
Replace with description
Returns
Number
Replace with description
Returns
Number
Replace with description
Returns
Number

Property Details
Replace with description
Returns
Boolean
Set the arguments that can be read by the defined method.
Returns
Object[]
Sample
var menu = plugins.window.getMenu(2).getItem(0);
// Set the text of the item.
menu.setText("Servoy");
// Set the method for the item.
menu.setMethod(callback);
// Set the arguments that can be read by the defined method. - array elements will be passed as arguments 5, 6 and so on to the callback method
menu.methodArguments = ["a","b"];
// Set the icon of the item.
menu.setIcon("media:///TipOfTheDay16.gif");
// Set the accelerator key of the item.
menu.setAccelerator("meta 4");
// Set the mnemonic key of the item.
menu.setMnemonic("e");
// Enable/disable the item.
menu.setEnabled(false);
// Set the item visible.
menu.setVisible(true);
Replace with description
Returns
String
Replace with description
Returns
Boolean
Replace with description
Returns
String

Method Details

void doClick ()

Script the selection (emulate a mouse click) of the item.
Returns
void
Sample
// Script the selection (emulate a mouse click) of the item.
// Clicking a separator will throw an error!
plugins.window.getMenu(2).getItem(0).doClick();

MenuItem setAccelerator (key)

Set the accelerator key of the item.
Parameters
key
Returns
MenuItem
Sample
var menu = plugins.window.getMenu(2).getItem(0);
// Set the text of the item.
menu.setText("Servoy");
// Set the method for the item.
menu.setMethod(callback);
// Set the arguments that can be read by the defined method. - array elements will be passed as arguments 5, 6 and so on to the callback method
menu.methodArguments = ["a","b"];
// Set the icon of the item.
menu.setIcon("media:///TipOfTheDay16.gif");
// Set the accelerator key of the item.
menu.setAccelerator("meta 4");
// Set the mnemonic key of the item.
menu.setMnemonic("e");
// Enable/disable the item.
menu.setEnabled(false);
// Set the item visible.
menu.setVisible(true);

MenuItem setIcon (icon)

Set the icon of the item.
Parameters
icon
Returns
MenuItem
Sample
var menu = plugins.window.getMenu(2).getItem(0);
// Set the text of the item.
menu.setText("Servoy");
// Set the method for the item.
menu.setMethod(callback);
// Set the arguments that can be read by the defined method. - array elements will be passed as arguments 5, 6 and so on to the callback method
menu.methodArguments = ["a","b"];
// Set the icon of the item.
menu.setIcon("media:///TipOfTheDay16.gif");
// Set the accelerator key of the item.
menu.setAccelerator("meta 4");
// Set the mnemonic key of the item.
menu.setMnemonic("e");
// Enable/disable the item.
menu.setEnabled(false);
// Set the item visible.
menu.setVisible(true);

MenuItem setMethod (method)

Set the method for the item.
Parameters
method
Returns
MenuItem
Sample
var menu = plugins.window.getMenu(2).getItem(0);
// Set the text of the item.
menu.setText("Servoy");
// Set the method for the item.
menu.setMethod(callback);
// Set the arguments that can be read by the defined method. - array elements will be passed as arguments 5, 6 and so on to the callback method
menu.methodArguments = ["a","b"];
// Set the icon of the item.
menu.setIcon("media:///TipOfTheDay16.gif");
// Set the accelerator key of the item.
menu.setAccelerator("meta 4");
// Set the mnemonic key of the item.
menu.setMnemonic("e");
// Enable/disable the item.
menu.setEnabled(false);
// Set the item visible.
menu.setVisible(true);

MenuItem setMnemonic (key)

Set the mnemonic key of the item.
Parameters
key
Returns
MenuItem
Sample
var menu = plugins.window.getMenu(2).getItem(0);
// Set the text of the item.
menu.setText("Servoy");
// Set the method for the item.
menu.setMethod(callback);
// Set the arguments that can be read by the defined method. - array elements will be passed as arguments 5, 6 and so on to the callback method
menu.methodArguments = ["a","b"];
// Set the icon of the item.
menu.setIcon("media:///TipOfTheDay16.gif");
// Set the accelerator key of the item.
menu.setAccelerator("meta 4");
// Set the mnemonic key of the item.
menu.setMnemonic("e");
// Enable/disable the item.
menu.setEnabled(false);
// Set the item visible.
menu.setVisible(true);

MenuItem setVisible (visible)

Set the item visible.
Parameters
visible
Returns
MenuItem
Sample
var menu = plugins.window.getMenu(2).getItem(0);
// Set the text of the item.
menu.setText("Servoy");
// Set the method for the item.
menu.setMethod(callback);
// Set the arguments that can be read by the defined method. - array elements will be passed as arguments 5, 6 and so on to the callback method
menu.methodArguments = ["a","b"];
// Set the icon of the item.
menu.setIcon("media:///TipOfTheDay16.gif");
// Set the accelerator key of the item.
menu.setAccelerator("meta 4");
// Set the mnemonic key of the item.
menu.setMnemonic("e");
// Enable/disable the item.
menu.setEnabled(false);
// Set the item visible.
menu.setVisible(true);
  • No labels