Child pages
  • Menu

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Hidden
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE


HTML Table
classservoy sSummery
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summery
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#text

HTML Table
classservoy sSummery
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summery
Table Body (tbody)
Table Row (tr)
Table Cell (td)
CheckBox
Table Cell (td)
#addCheckBox([name], [method], [icon], [mnemonic], [enabled], [align])
Add the Checkbox at the selected index (starting at 0) or add it at the end (empty).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Menu
Table Cell (td)
#addMenu([name], [menu], [icon], [mnemonic], [enabled], [align])
Add the submenu at the selected index (starting at 0) or add it at the end (empty).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
MenuItem
Table Cell (td)
#addMenuItem([name], [method], [icon], [mnemonic], [enabled], [align])
Add the item at the selected index (starting at 0) or add it at the end (empty).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
RadioButton
Table Cell (td)
#addRadioButton([name], [method], [icon], [mnemonic], [enabled], [align])
Add the Radiobutton at the selected index (starting at 0) or add it at the end (empty).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#addRadioGroup()
Add a Radiogroup for the Radiobuttons.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#addSeparator()
Add the separator at the selected index (starting at 0) or add it at the end (empty).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#doClick(click)
Script the selection (emulate a mouse click) of the menu.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
CheckBox
Table Cell (td)
#getCheckBox(index)
Get the Checkbox at the selected index (starting at 0).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
MenuItem
Table Cell (td)
#getItem(index)
Get the item at the selected index (starting at 0).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#getItemCount()
Get the number of items in the menu.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#getItemIndexByText(name)
Retrieve the index of the item by text.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Menu
Table Cell (td)
#getMenu(index)
Get the submenu at the selected index (starting at 0).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
RadioButton
Table Cell (td)
#getRadioButton(index)
Get the Radiobutton at the selected index (starting at 0).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#removeAllItems()
Remove all items from the menu.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#removeItem(index 1, [index 2-n])
Remove the item(s) at the selected index/indices.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#setEnabled(enabled)
Set the the selected menu enabled or disabled.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#setIcon(icon)
Set the icon of the menu.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#setMnemonic(mnemonic)
Set the mnemonic of the selected menu.

HTML Table
idproperty
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Property Details
Table Body (tbody)
idtext
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
iddes
Table Cell (td)
Replace with description
Table Row (tr)
idret
Table Cell (td)
Returns
String
Table Row (tr)
classlastDetailRow
Table Cell (td)


HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
idaddCheckBox
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
CheckBox
Span
stylefloat: left; font-weight: bold;
idiets
addCheckBox
Span
stylefloat: left;
idiets
([name], [method], [icon], [mnemonic], [enabled], [align])
Table Row (tr)
iddes
Table Cell (td)
Add the Checkbox at the selected index (starting at 0) or add it at the end (empty).
Table Row (tr)
idprs
Table Cell (td)
Parameters
[name]
[method]
[icon]
[mnemonic]
[enabled]
[align]
Table Row (tr)
idret
Table Cell (td)
Returns
CheckBox
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// Add the Checkbox at the selected index (starting at 0) or add it at the end (empty).
// get the menu at the last index
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.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
// 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
var checkbox = menu.addCheckBox("checkbox with feedback",feedback_checkbox);

var checkbox = menu.addCheckBox("checkbox selected",feedback_checkbox);
// set the checkbox to selected
checkbox.setSelected(true);

var checkbox = menu.addCheckBox("checkbox with input");

// 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.setMethod(feedback_checkbox, input);

// create a checkbox with an icon
var checkbox = menu.addCheckBox("checkbox with icon",feedback_checkbox,"media:///yourimage.gif");

var checkbox = menu.addCheckBox("checkbox with accelerator",feedback_checkbox,"media:///yourimage.gif");
// 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.setAccelerator("alt shift a");

var checkbox = menu.addCheckBox("checkbox with mnemonic",feedback_checkbox,false,input,"media:///yourimage.gif");
// add a mnemonic key  ('i' in our example) which is the underlined shortkey on windows
// REMARK: setting the mnemonic key is platform dependent
checkbox.setMnemonic("i");

