{column:width=80px}{column}{column}{column}
Property Summary
{column:width=80px}{column}{column}{column}
Method Summary
void
doClick()
Script the selection (emulate a mouse click) of the item.
void
set(text, method, selected, arguments, icon, key, mnemonic, enabled, visible)
Define the item with a text and a global method.
void
setAccelerator(key)
Set the accelerator key of the item.
void
setArguments(arguments)
Set the arguments that can be read by the defined method.
void
setEnabled(enabled)
Enable/disable the item.
void
setIcon(icon)
Set the icon of the item.
void
setMnemonic(key)
Set the mnemonic key of the item.
void
setSelected(selected)
Set the item selected.
void
setVisible(visible)
Set the item visible.
{column:width=100%}{column}
Property Details
Replace with description
Parameters
Also see
External links
Sample
{column:width=100%}{column}
Method Details
void
doClick
()
Script the selection (emulate a mouse click) of the item...
Parameters
Returns
void
Also see
External links
Sample
// Script the selection (emulate a mouse click) of the item... // Clicking a separator will throw an error! plugins.menubar.getMenu(2).getItem(0).doClick();
void
set
(text, method, selected, arguments, icon, key, mnemonic, enabled, visible)
Define the item with a text and a global method. Arguments, icon, accelerator, mnemonic key, visibility and enabling are optional...
Parameters
text
method
[selected]
[arguments]
[icon]
[key]
[mnemonic]
[enabled]
[visible]
Returns
void
Also see
External links
Sample
// Define the item with a text and a global method. Arguments, icon, accelerator, mnemonic key, visibility and enabling are optional... // get the menu at the last index // indexes start at 0 (zero) so index 2 is in fact position 3 var menu = plugins.menubar.getMenu(plugins.menubar.getMenuCount() - 1); // when you don't define an index the checkbox will be added at the last position // this is what you usually do to build a new menu var checkbox = menu.addCheckBox(); // create the settings for the specified menu item // minimum settings are the text and method properties // the method can be a global or form method // be sure to enter the method WITHOUT '()' at the end checkbox.set("checkbox with feedback",feedback_checkbox); var checkbox = menu.addCheckBox(); // set the checkbox to selected checkbox.set("checkbox selected",feedback_checkbox, true); var checkbox = menu.addCheckBox(); // add an 'input' array. the array will be concatenated to the end of the arguments // array which can be read out in the selected method var input = [1,"is","the","added","input",false]; checkbox.set("checkbox with input",feedback_checkbox,false,input); var checkbox = menu.addCheckBox(); // add an icon to the item checkbox.set("checkbox with icon",feedback_checkbox,false,input,"media:///yourimage.gif"); var checkbox = menu.addCheckBox(); // add an accelerator key ('alt shift a' in the below example) // REMARK: always test the accelerator key. sometimes they will not work because // these keys already have an 'action' assigned to them via the operating system. checkbox.set("checkbox with accelerator",feedback_checkbox,false,input,"media:///yourimage.gif","alt shift a"); var checkbox = menu.addCheckBox(); // add a mnemonic key ('i' in our example) which is the underlined shortkey on windows // REMARK: setting the mnemonic key is platform dependent checkbox.set("checkbox with mnemonic",feedback_checkbox,false,input,"media:///yourimage.gif","a","i"); var checkbox = menu.addCheckBox(); // disable the menu item checkbox.set("checkbox disabled",feedback_checkbox,false,input,"media:///yourimage.gif","control 3","t",false); var checkbox = menu.addCheckBox(); // set the menu item to be visible checkbox.set("checkbox visible",feedback_checkbox,false,input,"media:///yourimage.gif","meta 4","e",true,true); var checkbox = menu.addCheckBox(); // set the menu item disabled and NOT visible checkbox.set("checkbox invisible",feedback_checkbox,false,input,"media:///yourimage.gif","alt 5","m",false,false); // add a separator at the last position or at a given index menu.addSeparator(); // WIZARD // You can use the menubar wizard solution found in application_server/solutions/servoy_wizard_menubar.servoy to create your menu // The wizard will help you at least to learn how to use the plugin and will help you to find the correct // accelerator key string
void
setAccelerator
(key)
Set the accelerator key of the item...
Parameters
key
Returns
void
Also see
External links
Sample
var menu = plugins.menubar.getMenu(2).getCheckBox(0); // Set the text of the item... menu.setText("IT2Be"); // Set the item selected... menu.setSelected(true); // Set the arguments that can be read by the defined method... - array elements will be passed as arguments 4, 5 and so on to the callback method menu.setArguments(["a","b"]); // Set the icon of the item... menu.setIcon("media:///yourimage.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);
void
setAlign
()
Replace with description
Parameters
Returns
void
Also see
External links
Sample
void
setArguments
(arguments)
Set the arguments that can be read by the defined method...
Parameters
arguments
Returns
void
Also see
External links
Sample
var menu = plugins.menubar.getMenu(2).getCheckBox(0); // Set the text of the item... menu.setText("IT2Be"); // Set the item selected... menu.setSelected(true); // Set the arguments that can be read by the defined method... - array elements will be passed as arguments 4, 5 and so on to the callback method menu.setArguments(["a","b"]); // Set the icon of the item... menu.setIcon("media:///yourimage.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);
void
setEnabled
(enabled)
Enable/disable the item...
Parameters
enabled
Returns
void
Also see
External links
Sample
var menu = plugins.menubar.getMenu(2).getCheckBox(0); // Set the text of the item... menu.setText("IT2Be"); // Set the item selected... menu.setSelected(true); // Set the arguments that can be read by the defined method... - array elements will be passed as arguments 4, 5 and so on to the callback method menu.setArguments(["a","b"]); // Set the icon of the item... menu.setIcon("media:///yourimage.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);
void
setIcon
(icon)
Set the icon of the item...
Parameters
icon
Returns
void
Also see
External links
Sample
var menu = plugins.menubar.getMenu(2).getCheckBox(0); // Set the text of the item... menu.setText("IT2Be"); // Set the item selected... menu.setSelected(true); // Set the arguments that can be read by the defined method... - array elements will be passed as arguments 4, 5 and so on to the callback method menu.setArguments(["a","b"]); // Set the icon of the item... menu.setIcon("media:///yourimage.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);
void
setMnemonic
(key)
Set the mnemonic key of the item...
Parameters
key
Returns
void
Also see
External links
Sample
var menu = plugins.menubar.getMenu(2).getCheckBox(0); // Set the text of the item... menu.setText("IT2Be"); // Set the item selected... menu.setSelected(true); // Set the arguments that can be read by the defined method... - array elements will be passed as arguments 4, 5 and so on to the callback method menu.setArguments(["a","b"]); // Set the icon of the item... menu.setIcon("media:///yourimage.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);
void
setSelected
(selected)
Set the item selected...
Parameters
selected
Returns
void
Also see
External links
Sample
void
setVisible
(visible)
Set the item visible...
Parameters
visible
Returns
void
Also see
External links
Sample
var menu = plugins.menubar.getMenu(2).getCheckBox(0); // Set the text of the item... menu.setText("IT2Be"); // Set the item selected... menu.setSelected(true); // Set the arguments that can be read by the defined method... - array elements will be passed as arguments 4, 5 and so on to the callback method menu.setArguments(["a","b"]); // Set the icon of the item... menu.setIcon("media:///yourimage.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);