var checkbox = menu.addCheckBox("checkbox disabled",feedback_checkbox);
// disable the menu item
checkbox.setEnabled(false);

var checkbox = menu.addCheckBox("checkbox invisible",feedback_checkbox);
// set the menu item disabled and NOT visible
checkbox.setVisible(false);

// add a separator at the last position or at a given index
menu.addSeparator();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddMenu
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Menu
Span
stylefloat: left; font-weight: bold;
idiets
addMenu
Span
stylefloat: left;
idiets
([name], [menu], [icon], [mnemonic], [enabled], [align])
Table Row (tr)
iddes
Table Cell (td)
Add the submenu at the selected index (starting at 0) or add it at the end (empty).
Table Row (tr)
idprs
Table Cell (td)
Parameters
[name]
[menu]
[icon]
[mnemonic]
[enabled]
[align]
Table Row (tr)
idret
Table Cell (td)
Returns
Menu
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// Add the submenu at the selected index (starting at 0) or add it at the end (empty).
// get the menu at the last index
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);

// add a (first) submenu
var submenu1 = menu.addMenu("submenu 1");
submenu1.addMenuItem("sub item 1",globals.feedback_item);

// add a (second) submenu
var submenu2 = submenu1.addMenu("submenu 2");
submenu2.addMenuItem("sub item 2",globals.feedback_item);

// add a (third) submenu
var submenu3 = submenu1.addMenu("submenu 3");
submenu3.addMenuItem("sub item 3",globals.feedback_item);

// add a (first) submenu to the (third) submenu
var submenu4 = submenu3.addMenu("submenu 4");
submenu4.addMenuItem("sub item 4",globals.feedback_item);

// add a (first) submenu to the (first) submenu of the (third) submenu
var submenu5 = submenu4.addMenu("submenu 5");
submenu5.addMenuItem("sub item 5",globals.feedback_item);
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddMenuItem
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
MenuItem
Span
stylefloat: left; font-weight: bold;
idiets
addMenuItem
Span
stylefloat: left;
idiets
([name], [method], [icon], [mnemonic], [enabled], [align])
Table Row (tr)
iddes
Table Cell (td)
Add the item at the selected index (starting at 0) or add it at the end (empty).
Table Row (tr)
idprs
Table Cell (td)
Parameters
[name]
[method]
[icon]
[mnemonic]
[enabled]
[align]
Table Row (tr)
idret
Table Cell (td)
Returns
MenuItem
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// Add the item at the selected index (starting at 0) or add it at the end (empty).
// get the menu at the last index
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);

// when you don't define an index the item will be added at the last position
// this is what you usually do to build a new menu
// 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
var item = menu.addMenuItem("item with feedback",globals.feedback_item);

var item = menu.addMenuItem();

// 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];

item.text = "item with input";
item.setMethod(globals.feedback_item,input);

var item = menu.addMenuItem();
// add an icon to the item
item.text = "item with icon";
item.setMethod(globals.feedback_item, input);
item.setIcon("media:///yourimage.gif");

var item = menu.addMenuItem();
// add an accelerator key ('alt shift 2' 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.
item.text = "item with accelerator";
item.setMethod(globals.feedback_item, input);
item.setIcon("media:///yourimage.gif");
item.setAccelerator("alt shift 2");

var item = menu.addMenuItem();
// add a mnemonic key  ('i' in our example) which is the underlined shortkey on windows
// REMARK: setting the mnemonic key is platform dependent
// the accelerator key will not work in this and the next example
item.text = "item with mnemonic";
item.setMethod(globals.feedback_item, input);
item.setIcon("media:///yourimage.gif");
item.setAccelerator("pressed COMMA");
item.setMnemonic("i");

// create a disabled menu item
var item = menu.addMenuItem("item disabled",globals.feedback_item,"media:///yourimage.gif","t",false);
// set the method args
item.setMethodArguments(input);

var item = menu.addMenuItem("item visible",globals.feedback_item,"media:///yourimage.gif","e");
// this accelerator key will work
item.setAccelerator("shift meta PAGE_DOWN");

var item = menu.addMenuItem("item invisible",globals.feedback_item,"media:///yourimage.gif");
// now the item is enabled and NOT visible
item.setVisible(false);

// add a separator at the last position or at a given index
menu.addSeparator();
return;
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddRadioButton
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
RadioButton
Span
stylefloat: left; font-weight: bold;
idiets
addRadioButton
Span
stylefloat: left;
idiets
([name], [method], [icon], [mnemonic], [enabled], [align])
Table Row (tr)
iddes
Table Cell (td)
Add the Radiobutton at the selected index (starting at 0) or add it at the end (empty).
Table Row (tr)
idprs
Table Cell (td)
Parameters
[name]
[method]
[icon]
[mnemonic]
[enabled]
[align]
Table Row (tr)
idret
Table Cell (td)
Returns
RadioButton
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// Add the Radiobutton at the selected index (starting at 0) or add it at the end (empty).
// get the menu at the last index
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);

// add a new Radiobutton group
// a group will 'bind' all added radiobuttons after the group together
// as a result checking one item will uncheck the other
menu.addRadioGroup();

// when you don't define an index the radiobutton will be added at the last position
// this is what you usually do to build a new menu

// 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
var radiobutton = menu.addRadioButton("radiobutton with feedback",feedback_radiobutton);

var radiobutton = menu.addRadioButton("radiobutton selected",feedback_radiobutton);
// set the radiobutton to selected
radiobutton.setSelected(true);

var radiobutton = menu.addRadioButton("radiobutton with input");

// 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];

radiobutton.setMethod(feedback_radiobutton,input);

// create an item with an icon
var radiobutton = menu.addRadioButton("radiobutton with icon",feedback_radiobutton,"media:///yourimage.gif");

var radiobutton = menu.addRadioButton("radiobutton with accelerator",feedback_radiobutton);
// add an accelerator key ('alt shift 3' 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.
radiobutton.setAccelerator("alt shift 3");

// add a separator at the last position or at a given index
menu.addSeparator();

// add a new Radiobutton group
menu.addRadioGroup();

// add a mnemonic key  ('i' in our example) which is the underlined shortkey on windows
// REMARK: setting the mnemonic key is platform dependent
var radiobutton = menu.addRadioButton("radiobutton with mnemonic",feedback_radiobutton,"media:///yourimage.gif","i");

var radiobutton = menu.addRadioButton("radiobutton disabled",feedback_radiobutton);
// disable the menu item
radiobutton.setEnabled(false);

var radiobutton = menu.addRadioButton("radiobutton invisible",feedback_radiobutton);
// now the item is enabled and NOT visible
radiobutton.setVisible(false);

// add a separator at the last position or at a given index
menu.addSeparator();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddRadioGroup
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
addRadioGroup
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Add a Radiogroup for the Radiobuttons.
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// Add a Radiogroup for the Radiobuttons.
// get the menu at the last index
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);

// add a new Radiobutton group
// a group will 'bind' all added radiobuttons after the group together
// as a result checking one item will uncheck the other
menu.addRadioGroup();

// when you don't define an index the radiobutton will be added at the last position
// this is what you usually do to build a new menu

// 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
var radiobutton = menu.addRadioButton("radiobutton with feedback",feedback_radiobutton);

var radiobutton = menu.addRadioButton("radiobutton selected",feedback_radiobutton);
// set the radiobutton to selected
radiobutton.setSelected(true);

var radiobutton = menu.addRadioButton("radiobutton with input");

// 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];

radiobutton.setMethod(feedback_radiobutton,input);

// create an item with an icon
var radiobutton = menu.addRadioButton("radiobutton with icon",feedback_radiobutton,"media:///yourimage.gif");

var radiobutton = menu.addRadioButton("radiobutton with accelerator",feedback_radiobutton);
// add an accelerator key ('alt shift 3' 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.
radiobutton.setAccelerator("alt shift 3");

// add a separator at the last position or at a given index
menu.addSeparator();

// add a new Radiobutton group
menu.addRadioGroup();

// add a mnemonic key  ('i' in our example) which is the underlined shortkey on windows
// REMARK: setting the mnemonic key is platform dependent
var radiobutton = menu.addRadioButton("radiobutton with mnemonic",feedback_radiobutton,"media:///yourimage.gif","i");

var radiobutton = menu.addRadioButton("radiobutton disabled",feedback_radiobutton);
// disable the menu item
radiobutton.setEnabled(false);

var radiobutton = menu.addRadioButton("radiobutton invisible",feedback_radiobutton);
// now the item is enabled and NOT visible
radiobutton.setVisible(false);

// add a separator at the last position or at a given index
menu.addSeparator();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddSeparator
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
addSeparator
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Add the separator at the selected index (starting at 0) or add it at the end (empty).
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// Add the separator at the selected index (starting at 0) or add it at the end (empty).
plugins.window.getMenu(0).addSeparator();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
iddoClick
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
doClick
Span
stylefloat: left;
idiets
(click)
Table Row (tr)
iddes
Table Cell (td)
Script the selection (emulate a mouse click) of the menu.
Table Row (tr)
idprs
Table Cell (td)
Parameters
click
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// Script the selection (emulate a mouse click) of the menu.
plugins.window.getMenu(0).doClick();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetCheckBox
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
CheckBox
Span
stylefloat: left; font-weight: bold;
idiets
getCheckBox
Span
stylefloat: left;
idiets
(index)
Table Row (tr)
iddes
Table Cell (td)
Get the Checkbox at the selected index (starting at 0).
Table Row (tr)
idprs
Table Cell (td)
Parameters
index
Table Row (tr)
idret
Table Cell (td)
Returns
CheckBox
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// Get the Checkbox at the selected index (starting at 0).
// get the menu at the last position
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);

var checkbox = menu.getCheckBox(0);

checkbox.setText("Changed menu item");

// REMARK: we actually changed an original menu (item)! As a result resetting the
// menubar will NOT reset the above changes. We need to reset the menu (item)
// manually the following way:

// get the menu
// var menu = plugins.window.getMenu(2);

// get the item
// var item = menu.getItem(0);

// reset the values to default
// notice we use an i18n message here the same way you would use it with
// standard Servoy methods and plugins
// item.setText("i18n:servoy.menuitem.viewAsRecord");
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetItem
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
MenuItem
Span
stylefloat: left; font-weight: bold;
idiets
getItem
Span
stylefloat: left;
idiets
(index)
Table Row (tr)
iddes
Table Cell (td)
Get the item at the selected index (starting at 0).
Table Row (tr)
idprs
Table Cell (td)
Parameters
index
Table Row (tr)
idret
Table Cell (td)
Returns
MenuItem
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// Get the item at the selected index (starting at 0).
// get the menu at the last position
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);

var item = menu.getItem(0);

item.setText("Changed menu item");

// REMARK: we actually changed an original menu (item)! As a result resetting the
// menubar will NOT reset the above changes. We need to reset the menu (item)
// manually the following way:

// get the menu
// var menu = plugins.window.getMenu(2);

// get the item
// var item = menu.getItem(0);

// reset the values to default
// notice we use an i18n message here the same way you would use it with
// standard Servoy methods and plugins
// item.setText("i18n:servoy.menuitem.viewAsRecord");
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetItemCount
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Number
Span
stylefloat: left; font-weight: bold;
idiets
getItemCount
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Get the number of items in the menu.
Table Row (tr)
idret
Table Cell (td)
Returns
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// Get the number of items in the menu.
// REMARK: indexes start at 0, disabled items, non visible items and seperators are counted also
// REMARK: this is especially important when getting items by the index
application.output(plugins.window.getMenu(0).getItemCount());
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetItemIndexByText
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Number
Span
stylefloat: left; font-weight: bold;
idiets
getItemIndexByText
Span
stylefloat: left;
idiets
(name)
Table Row (tr)
iddes
Table Cell (td)
Retrieve the index of the item by text.
Table Row (tr)
idprs
Table Cell (td)
Parameters
name
Table Row (tr)
idret
Table Cell (td)
Returns
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetMenu
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Menu
Span
stylefloat: left; font-weight: bold;
idiets
getMenu
Span
stylefloat: left;
idiets
(index)
Table Row (tr)
iddes
Table Cell (td)
Get the submenu at the selected index (starting at 0).
Table Row (tr)
idprs
Table Cell (td)
Parameters
index
Table Row (tr)
idret
Table Cell (td)
Returns
Menu
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// Get the submenu at the selected index (starting at 0).
// get the menu at the last position
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);

var checkbox = menu.getMenu(0);

checkbox.setText("Changed menu item");
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetRadioButton
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
RadioButton
Span
stylefloat: left; font-weight: bold;
idiets
getRadioButton
Span
stylefloat: left;
idiets
(index)
Table Row (tr)
iddes
Table Cell (td)
Get the Radiobutton at the selected index (starting at 0).
Table Row (tr)
idprs
Table Cell (td)
Parameters
index
Table Row (tr)
idret
Table Cell (td)
Returns
RadioButton
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// Get the Radiobutton at the selected index (starting at 0).
// get the menu at the last position
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);

var checkbox = menu.getItem(0);

checkbox.setText("Changed menu item");

// REMARK: we actually changed an original menu (item)! As a result resetting the
// menubar will NOT reset the above changes. We need to reset the menu (item)
// manually the following way:

// get the menu
// var menu = plugins.window.getMenu(2);

// get the item
// var item = menu.getItem(0);

// reset the values to default
// notice we use an i18n message here the same way you would use it with
// standard Servoy methods and plugins
// item.setText("i18n:servoy.menuitem.viewAsRecord");
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idremoveAllItems
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
removeAllItems
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Remove all items from the menu.
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// Remove all items from the menu.
// get the menu at the last index
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);

// remove all menu items from the selected menu
menu.removeAllItems();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idremoveItem
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
removeItem
Span
stylefloat: left;
idiets
(index 1, [index 2-n])
Table Row (tr)
iddes
Table Cell (td)
Remove the item(s) at the selected index/indices.
Table Row (tr)
idprs
Table Cell (td)
Parameters
index 1
[index 2-n]
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// Remove the item(s) at the selected index/indices.
// get the menu at the last index
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);

// remove only one item at the selected index
// from the selected menu
// menu.removeItem(0);

// remove more than one item at the selected indices
// from the selected menu
menu.removeItem(1,2);
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetEnabled
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
setEnabled
Span
stylefloat: left;
idiets
(enabled)
Table Row (tr)
iddes
Table Cell (td)
Set the the selected menu enabled or disabled.
Table Row (tr)
idprs
Table Cell (td)
Parameters
enabled
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// Set the the selected menu enabled or disabled.
var menu = plugins.window.getMenu(0);
menu.setText("Hello");
menu.setMnemonic("H");
menu.setEnabled(false);
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetIcon
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
setIcon
Span
stylefloat: left;
idiets
(icon)
Table Row (tr)
iddes
Table Cell (td)
Set the icon of the menu.
Table Row (tr)
idprs
Table Cell (td)
Parameters
icon
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetMnemonic
classnode
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
setMnemonic
Span
stylefloat: left;
idiets
(mnemonic)
Table Row (tr)
iddes
Table Cell (td)
Set the mnemonic of the selected menu.
Table Row (tr)
idprs
Table Cell (td)
Parameters
mnemonic
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// Set the mnemonic of the selected menu.
var menu = plugins.window.getMenu(0);
menu.setText("Hello");
menu.setMnemonic("H");
menu.setEnabled(false);
Table Row (tr)
classlastDetailRow
Table Cell (td)