Child pages
  • Menu

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{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{hidden}
{sub-section:description|text=}{sub-section}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[String]{td}{td}[#text]
Retrieve/set the text.{td}{tr}{tbody}{table}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[CheckBox]{td}{td}[#addCheckBox]\(\[name\], \[method\], \[icon\], \[mnemonic\], \[enabled\], \[align\])
Add the Checkbox)
Add a checkbox.{td}{tr}{tbody}{tbody}{tr}{td}[CheckBox]{td}{td}[#addCheckBox]\(index)
Add a checkbox at the selected index (starting at 0) or add it at the end (empty).{td}{tr}{tbody}{tbody}{tr}{td}[MenuCheckBox]{td}{td}[#addMenu#addCheckBox]\(\[name\], \[menu\], \[icon\], \[mnemonic\], \[enabled\], \[align\])
Add the submenuname)
Add a checkbox with given name.{td}{tr}{tbody}{tbody}{tr}{td}[CheckBox]{td}{td}[#addCheckBox]\(name, feedback_item)
Add a checkbox at the selected index (starting at 0) or add it at the end (empty).{td}{tr}{tbody}{tbody}{tr}{td}[MenuItemCheckBox]{td}{td}[#addMenuItem#addCheckBox]\(\[name\], \[method\]feedback_item, \[icon\], \[mnemonic\], \[enabled\], \[align\])
Add the itemicon)
Add a checkbox at the selected index (starting at 0) or add it at the end (empty).{td}{tr}{tbody}{tbody}{tr}{td}[RadioButtonCheckBox]{td}{td}[#addRadioButton#addCheckBox]\(\[name\], \[method\]feedback_item, \[icon\], \[mnemonic\], \[enabled\], \[align\])
Add thea Radiobuttoncheckbox at the selected index (starting at 0) or add it at the end (empty).{td}{tr}{tbody}{tbody}{tr}{td}void[CheckBox]{td}{td}[#addRadioGroup#addCheckBox]\(name, feedback_item, icon, mnemonic, enabled)
Add a Radiogroup forcheckbox at the selected index (starting at 0) or at the Radiobuttonsend.{td}{tr}{tbody}{tbody}{tr}{td}void[CheckBox]{td}{td}[#addSeparator#addCheckBox]\(name, feedback_item, icon, mnemonic, enabled, align)
Add thea separatorcheckbox at the selected index (starting at 0) or add it at the end (empty).{td}{tr}{tbody}{tbody}{tr}{td}void[Menu]{td}{td}[#doClick#addMenu]\(click)
Script the selection (emulate Add a mouse click) ofsubmenu at the menuend.{td}{tr}{tbody}{tbody}{tr}{td}[CheckBoxMenu]{td}{td}[#getCheckBox#addMenu]\(index)
GetAdd thea Checkboxsubmenu at the selected index (starting at 0).{td}{tr}{tbody}{tbody}{tr}{td}[ObjectMenu]{td}{td}[#getClientProperty#addMenu]\(keyname)
GetsAdd thea specifiedsubmenu clientwith property for the element based on a keygiven name.{td}{tr}{tbody}{tbody}{tr}{td}[MenuItem]{td}{td}[#getItem#addMenuItem]\(index)
Add Geta themenu item at the selected index (starting at 0).{td}{tr}{tbody}{tbody}{tr}{td}[NumberMenuItem]{td}{td}[#getItemCount#addMenuItem]\(index)
GetAdd a menu item at the number of items in selected index (starting at 0) or at the menuend.{td}{tr}{tbody}{tbody}{tr}{td}[NumberMenuItem]{td}{td}[#getItemIndexByText#addMenuItem]\(name)
RetrieveAdd thea indexmenu ofitem thewith itemgiven by textname.{td}{tr}{tbody}{tbody}{tr}{td}[MenuMenuItem]{td}{td}[#getMenu#addMenuItem]\(index)
Get the submenuname, feedback_item)
Add a menu item at the selected index (starting at 0) or at the end.{td}{tr}{tbody}{tbody}{tr}{td}[RadioButtonMenuItem]{td}{td}[#getRadioButton#addMenuItem]\(indexname, feedback_item, icon)
GetAdd a themenu Radiobuttonitem at the selected index (starting at 0) or at the end.{td}{tr}{tbody}{tbody}{tr}{td}void[MenuItem]{td}{td}[#putClientProperty#addMenuItem]\(keyname, feedback_item, icon, valuemnemonic)
Add Setsa themenu valueitem forat the specifiedselected element client property keyindex (starting at 0) or at the end.{td}{tr}{tbody}{tbody}{tr}{td}void[MenuItem]{td}{td}[#removeAllItems#addMenuItem]\(name, feedback_item, icon, mnemonic, enabled)
Remove all items from
Add a menu item at the selected index (starting at 0) or at the menuend.{td}{tr}{tbody}{tbody}{tr}{td}void[MenuItem]{td}{td}[#removeItem#addMenuItem]\(index 1, \[index 2-n\])
Remove the item(s)name, feedback_item, icon, mnemonic, enabled, align)
Add a menu item at the selected index/indices (starting at 0) or at the end.{td}{tr}{tbody}{tbody}{tr}{td}void[RadioButton]{td}{td}[#setEnabled#addRadioButton]\(enabled)
SetAdd thea the selected menu enabled or disabledradio button.{td}{tr}{tbody}{tbody}{tr}{td}void[RadioButton]{td}{td}[#setIcon#addRadioButton]\(iconindex)
SetAdd a radiobutton at the icon ofselected index (starting at 0) or at the menuend.{td}{tr}{tbody}{tbody}{tr}{td}void[RadioButton]{td}{td}[#setMnemonic#addRadioButton]\(mnemonicname)
SetAdd thea mnemonicradio ofbutton thewith selectedgiven menuname.{td}{tr}{tbody}{tabletbody}\\ 

{table:id=property|class=servoy sDetail{tr}{colgrouptd}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=text|class=node}{tr:id=name}{td}h6.text{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:text_des|text=|trigger=button}{sub-section}{sub-section:text_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:text_snc|text=|trigger=button}{sub-section}{sub-section:text_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:text_prs|text=|trigger=button}{sub-section}{sub-section:text_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:text_ret|text=|trigger=button}{sub-section}{sub-section:text_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:text_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:text_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:text_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:text_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:text_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:text_sam|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ 

{table:id=function|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=addCheckBox|class=node}{tr:id=name}{td}h6.addCheckBox{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[CheckBox]{span}{span:id=iets|style=float: left; font-weight: bold;}addCheckBox{span}{span:id=iets|style=float: left;}\(\[name\], \[method\], \[icon\], \[mnemonic\], \[enabled\], \[align\]){span}{td}{tr}{tr:id=des}{td}{sub-section:addCheckBox_des|text=|trigger=button}{sub-section}{sub-section:addCheckBox_des|trigger=none|class=sIndent}Add the Checkbox[RadioButton]{td}{td}[#addRadioButton]\(name, feedback_item)
Add a radiobutton at the selected index (starting at 0) or at the end.{td}{tr}{tbody}{tbody}{tr}{td}[RadioButton]{td}{td}[#addRadioButton]\(name, feedback_item, icon)
Add a radiobutton at the selected index (starting at 0) or at the end.{td}{tr}{tbody}{tbody}{tr}{td}[RadioButton]{td}{td}[#addRadioButton]\(name, feedback_item, icon, mnemonic)
Add a radiobutton at the selected index (starting at 0) or at the end.{td}{tr}{tbody}{tbody}{tr}{td}[RadioButton]{td}{td}[#addRadioButton]\(name, feedback_item, icon, mnemonic, enabled)
Add a radiobutton at the selected index (starting at 0) or at the end.{td}{tr}{tbody}{tbody}{tr}{td}[RadioButton]{td}{td}[#addRadioButton]\(name, feedback_item, icon, mnemonic, enabled, align)
Add a radiobutton at the selected index (starting at 0) or at the end.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addRadioGroup]\()
Add a radiogroup for radiobuttons.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addSeparator]\()
Add the separator at the selected index (starting at 0) or at the end (empty).{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addSeparator]\(index)
Add the separator at the selected index (starting at 0) or at the end (empty).{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#doClick]\()
Script the selection (emulate a mouse click) of the menu.{td}{tr}{tbody}{tbody}{tr}{td}[CheckBox]{td}{td}[#getCheckBox]\(index)
Get the checkbox at the selected index (starting at 0).{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#getClientProperty]\(key)
Gets the specified client property for the element based on a key.{td}{tr}{tbody}{tbody}{tr}{td}[MenuItem]{td}{td}[#getItem]\(index)
Get the item at the selected index (starting at 0).{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getItemCount]\()
Get the number of items in the menu.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getItemIndexByText]\(text)
Retrieve the index of the item by text.{td}{tr}{tbody}{tbody}{tr}{td}[Menu]{td}{td}[#getMenu]\(index)
Get the submenu at the selected index (starting at 0).{td}{tr}{tbody}{tbody}{tr}{td}[RadioButton]{td}{td}[#getRadioButton]\(index)
Get the radiobutton at the selected index (starting at 0) or add it at the end (empty).{sub-sectiontd}{tdtr}{trtbody}{builder-show:permission=edittbody}{tr:id=snc}{td}*Since*\\{sub-section:addCheckBox_snc|text=|trigger=button}{sub-section}{sub-section:addCheckBox_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addCheckBox_prs|text=|trigger=button}{sub-section}{sub-section:addCheckBox_prs|trigger=none|class=sIndent}\[name\]
\[method\]
\[icon\]
\[mnemonic\]
\[enabled\]
\[align\]
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addCheckBox_ret|text=|trigger=button}{sub-section}{sub-section:addCheckBox_ret|trigger=none|class=sIndent}[CheckBox]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addCheckBox_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addCheckBox_linkvoid{td}{td}[#putClientProperty]\(key, value)
Sets the value for the specified element client property key.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#removeAllItems]\()
Remove all items from the menu.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#removeItem]\(index)
Remove the item(s) at the selected index/indices.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setEnabled]\()
Set the the selected menu enabled or disabled.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setIcon]\()
Set the icon of the menu.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setMnemonic]\()
Set the mnemonic of the selected menu.{td}{tr}{tbody}{table}\\ 

{table:id=property|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=text|class=node}{tr:id=name}{td}h6.text{td}{tr}{tr:id=des}{td}{sub-section:text_des|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBoxtext_linkdes|trigger=none|class=sIndent}Retrieve/set the text.{sub-section}{div}{td}{tr}{builder-show:permission=edit}{tr:id=samsnc}{td}*SampleSince*\\{sub-section:addCheckBoxtext_samsnc|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBoxtext_samsnc|trigger=none}{code:language=javascript|class=sIndent} //Replace Addwith 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"version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:text_prs|text=|trigger=button}{sub-section}{sub-section:text_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:text_ret|text=|trigger=button}{sub-section}{sub-section:text_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:text_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:text_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:text_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:text_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:text_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:text_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
// set the menu's text
menu.text = "New Menu";
// disable the menu
menu.setEnabled(false);
// set a mnemonic
menu.setMnemonic("u");
// add aan 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();
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addMenuicon to the menu
menu.setIcon("media:///yourimage.gif");
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ 

{table:id=function|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=addCheckBox|class=node}{tr:id=name}{td}h6.addMenuaddCheckBox{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[MenuCheckBox]{span}{span:id=iets|style=float: left; font-weight: bold;}addMenuaddCheckBox{span}{span:id=iets|style=float: left;}\(\[name\], \[menu\], \[icon\], \[mnemonic\], \[enabled\], \[align\]){span}{td}{tr}{tr:id=des}{td}{sub-section:addMenuaddCheckBox_des|text=|trigger=button}{sub-section}{sub-section:addMenuaddCheckBox_des|trigger=none|class=sIndent}Add the submenu at the selected index (starting at 0) or add it at the end (empty).{sub-section}{td}{tr}{a checkbox.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addMenuaddCheckBox_snc|text=|trigger=button}{sub-section}{sub-section:addMenuaddCheckBox_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:addMenuaddCheckBox_prs|text=|trigger=button}{sub-section}{sub-section:addMenuaddCheckBox_prs|trigger=none|class=sIndent}\[name\]
\[menu\]
\[icon\]
\[mnemonic\]
\[enabled\]
\[align\]
{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:addMenuaddCheckBox_ret|text=|trigger=button}{sub-section}{sub-section:addMenuaddCheckBox_ret|trigger=none|class=sIndent}[MenuCheckBox] -- checkbox{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addMenuaddCheckBox_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuaddCheckBox_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addMenuaddCheckBox_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuaddCheckBox_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addMenuaddCheckBox_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuaddCheckBox_sam|trigger=none}{code:language=javascript}
// Addadd a thenew submenumenu atto the selectedmenubar
indexvar (startingmenubar 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);
= plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// 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 
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
menu.addCheckBox("checkbox", feedback_checkbox);
// add a (second)checkbox submenuwith varan submenu2icon
= submenu1menu.addMenuaddCheckBox("submenu 2");
submenu2.addMenuItem("sub item 2",globals.feedback_item);

checkbox with icon", feedback_checkbox, "media:///yourimage.gif");
// add a (third) submenu
var submenu3 = submenu1.addMenu("submenu 3");
submenu3.addMenuItem("sub item 3",globals.feedback_item);

checkbox with a mnemonic
menu.addCheckBox("checkbox with mnemonic", feedback_checkbox, "media:///yourimage.gif", "c");
// add a disabled checkbox
menu.addCheckBox("checkbox disabled", feedback_checkbox, "media:///yourimage.gif", "d", false);
// add a (first) submenu checkbox with text aligned to the (third) submenu
var submenu4 = submenu3.addMenu("submenu 4");
submenu4.addMenuItem("sub item 4",globals.feedback_itemright
menu.addCheckBox("align right", feedback_checkbox, null, null, true, MenuItem.ALIGN_RIGHT);

// 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_itemcheckbox at a given index (checkbox properties must be configured after creation)
// indexes start at 0 (zero) so index 2 is in fact position 3
var chk = menu.addCheckBox(2);
chk.text = "checkbox at index";
chk.setMethod(feedback_checkbox);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addMenuItemaddCheckBox-Number|class=node}{tr:id=name}{td}h6.addMenuItemaddCheckBox{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[MenuItemCheckBox]{span}{span:id=iets|style=float: left; font-weight: bold;}addMenuItemaddCheckBox{span}{span:id=iets|style=float: left;}\(\[name\], \[method\], \[icon\], \[mnemonic\], \[enabled\], \[align\]index){span}{td}{tr}{tr:id=des}{td}{sub-section:addMenuItemaddCheckBox-Number_des|text=|trigger=button}{sub-section}{sub-section:addMenuItemaddCheckBox-Number_des|trigger=none|class=sIndent}Add thea itemcheckbox at the selected index (starting at 0) or add it at the end (empty).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addMenuItemaddCheckBox-Number_snc|text=|trigger=button}{sub-section}{sub-section:addMenuItemaddCheckBox-Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addMenuItemaddCheckBox-Number_prs|text=|trigger=button}{sub-section}{sub-section:addMenuItemaddCheckBox-Number_prs|trigger=none|class=sIndent}\{[name\]
\[method\]
\[icon\]
\[mnemonic\]
\[enabled\]
\[align\]Number]} index -- the index at which to add the checkbox
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addMenuItemaddCheckBox-Number_ret|text=|trigger=button}{sub-section}{sub-section:addMenuItemaddCheckBox-Number_ret|trigger=none|class=sIndent}[MenuItemCheckBox] -- checkbox{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addMenuItemaddCheckBox-Number_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItemaddCheckBox-Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addMenuItemaddCheckBox-Number_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItemaddCheckBox-Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addMenuItemaddCheckBox-Number_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItemaddCheckBox-Number_sam|trigger=none}{code:language=javascript}
// add Adda thenew itemmenu atto the selectedmenubar
indexvar (startingmenubar 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
= plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.getMenu(plugins.window.getMenuCountcreatePopupMenu() - 1);

// when you don't define an index the itemcheckbox 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.addMenuItemaddCheckBox("item with feedbackcheckbox",globals. feedback_itemcheckbox);

var item =// add a checkbox with an icon
menu.addMenuItemaddCheckBox();"checkbox with // 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();icon", feedback_checkbox, "media:///yourimage.gif");
// add a checkbox with a mnemonic
menu.addCheckBox("checkbox with mnemonic", feedback_checkbox, "media:///yourimage.gif", "c");
// add a disabled checkbox
menu.addCheckBox("checkbox disabled", feedback_checkbox, "media:///yourimage.gif", "d", false);
// add a checkbox with text aligned to the right
menu.addCheckBox("align right", feedback_checkbox, null, null, true, MenuItem.ALIGN_RIGHT);

// add ana iconcheckbox toat thea itemgiven item.text = "item with icon";
item.setMethod(globals.feedback_item, input);
item.setIcon("media:///yourimage.gif");

var item = menu.addMenuItem();index (checkbox properties must be configured after creation)
// addindexes anstart acceleratorat key0 ('alt shift 2' in the below examplezero) //so REMARK:index always2 testis thein acceleratorfact key.position sometimes3
theyvar willchk not work because
// these keys already have an 'action' assigned to them via the operating system.
item= menu.addCheckBox(2);
chk.text = "itemcheckbox withat acceleratorindex";
itemchk.setMethod(globals.feedback_item, inputcheckbox);
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;
{code}{sub-section}{div{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addCheckBox-String|class=node}{tr:id=name}{td}h6.addCheckBox{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[CheckBox]{span}{span:id=iets|style=float: left; font-weight: bold;}addCheckBox{span}{span:id=iets|style=float: left;}\(name){span}{td}{tr}{tr:id=des}{td}{sub-section:addCheckBox-String_des|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_des|trigger=none|class=sIndent}Add a checkbox with given name.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addCheckBox-String_snc|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addCheckBox-String_prs|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_prs|trigger=none|class=sIndent}\{[String]} name -- the checkbox text
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addCheckBox-String_ret|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_ret|trigger=none|class=sIndent}[CheckBox] -- checkbox{sub-section}{td}{tr}{trbuilder-show:classpermission=lastDetailRowedit}{tdtr:id=see}{td}{tr}{tbody}{tbody:id=addRadioButton|class=node}{tr:id=name}{td}h6.addRadioButton*Also see*\\{sub-section:addCheckBox-String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox-String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=siglink}{td}{span:style=float: left; margin-right: 5px;}[RadioButton]{span}{span:id=iets|style=float: left; font-weight: bold;}addRadioButton{span}{span:id=iets|style=float: left;}\(\[name\], \[method\], \[icon\], \[mnemonic\], \[enabled\], \[align\]){span}{td}{tr}{tr:id=des}{td}{sub-section:addRadioButton_des*External links*\\{sub-section:addCheckBox-String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addCheckBox-String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButtonaddCheckBox-String_dessam|trigger=none|class=sIndent}Add the Radiobutton at the selected index (starting at 0) or add it at the end (empty).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addRadioButton_snc|text=|trigger=button}{sub-section}{sub-section:addRadioButton_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addRadioButton_prs|text=|trigger=button}{sub-section}{sub-section:addRadioButton_prs|trigger=none|class=sIndent}\[name\]
\[method\]
\[icon\]
\[mnemonic\]
\[enabled\]
\[align\]
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addRadioButton_ret|text=|trigger=button}{sub-section}{sub-section:addRadioButton_ret|trigger=none|class=sIndent}[RadioButton]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addRadioButton_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addRadioButton_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addRadioButton_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton_sam|trigger=none}{code:language=javascript}
// 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 }{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// 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 
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
menu.addCheckBox("checkbox", feedback_checkbox);
// add a checkbox with an icon
menu.addCheckBox("checkbox with icon", feedback_checkbox, "media:///yourimage.gif");
// add a checkbox with a mnemonic
menu.addCheckBox("checkbox with mnemonic", feedback_checkbox, "media:///yourimage.gif", "c");
// add a disabled checkbox
menu.addCheckBox("checkbox disabled", feedback_checkbox, "media:///yourimage.gif", "d", false);
// add a checkbox with text aligned to the right
menu.addCheckBox("align right", feedback_checkbox, null, null, true, MenuItem.ALIGN_RIGHT);

// add a checkbox at a given index (checkbox properties must be configured after creation)
// indexes start at 0 (zero) so index 2 is in fact position 3
var menuchk = pluginsmenu.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();
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addRadioGroup|class=node}{tr:id=name}{td}h6.addRadioGroup{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}addRadioGroup{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:addRadioGroup_des|text=|trigger=button}{sub-section}{sub-section:addRadioGroup_des|trigger=none|class=sIndent}Add a Radiogroup for the Radiobuttons.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addRadioGroup_snc|text=|trigger=button}{sub-section}{sub-section:addRadioGroup_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:addRadioGroup_prs|text=|trigger=button}{sub-section}{sub-section:addRadioGroup_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:addRadioGroup_retaddCheckBox(2);
chk.text = "checkbox at index";
chk.setMethod(feedback_checkbox);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addCheckBox-String_Object|class=node}{tr:id=name}{td}h6.addCheckBox{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[CheckBox]{span}{span:id=iets|style=float: left; font-weight: bold;}addCheckBox{span}{span:id=iets|style=float: left;}\(name, feedback_item){span}{td}{tr}{tr:id=des}{td}{sub-section:addCheckBox-String_Object_des|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_Object_des|trigger=none|class=sIndent}Add a checkbox at the selected index (starting at 0) or at the end.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addCheckBox-String_Object_snc|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addCheckBox-String_Object_prs|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_Object_prs|trigger=none|class=sIndent}\{[String]} name -- the checkbox text
\{[Object]} feedback_item -- this can be either a method or an array representing a submenu
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addCheckBox-String_Object_ret|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_Object_ret|trigger=none|class=sIndent}[CheckBox] -- checkbox{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addCheckBox-String_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox-String_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addCheckBox-String_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox-String_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addCheckBox-String_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox-String_Object_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// 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 
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
menu.addCheckBox("checkbox", feedback_checkbox);
// add a checkbox with an icon
menu.addCheckBox("checkbox with icon", feedback_checkbox, "media:///yourimage.gif");
// add a checkbox with a mnemonic
menu.addCheckBox("checkbox with mnemonic", feedback_checkbox, "media:///yourimage.gif", "c");
// add a disabled checkbox
menu.addCheckBox("checkbox disabled", feedback_checkbox, "media:///yourimage.gif", "d", false);
// add a checkbox with text aligned to the right
menu.addCheckBox("align right", feedback_checkbox, null, null, true, MenuItem.ALIGN_RIGHT);

// add a checkbox at a given index (checkbox properties must be configured after creation)
// indexes start at 0 (zero) so index 2 is in fact position 3
var chk = menu.addCheckBox(2);
chk.text = "checkbox at index";
chk.setMethod(feedback_checkbox);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addCheckBox-String_Object_Object|class=node}{tr:id=name}{td}h6.addCheckBox{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[CheckBox]{span}{span:id=iets|style=float: left; font-weight: bold;}addCheckBox{span}{span:id=iets|style=float: left;}\(name, feedback_item, icon){span}{td}{tr}{tr:id=des}{td}{sub-section:addCheckBox-String_Object_Object_des|text=|trigger=button}{sub-section}{sub-section:addRadioGroup_retaddCheckBox-String_Object_Object_des|trigger=none|class=sIndent}voidAdd a checkbox at the selected index (starting at 0) or at the end.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=seesnc}{td}*Also seeSince*\\{sub-section:addRadioGroup_seeaddCheckBox-String_Object_Object_snc|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioGroup_seeaddCheckBox-String_Object_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=linkprs}{td}*External linksParameters*\\{sub-section:addRadioGroup_linkaddCheckBox-String_Object_Object_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioGroup_linkaddCheckBox-String_Object_Object_prs|trigger=none|class=sIndent}\{[String]} name -- the checkbox text
\{[Object]} feedback_item -- this can be either a method or an array representing a submenu
\{[Object]} icon -- the checkbox icon (can be an image URL or the image content byte array)
{sub-section}{div}{td}{tr}{builder-show}{tr:id=samret}{td}*SampleReturns*\\{sub-section:addRadioGroup_samaddCheckBox-String_Object_Object_ret|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioGroup_samaddCheckBox-String_Object_Object_ret|trigger=none}{code:language=javascript}
// 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(|class=sIndent}[CheckBox] -- checkbox{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addCheckBox-String_Object_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox-String_Object_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addCheckBox-String_Object_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox-String_Object_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addCheckBox-String_Object_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox-String_Object_Object_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// 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 
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
menu.addCheckBox("checkbox", feedback_checkbox);
// add a checkbox with an icon
menu.addCheckBox("checkbox with icon", feedback_checkbox, "media:///yourimage.gif");
// add a checkbox with a mnemonic
menu.addCheckBox("checkbox with mnemonic", feedback_checkbox, "media:///yourimage.gif", "c");
// add a disabled checkbox
menu.addCheckBox("checkbox disabled", feedback_checkbox, "media:///yourimage.gif", "d", false);
// add a checkbox with text aligned to the right
menu.addCheckBox("align right", feedback_checkbox, null, null, true, MenuItem.ALIGN_RIGHT);

// add a checkbox at a given index (checkbox properties must be configured after creation)
// indexes start at 0 (zero) so index 2 is in fact position 3
var chk = menu.addCheckBox(2);
chk.text = "checkbox at index";
chk.setMethod(feedback_checkbox);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addCheckBox-String_Object_Object_String|class=node}{tr:id=name}{td}h6.addCheckBox{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[CheckBox]{span}{span:id=iets|style=float: left; font-weight: bold;}addCheckBox{span}{span:id=iets|style=float: left;}\(name, feedback_item, icon, mnemonic){span}{td}{tr}{tr:id=des}{td}{sub-section:addCheckBox-String_Object_Object_String_des|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_Object_Object_String_des|trigger=none|class=sIndent}Add a checkbox at the selected index (starting at 0) or at the end.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addCheckBox-String_Object_Object_String_snc|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_Object_Object_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addCheckBox-String_Object_Object_String_prs|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_Object_Object_String_prs|trigger=none|class=sIndent}\{[String]} name -- the checkbox text
\{[Object]} feedback_item -- this can be either a method or an array representing a submenu
\{[Object]} icon -- the checkbox icon (can be an image URL or the image content byte array)
\{[String]} mnemonic -- the checkbox mnemonic
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addCheckBox-String_Object_Object_String_ret|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_Object_Object_String_ret|trigger=none|class=sIndent}[CheckBox] -- checkbox{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addCheckBox-String_Object_Object_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox-String_Object_Object_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addCheckBox-String_Object_Object_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox-String_Object_Object_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addCheckBox-String_Object_Object_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox-String_Object_Object_String_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// 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 
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
menu.addCheckBox("checkbox", feedback_checkbox);
// add a checkbox with an icon
menu.addCheckBox("checkbox with icon", feedback_checkbox, "media:///yourimage.gif");
// add a checkbox with a mnemonic
menu.addCheckBox("checkbox with mnemonic", feedback_checkbox, "media:///yourimage.gif", "c");
// add a disabled checkbox
menu.addCheckBox("checkbox disabled", feedback_checkbox, "media:///yourimage.gif", "d", false);
// add a checkbox with text aligned to the right
menu.addCheckBox("align right", feedback_checkbox, null, null, true, MenuItem.ALIGN_RIGHT);

// add a checkbox at a given index (checkbox properties must be configured after creation)
// indexes start at 0 (zero) so index 2 is in fact position 3
var chk = menu.addCheckBox(2);
chk.text = "checkbox at index";
chk.setMethod(feedback_checkbox);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addCheckBox-String_Object_Object_String_Boolean|class=node}{tr:id=name}{td}h6.addCheckBox{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[CheckBox]{span}{span:id=iets|style=float: left; font-weight: bold;}addCheckBox{span}{span:id=iets|style=float: left;}\(name, feedback_item, icon, mnemonic, enabled){span}{td}{tr}{tr:id=des}{td}{sub-section:addCheckBox-String_Object_Object_String_Boolean_des|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_Object_Object_String_Boolean_des|trigger=none|class=sIndent}Add a checkbox at the selected index (starting at 0) or at the end.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addCheckBox-String_Object_Object_String_Boolean_snc|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_Object_Object_String_Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addCheckBox-String_Object_Object_String_Boolean_prs|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_Object_Object_String_Boolean_prs|trigger=none|class=sIndent}\{[String]} name -- the checkbox text
\{[Object]} feedback_item -- this can be either a method or an array representing a submenu
\{[Object]} icon -- the checkbox icon (can be an image URL or the image content byte array)
\{[String]} mnemonic -- the checkbox mnemonic
\{[Boolean]} enabled -- the enabled state of the checkbox
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addCheckBox-String_Object_Object_String_Boolean_ret|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_Object_Object_String_Boolean_ret|trigger=none|class=sIndent}[CheckBox] -- checkbox{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addCheckBox-String_Object_Object_String_Boolean_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox-String_Object_Object_String_Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addCheckBox-String_Object_Object_String_Boolean_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox-String_Object_Object_String_Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addCheckBox-String_Object_Object_String_Boolean_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox-String_Object_Object_String_Boolean_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// 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 
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
menu.addCheckBox("checkbox", feedback_checkbox);
// add a checkbox with an icon
menu.addCheckBox("checkbox with icon", feedback_checkbox, "media:///yourimage.gif");
// add a checkbox with a mnemonic
menu.addCheckBox("checkbox with mnemonic", feedback_checkbox, "media:///yourimage.gif", "c");
// add a disabled checkbox
menu.addCheckBox("checkbox disabled", feedback_checkbox, "media:///yourimage.gif", "d", false);
// add a checkbox with text aligned to the right
menu.addCheckBox("align right", feedback_checkbox, null, null, true, MenuItem.ALIGN_RIGHT);

// add a checkbox at a given index (checkbox properties must be configured after creation)
// indexes start at 0 (zero) so index 2 is in fact position 3
var chk = menu.addCheckBox(2);
chk.text = "checkbox at index";
chk.setMethod(feedback_checkbox);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addCheckBox-String_Object_Object_String_Boolean_Number|class=node}{tr:id=name}{td}h6.addCheckBox{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[CheckBox]{span}{span:id=iets|style=float: left; font-weight: bold;}addCheckBox{span}{span:id=iets|style=float: left;}\(name, feedback_item, icon, mnemonic, enabled, align){span}{td}{tr}{tr:id=des}{td}{sub-section:addCheckBox-String_Object_Object_String_Boolean_Number_des|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_Object_Object_String_Boolean_Number_des|trigger=none|class=sIndent}Add a checkbox at the selected index (starting at 0) or at the end.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addCheckBox-String_Object_Object_String_Boolean_Number_snc|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_Object_Object_String_Boolean_Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addCheckBox-String_Object_Object_String_Boolean_Number_prs|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_Object_Object_String_Boolean_Number_prs|trigger=none|class=sIndent}\{[String]} name -- the checkbox text
\{[Object]} feedback_item -- this can be either a method or an array representing a submenu
\{[Object]} icon -- the checkbox icon (can be an image URL or the image content byte array)
\{[String]} mnemonic -- the checkbox mnemonic
\{[Boolean]} enabled -- the enabled state of the checkbox
\{[Number]} align -- the alignment type
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addCheckBox-String_Object_Object_String_Boolean_Number_ret|text=|trigger=button}{sub-section}{sub-section:addCheckBox-String_Object_Object_String_Boolean_Number_ret|trigger=none|class=sIndent}[CheckBox] -- checkbox{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addCheckBox-String_Object_Object_String_Boolean_Number_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox-String_Object_Object_String_Boolean_Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addCheckBox-String_Object_Object_String_Boolean_Number_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox-String_Object_Object_String_Boolean_Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addCheckBox-String_Object_Object_String_Boolean_Number_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox-String_Object_Object_String_Boolean_Number_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// 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 
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
menu.addCheckBox("checkbox", feedback_checkbox);
// add a checkbox with an icon
menu.addCheckBox("checkbox with icon", feedback_checkbox, "media:///yourimage.gif");
// add a checkbox with a mnemonic
menu.addCheckBox("checkbox with mnemonic", feedback_checkbox, "media:///yourimage.gif", "c");
// add a disabled checkbox
menu.addCheckBox("checkbox disabled", feedback_checkbox, "media:///yourimage.gif", "d", false);
// add a checkbox with text aligned to the right
menu.addCheckBox("align right", feedback_checkbox, null, null, true, MenuItem.ALIGN_RIGHT);

// add a checkbox at a given index (checkbox properties must be configured after creation)
// indexes start at 0 (zero) so index 2 is in fact position 3
var chk = menu.addCheckBox(2);
chk.text = "checkbox at index";
chk.setMethod(feedback_checkbox);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addMenu|class=node}{tr:id=name}{td}h6.addMenu{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Menu]{span}{span:id=iets|style=float: left; font-weight: bold;}addMenu{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:addMenu_des|text=|trigger=button}{sub-section}{sub-section:addMenu_des|trigger=none|class=sIndent}Add a submenu at the end.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addMenu_snc|text=|trigger=button}{sub-section}{sub-section:addMenu_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:addMenu_prs|text=|trigger=button}{sub-section}{sub-section:addMenu_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:addMenu_ret|text=|trigger=button}{sub-section}{sub-section:addMenu_ret|trigger=none|class=sIndent}[Menu] -- the submenu{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addMenu_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenu_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addMenu_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenu_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addMenu_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenu_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a first submenu
var submenu1 = menu.addMenu("submenu 1");
submenu1.addMenuItem("sub item 1 - 1", feedback_item);
// add a submenu as child of the first submenu
var submenu1_2 = submenu1.addMenu("submenu 1 - 2");
submenu1_2.addMenuItem("sub item 1 - 2 - 1", feedback_item);
// add another submenu as a child of the first submenu
var submenu1_3 = submenu1.addMenu("submenu 1 - 3");
submenu1_3.addMenuItem("sub item 1 - 3 - 1", feedback_item);
// add a submenu to the second submenu of the first submenu
var submenu1_3_2 = submenu1_2.addMenu("submenu 1 - 2 - 2");
submenu1_3_2.addMenuItem("sub item 1 - 2 - 2 - 1", feedback_item);
// add a submenu directly to the menu, at the first position
var submenu0 = menu.addMenu(0);
submenu0.text = "submenu 0";
submenu0.addMenuItem("sub item 0 - 1", feedback_item);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addMenu-Number|class=node}{tr:id=name}{td}h6.addMenu{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Menu]{span}{span:id=iets|style=float: left; font-weight: bold;}addMenu{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:addMenu-Number_des|text=|trigger=button}{sub-section}{sub-section:addMenu-Number_des|trigger=none|class=sIndent}Add a submenu at the selected index (starting at 0).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addMenu-Number_snc|text=|trigger=button}{sub-section}{sub-section:addMenu-Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addMenu-Number_prs|text=|trigger=button}{sub-section}{sub-section:addMenu-Number_prs|trigger=none|class=sIndent}\{[Number]} index -- the index at which to add the submenu
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addMenu-Number_ret|text=|trigger=button}{sub-section}{sub-section:addMenu-Number_ret|trigger=none|class=sIndent}[Menu] -- the submenu{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addMenu-Number_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenu-Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addMenu-Number_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenu-Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addMenu-Number_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenu-Number_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a first submenu
var submenu1 = menu.addMenu("submenu 1");
submenu1.addMenuItem("sub item 1 - 1", feedback_item);
// add a submenu as child of the first submenu
var submenu1_2 = submenu1.addMenu("submenu 1 - 2");
submenu1_2.addMenuItem("sub item 1 - 2 - 1", feedback_item);
// add another submenu as a child of the first submenu
var submenu1_3 = submenu1.addMenu("submenu 1 - 3");
submenu1_3.addMenuItem("sub item 1 - 3 - 1", feedback_item);
// add a submenu to the second submenu of the first submenu
var submenu1_3_2 = submenu1_2.addMenu("submenu 1 - 2 - 2");
submenu1_3_2.addMenuItem("sub item 1 - 2 - 2 - 1", feedback_item);
// add a submenu directly to the menu, at the first position
var submenu0 = menu.addMenu(0);
submenu0.text = "submenu 0";
submenu0.addMenuItem("sub item 0 - 1", feedback_item);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addMenu-String|class=node}{tr:id=name}{td}h6.addMenu{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Menu]{span}{span:id=iets|style=float: left; font-weight: bold;}addMenu{span}{span:id=iets|style=float: left;}\(name){span}{td}{tr}{tr:id=des}{td}{sub-section:addMenu-String_des|text=|trigger=button}{sub-section}{sub-section:addMenu-String_des|trigger=none|class=sIndent}Add a submenu with given name.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addMenu-String_snc|text=|trigger=button}{sub-section}{sub-section:addMenu-String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addMenu-String_prs|text=|trigger=button}{sub-section}{sub-section:addMenu-String_prs|trigger=none|class=sIndent}\{[String]} name -- the text of the submenu
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addMenu-String_ret|text=|trigger=button}{sub-section}{sub-section:addMenu-String_ret|trigger=none|class=sIndent}[Menu] -- the submenu{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addMenu-String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenu-String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addMenu-String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenu-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addMenu-String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenu-String_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add a first submenu
var submenu1 = menu.addMenu("submenu 1");
submenu1.addMenuItem("sub item 1 - 1", feedback_item);
// add a submenu as child of the first submenu
var submenu1_2 = submenu1.addMenu("submenu 1 - 2");
submenu1_2.addMenuItem("sub item 1 - 2 - 1", feedback_item);
// add another submenu as a child of the first submenu
var submenu1_3 = submenu1.addMenu("submenu 1 - 3");
submenu1_3.addMenuItem("sub item 1 - 3 - 1", feedback_item);
// add a submenu to the second submenu of the first submenu
var submenu1_3_2 = submenu1_2.addMenu("submenu 1 - 2 - 2");
submenu1_3_2.addMenuItem("sub item 1 - 2 - 2 - 1", feedback_item);
// add a submenu directly to the menu, at the first position
var submenu0 = menu.addMenu(0);
submenu0.text = "submenu 0";
submenu0.addMenuItem("sub item 0 - 1", feedback_item);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addMenuItem|class=node}{tr:id=name}{td}h6.addMenuItem{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[MenuItem]{span}{span:id=iets|style=float: left; font-weight: bold;}addMenuItem{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:addMenuItem_des|text=|trigger=button}{sub-section}{sub-section:addMenuItem_des|trigger=none|class=sIndent}Add a menu item.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addMenuItem_snc|text=|trigger=button}{sub-section}{sub-section:addMenuItem_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:addMenuItem_prs|text=|trigger=button}{sub-section}{sub-section:addMenuItem_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:addMenuItem_ret|text=|trigger=button}{sub-section}{sub-section:addMenuItem_ret|trigger=none|class=sIndent}[MenuItem] -- menu item{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addMenuItem_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addMenuItem_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addMenuItem_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// 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
// minimum settings are the text and method
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
menu.addMenuItem("item", feedback_item);
// add an item with an icon
menu.addMenuItem("item with icon", feedback_item, "media:///yourimage.gif");
// add an item with a mnemonic
menu.addMenuItem("item with mnemonic", feedback_item, "media:///yourimage.gif", "i");
// add a disabled item
menu.addMenuItem("disabled item", feedback_item, "media:///yourimage.gif", "d", false);
// add an item with text aligned to the right
menu.addMenuItem("align right", feedback_item, null, null, true, SM_ALIGNMENT.RIGHT);

// add an item at a given index (item properties must be configured after creation)
// indexes start at 0 (zero) so index 2 is in fact position 3
var item = menu.addMenuItem(2);
item.text = "item at index";
item.setMethod(feedback_item);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addMenuItem-Number|class=node}{tr:id=name}{td}h6.addMenuItem{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[MenuItem]{span}{span:id=iets|style=float: left; font-weight: bold;}addMenuItem{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:addMenuItem-Number_des|text=|trigger=button}{sub-section}{sub-section:addMenuItem-Number_des|trigger=none|class=sIndent}Add a menu item at the selected index (starting at 0) or at the end.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addMenuItem-Number_snc|text=|trigger=button}{sub-section}{sub-section:addMenuItem-Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addMenuItem-Number_prs|text=|trigger=button}{sub-section}{sub-section:addMenuItem-Number_prs|trigger=none|class=sIndent}\{[Number]} index -- the index at which to add the menu item
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addMenuItem-Number_ret|text=|trigger=button}{sub-section}{sub-section:addMenuItem-Number_ret|trigger=none|class=sIndent}[MenuItem] -- menu item{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addMenuItem-Number_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addMenuItem-Number_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addMenuItem-Number_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-Number_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// 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
// minimum settings are the text and method
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
menu.addMenuItem("item", feedback_item);
// add an item with an icon
menu.addMenuItem("item with icon", feedback_item, "media:///yourimage.gif");
// add an item with a mnemonic
menu.addMenuItem("item with mnemonic", feedback_item, "media:///yourimage.gif", "i");
// add a disabled item
menu.addMenuItem("disabled item", feedback_item, "media:///yourimage.gif", "d", false);
// add an item with text aligned to the right
menu.addMenuItem("align right", feedback_item, null, null, true, SM_ALIGNMENT.RIGHT);

// add an item at a given index (item properties must be configured after creation)
// indexes start at 0 (zero) so index 2 is in fact position 3
var item = menu.addMenuItem(2);
item.text = "item at index";
item.setMethod(feedback_item);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addMenuItem-String|class=node}{tr:id=name}{td}h6.addMenuItem{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[MenuItem]{span}{span:id=iets|style=float: left; font-weight: bold;}addMenuItem{span}{span:id=iets|style=float: left;}\(name){span}{td}{tr}{tr:id=des}{td}{sub-section:addMenuItem-String_des|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_des|trigger=none|class=sIndent}Add a menu item with given name.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addMenuItem-String_snc|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addMenuItem-String_prs|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_prs|trigger=none|class=sIndent}\{[String]} name -- the menu item text
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addMenuItem-String_ret|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_ret|trigger=none|class=sIndent}[MenuItem] -- menu item{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addMenuItem-String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addMenuItem-String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addMenuItem-String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-String_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// 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
// minimum settings are the text and method
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
menu.addMenuItem("item", feedback_item);
// add an item with an icon
menu.addMenuItem("item with icon", feedback_item, "media:///yourimage.gif");
// add an item with a mnemonic
menu.addMenuItem("item with mnemonic", feedback_item, "media:///yourimage.gif", "i");
// add a disabled item
menu.addMenuItem("disabled item", feedback_item, "media:///yourimage.gif", "d", false);
// add an item with text aligned to the right
menu.addMenuItem("align right", feedback_item, null, null, true, SM_ALIGNMENT.RIGHT);

// add an item at a given index (item properties must be configured after creation)
// indexes start at 0 (zero) so index 2 is in fact position 3
var item = menu.addMenuItem(2);
item.text = "item at index";
item.setMethod(feedback_item);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addMenuItem-String_Object|class=node}{tr:id=name}{td}h6.addMenuItem{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[MenuItem]{span}{span:id=iets|style=float: left; font-weight: bold;}addMenuItem{span}{span:id=iets|style=float: left;}\(name, feedback_item){span}{td}{tr}{tr:id=des}{td}{sub-section:addMenuItem-String_Object_des|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_des|trigger=none|class=sIndent}Add a menu item at the selected index (starting at 0) or at the end.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addMenuItem-String_Object_snc|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addMenuItem-String_Object_prs|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_prs|trigger=none|class=sIndent}\{[String]} name -- the menu item text
\{[Object]} feedback_item -- this can be either a method or an array representing a submenu
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addMenuItem-String_Object_ret|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_ret|trigger=none|class=sIndent}[MenuItem] -- menu item{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addMenuItem-String_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-String_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addMenuItem-String_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-String_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addMenuItem-String_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-String_Object_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// 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
// minimum settings are the text and method
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
menu.addMenuItem("item", feedback_item);
// add an item with an icon
menu.addMenuItem("item with icon", feedback_item, "media:///yourimage.gif");
// add an item with a mnemonic
menu.addMenuItem("item with mnemonic", feedback_item, "media:///yourimage.gif", "i");
// add a disabled item
menu.addMenuItem("disabled item", feedback_item, "media:///yourimage.gif", "d", false);
// add an item with text aligned to the right
menu.addMenuItem("align right", feedback_item, null, null, true, SM_ALIGNMENT.RIGHT);

// add an item at a given index (item properties must be configured after creation)
// indexes start at 0 (zero) so index 2 is in fact position 3
var item = menu.addMenuItem(2);
item.text = "item at index";
item.setMethod(feedback_item);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addMenuItem-String_Object_Object|class=node}{tr:id=name}{td}h6.addMenuItem{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[MenuItem]{span}{span:id=iets|style=float: left; font-weight: bold;}addMenuItem{span}{span:id=iets|style=float: left;}\(name, feedback_item, icon){span}{td}{tr}{tr:id=des}{td}{sub-section:addMenuItem-String_Object_Object_des|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_Object_des|trigger=none|class=sIndent}Add a menu item at the selected index (starting at 0) or at the end.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addMenuItem-String_Object_Object_snc|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addMenuItem-String_Object_Object_prs|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_Object_prs|trigger=none|class=sIndent}\{[String]} name -- the menu item text
\{[Object]} feedback_item -- this can be either a method or an array representing a submenu
\{[Object]} icon -- the menu item icon (can be an image URL or the image content byte array)
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addMenuItem-String_Object_Object_ret|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_Object_ret|trigger=none|class=sIndent}[MenuItem] -- menu item{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addMenuItem-String_Object_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-String_Object_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addMenuItem-String_Object_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-String_Object_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addMenuItem-String_Object_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-String_Object_Object_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// 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
// minimum settings are the text and method
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
menu.addMenuItem("item", feedback_item);
// add an item with an icon
menu.addMenuItem("item with icon", feedback_item, "media:///yourimage.gif");
// add an item with a mnemonic
menu.addMenuItem("item with mnemonic", feedback_item, "media:///yourimage.gif", "i");
// add a disabled item
menu.addMenuItem("disabled item", feedback_item, "media:///yourimage.gif", "d", false);
// add an item with text aligned to the right
menu.addMenuItem("align right", feedback_item, null, null, true, SM_ALIGNMENT.RIGHT);

// add an item at a given index (item properties must be configured after creation)
// indexes start at 0 (zero) so index 2 is in fact position 3
var item = menu.addMenuItem(2);
item.text = "item at index";
item.setMethod(feedback_item);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addMenuItem-String_Object_Object_String|class=node}{tr:id=name}{td}h6.addMenuItem{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[MenuItem]{span}{span:id=iets|style=float: left; font-weight: bold;}addMenuItem{span}{span:id=iets|style=float: left;}\(name, feedback_item, icon, mnemonic){span}{td}{tr}{tr:id=des}{td}{sub-section:addMenuItem-String_Object_Object_String_des|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_Object_String_des|trigger=none|class=sIndent}Add a menu item at the selected index (starting at 0) or at the end.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addMenuItem-String_Object_Object_String_snc|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_Object_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addMenuItem-String_Object_Object_String_prs|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_Object_String_prs|trigger=none|class=sIndent}\{[String]} name -- the menu item text
\{[Object]} feedback_item -- this can be either a method or an array representing a submenu
\{[Object]} icon -- the menu item icon (can be an image URL or the image content byte array)
\{[String]} mnemonic -- the menu item mnemonic
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addMenuItem-String_Object_Object_String_ret|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_Object_String_ret|trigger=none|class=sIndent}[MenuItem] -- menu item{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addMenuItem-String_Object_Object_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-String_Object_Object_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addMenuItem-String_Object_Object_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-String_Object_Object_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addMenuItem-String_Object_Object_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-String_Object_Object_String_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// 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
// minimum settings are the text and method
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
menu.addMenuItem("item", feedback_item);
// add an item with an icon
menu.addMenuItem("item with icon", feedback_item, "media:///yourimage.gif");
// add an item with a mnemonic
menu.addMenuItem("item with mnemonic", feedback_item, "media:///yourimage.gif", "i");
// add a disabled item
menu.addMenuItem("disabled item", feedback_item, "media:///yourimage.gif", "d", false);
// add an item with text aligned to the right
menu.addMenuItem("align right", feedback_item, null, null, true, SM_ALIGNMENT.RIGHT);

// add an item at a given index (item properties must be configured after creation)
// indexes start at 0 (zero) so index 2 is in fact position 3
var item = menu.addMenuItem(2);
item.text = "item at index";
item.setMethod(feedback_item);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addMenuItem-String_Object_Object_String_Boolean|class=node}{tr:id=name}{td}h6.addMenuItem{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[MenuItem]{span}{span:id=iets|style=float: left; font-weight: bold;}addMenuItem{span}{span:id=iets|style=float: left;}\(name, feedback_item, icon, mnemonic, enabled){span}{td}{tr}{tr:id=des}{td}{sub-section:addMenuItem-String_Object_Object_String_Boolean_des|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_Object_String_Boolean_des|trigger=none|class=sIndent}Add a menu item at the selected index (starting at 0) or at the end.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addMenuItem-String_Object_Object_String_Boolean_snc|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_Object_String_Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addMenuItem-String_Object_Object_String_Boolean_prs|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_Object_String_Boolean_prs|trigger=none|class=sIndent}\{[String]} name -- the menu item text
\{[Object]} feedback_item -- this can be either a method or an array representing a submenu
\{[Object]} icon -- the menu item icon (can be an image URL or the image content byte array)
\{[String]} mnemonic -- the menu item mnemonic
\{[Boolean]} enabled -- the enabled state of the menu item
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addMenuItem-String_Object_Object_String_Boolean_ret|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_Object_String_Boolean_ret|trigger=none|class=sIndent}[MenuItem] -- menu item{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addMenuItem-String_Object_Object_String_Boolean_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-String_Object_Object_String_Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addMenuItem-String_Object_Object_String_Boolean_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-String_Object_Object_String_Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addMenuItem-String_Object_Object_String_Boolean_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-String_Object_Object_String_Boolean_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// 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
// minimum settings are the text and method
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
menu.addMenuItem("item", feedback_item);
// add an item with an icon
menu.addMenuItem("item with icon", feedback_item, "media:///yourimage.gif");
// add an item with a mnemonic
menu.addMenuItem("item with mnemonic", feedback_item, "media:///yourimage.gif", "i");
// add a disabled item
menu.addMenuItem("disabled item", feedback_item, "media:///yourimage.gif", "d", false);
// add an item with text aligned to the right
menu.addMenuItem("align right", feedback_item, null, null, true, SM_ALIGNMENT.RIGHT);

// add an item at a given index (item properties must be configured after creation)
// indexes start at 0 (zero) so index 2 is in fact position 3
var item = menu.addMenuItem(2);
item.text = "item at index";
item.setMethod(feedback_item);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addMenuItem-String_Object_Object_String_Boolean_Number|class=node}{tr:id=name}{td}h6.addMenuItem{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[MenuItem]{span}{span:id=iets|style=float: left; font-weight: bold;}addMenuItem{span}{span:id=iets|style=float: left;}\(name, feedback_item, icon, mnemonic, enabled, align){span}{td}{tr}{tr:id=des}{td}{sub-section:addMenuItem-String_Object_Object_String_Boolean_Number_des|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_Object_String_Boolean_Number_des|trigger=none|class=sIndent}Add a menu item at the selected index (starting at 0) or at the end.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addMenuItem-String_Object_Object_String_Boolean_Number_snc|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_Object_String_Boolean_Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addMenuItem-String_Object_Object_String_Boolean_Number_prs|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_Object_String_Boolean_Number_prs|trigger=none|class=sIndent}\{[String]} name -- the menu item text
\{[Object]} feedback_item -- this can be either a method or an array representing a submenu
\{[Object]} icon -- the menu item icon (can be an image URL or the image content byte array)
\{[String]} mnemonic -- the menu item mnemonic
\{[Boolean]} enabled -- the enabled state of the menu item
\{[Number]} align -- the alignment type
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addMenuItem-String_Object_Object_String_Boolean_Number_ret|text=|trigger=button}{sub-section}{sub-section:addMenuItem-String_Object_Object_String_Boolean_Number_ret|trigger=none|class=sIndent}[MenuItem] -- menu item{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addMenuItem-String_Object_Object_String_Boolean_Number_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-String_Object_Object_String_Boolean_Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addMenuItem-String_Object_Object_String_Boolean_Number_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-String_Object_Object_String_Boolean_Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addMenuItem-String_Object_Object_String_Boolean_Number_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem-String_Object_Object_String_Boolean_Number_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// 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
// minimum settings are the text and method
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
menu.addMenuItem("item", feedback_item);
// add an item with an icon
menu.addMenuItem("item with icon", feedback_item, "media:///yourimage.gif");
// add an item with a mnemonic
menu.addMenuItem("item with mnemonic", feedback_item, "media:///yourimage.gif", "i");
// add a disabled item
menu.addMenuItem("disabled item", feedback_item, "media:///yourimage.gif", "d", false);
// add an item with text aligned to the right
menu.addMenuItem("align right", feedback_item, null, null, true, SM_ALIGNMENT.RIGHT);

// add an item at a given index (item properties must be configured after creation)
// indexes start at 0 (zero) so index 2 is in fact position 3
var item = menu.addMenuItem(2);
item.text = "item at index";
item.setMethod(feedback_item);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addRadioButton|class=node}{tr:id=name}{td}h6.addRadioButton{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[RadioButton]{span}{span:id=iets|style=float: left; font-weight: bold;}addRadioButton{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:addRadioButton_des|text=|trigger=button}{sub-section}{sub-section:addRadioButton_des|trigger=none|class=sIndent}Add a radio button.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addRadioButton_snc|text=|trigger=button}{sub-section}{sub-section:addRadioButton_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:addRadioButton_prs|text=|trigger=button}{sub-section}{sub-section:addRadioButton_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:addRadioButton_ret|text=|trigger=button}{sub-section}{sub-section:addRadioButton_ret|trigger=none|class=sIndent}[RadioButton] -- a radio button menu item{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addRadioButton_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addRadioButton_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addRadioButton_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton_sam|trigger=none}{builder-show:permission=edit}{code:language=javascript}

{code}{builder-show}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addRadioButton-Number|class=node}{tr:id=name}{td}h6.addRadioButton{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[RadioButton]{span}{span:id=iets|style=float: left; font-weight: bold;}addRadioButton{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:addRadioButton-Number_des|text=|trigger=button}{sub-section}{sub-section:addRadioButton-Number_des|trigger=none|class=sIndent}Add a radiobutton at the selected index (starting at 0) or at the end.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addRadioButton-Number_snc|text=|trigger=button}{sub-section}{sub-section:addRadioButton-Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addRadioButton-Number_prs|text=|trigger=button}{sub-section}{sub-section:addRadioButton-Number_prs|trigger=none|class=sIndent}\{[Number]} index -- the index at which to add the radio button
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addRadioButton-Number_ret|text=|trigger=button}{sub-section}{sub-section:addRadioButton-Number_ret|trigger=none|class=sIndent}[RadioButton] -- a radio button menu item{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addRadioButton-Number_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addRadioButton-Number_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addRadioButton-Number_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-Number_sam|trigger=none}{builder-show:permission=edit}{code:language=javascript}

{code}{builder-show}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addRadioButton-String|class=node}{tr:id=name}{td}h6.addRadioButton{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[RadioButton]{span}{span:id=iets|style=float: left; font-weight: bold;}addRadioButton{span}{span:id=iets|style=float: left;}\(name){span}{td}{tr}{tr:id=des}{td}{sub-section:addRadioButton-String_des|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_des|trigger=none|class=sIndent}Add a radio button with given name.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addRadioButton-String_snc|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addRadioButton-String_prs|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_prs|trigger=none|class=sIndent}\{[String]} name -- the radio button text
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addRadioButton-String_ret|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_ret|trigger=none|class=sIndent}[RadioButton] -- a radio button menu item{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addRadioButton-String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addRadioButton-String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addRadioButton-String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-String_sam|trigger=none}{builder-show:permission=edit}{code:language=javascript}

{code}{builder-show}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addRadioButton-String_Object|class=node}{tr:id=name}{td}h6.addRadioButton{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[RadioButton]{span}{span:id=iets|style=float: left; font-weight: bold;}addRadioButton{span}{span:id=iets|style=float: left;}\(name, feedback_item){span}{td}{tr}{tr:id=des}{td}{sub-section:addRadioButton-String_Object_des|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_des|trigger=none|class=sIndent}Add a radiobutton at the selected index (starting at 0) or at the end.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addRadioButton-String_Object_snc|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addRadioButton-String_Object_prs|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_prs|trigger=none|class=sIndent}\{[String]} name -- the radio button text
\{[Object]} feedback_item -- this can be either a method or an array representing a submenu
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addRadioButton-String_Object_ret|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_ret|trigger=none|class=sIndent}[RadioButton] -- a radio button menu item{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addRadioButton-String_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-String_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addRadioButton-String_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-String_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addRadioButton-String_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-String_Object_sam|trigger=none}{builder-show:permission=edit}{code:language=javascript}

{code}{builder-show}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addRadioButton-String_Object_Object|class=node}{tr:id=name}{td}h6.addRadioButton{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[RadioButton]{span}{span:id=iets|style=float: left; font-weight: bold;}addRadioButton{span}{span:id=iets|style=float: left;}\(name, feedback_item, icon){span}{td}{tr}{tr:id=des}{td}{sub-section:addRadioButton-String_Object_Object_des|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_Object_des|trigger=none|class=sIndent}Add a radiobutton at the selected index (starting at 0) or at the end.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addRadioButton-String_Object_Object_snc|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addRadioButton-String_Object_Object_prs|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_Object_prs|trigger=none|class=sIndent}\{[String]} name -- the radio button text
\{[Object]} feedback_item -- this can be either a method or an array representing a submenu
\{[Object]} icon -- the radio button icon (can be an image URL or the image content byte array)
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addRadioButton-String_Object_Object_ret|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_Object_ret|trigger=none|class=sIndent}[RadioButton] -- a radio button menu item{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addRadioButton-String_Object_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-String_Object_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addRadioButton-String_Object_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-String_Object_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addRadioButton-String_Object_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-String_Object_Object_sam|trigger=none}{builder-show:permission=edit}{code:language=javascript}

{code}{builder-show}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addRadioButton-String_Object_Object_String|class=node}{tr:id=name}{td}h6.addRadioButton{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[RadioButton]{span}{span:id=iets|style=float: left; font-weight: bold;}addRadioButton{span}{span:id=iets|style=float: left;}\(name, feedback_item, icon, mnemonic){span}{td}{tr}{tr:id=des}{td}{sub-section:addRadioButton-String_Object_Object_String_des|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_Object_String_des|trigger=none|class=sIndent}Add a radiobutton at the selected index (starting at 0) or at the end.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addRadioButton-String_Object_Object_String_snc|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_Object_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addRadioButton-String_Object_Object_String_prs|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_Object_String_prs|trigger=none|class=sIndent}\{[String]} name -- the radio button text
\{[Object]} feedback_item -- this can be either a method or an array representing a submenu
\{[Object]} icon -- the radio button icon (can be an image URL or the image content byte array)
\{[String]} mnemonic -- the radio button mnemonic
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addRadioButton-String_Object_Object_String_ret|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_Object_String_ret|trigger=none|class=sIndent}[RadioButton] -- a radio button menu item{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addRadioButton-String_Object_Object_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-String_Object_Object_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addRadioButton-String_Object_Object_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-String_Object_Object_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addRadioButton-String_Object_Object_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-String_Object_Object_String_sam|trigger=none}{builder-show:permission=edit}{code:language=javascript}

{code}{builder-show}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addRadioButton-String_Object_Object_String_Boolean|class=node}{tr:id=name}{td}h6.addRadioButton{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[RadioButton]{span}{span:id=iets|style=float: left; font-weight: bold;}addRadioButton{span}{span:id=iets|style=float: left;}\(name, feedback_item, icon, mnemonic, enabled){span}{td}{tr}{tr:id=des}{td}{sub-section:addRadioButton-String_Object_Object_String_Boolean_des|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_Object_String_Boolean_des|trigger=none|class=sIndent}Add a radiobutton at the selected index (starting at 0) or at the end.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addRadioButton-String_Object_Object_String_Boolean_snc|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_Object_String_Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addRadioButton-String_Object_Object_String_Boolean_prs|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_Object_String_Boolean_prs|trigger=none|class=sIndent}\{[String]} name -- the radio button text
\{[Object]} feedback_item -- this can be either a method or an array representing a submenu
\{[Object]} icon -- the radio button icon (can be an image URL or the image content byte array)
\{[String]} mnemonic -- the radio button mnemonic
\{[Boolean]} enabled -- the enabled state of radio button
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addRadioButton-String_Object_Object_String_Boolean_ret|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_Object_String_Boolean_ret|trigger=none|class=sIndent}[RadioButton] -- a radio button menu item{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addRadioButton-String_Object_Object_String_Boolean_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-String_Object_Object_String_Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addRadioButton-String_Object_Object_String_Boolean_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-String_Object_Object_String_Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addRadioButton-String_Object_Object_String_Boolean_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-String_Object_Object_String_Boolean_sam|trigger=none}{builder-show:permission=edit}{code:language=javascript}

{code}{builder-show}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addRadioButton-String_Object_Object_String_Boolean_Number|class=node}{tr:id=name}{td}h6.addRadioButton{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[RadioButton]{span}{span:id=iets|style=float: left; font-weight: bold;}addRadioButton{span}{span:id=iets|style=float: left;}\(name, feedback_item, icon, mnemonic, enabled, align){span}{td}{tr}{tr:id=des}{td}{sub-section:addRadioButton-String_Object_Object_String_Boolean_Number_des|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_Object_String_Boolean_Number_des|trigger=none|class=sIndent}Add a radiobutton at the selected index (starting at 0) or at the end.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addRadioButton-String_Object_Object_String_Boolean_Number_snc|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_Object_String_Boolean_Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addRadioButton-String_Object_Object_String_Boolean_Number_prs|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_Object_String_Boolean_Number_prs|trigger=none|class=sIndent}\{[String]} name -- the radio button text
\{[Object]} feedback_item -- this can be either a method or an array representing a submenu
\{[Object]} icon -- the radio button icon (can be an image URL or the image content byte array)
\{[String]} mnemonic -- the radio button mnemonic
\{[Boolean]} enabled -- the enabled state of radio button
\{[Number]} align -- the alignment type
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addRadioButton-String_Object_Object_String_Boolean_Number_ret|text=|trigger=button}{sub-section}{sub-section:addRadioButton-String_Object_Object_String_Boolean_Number_ret|trigger=none|class=sIndent}[RadioButton] -- a radio button menu item{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addRadioButton-String_Object_Object_String_Boolean_Number_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-String_Object_Object_String_Boolean_Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addRadioButton-String_Object_Object_String_Boolean_Number_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-String_Object_Object_String_Boolean_Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addRadioButton-String_Object_Object_String_Boolean_Number_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton-String_Object_Object_String_Boolean_Number_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();
	
// 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
// minimum settings are the text and method
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
menu.addRadioButton("radio", feedback_radiobutton);
// add a radiobutton with an icon
menu.addRadioButton("radio with icon", feedback_radiobutton, "media:///yourimage.gif");
	
// 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
// if no group is added, a group is created automatically when the first radiobutton is added to the menu
// so in this case we will have two groups, one with the radiobuttons added until now and one with the ones added from now on
menu.addRadioGroup();
	
// add a radiobutton with a mnemonic
menu.addRadioButton("radio with mnemonic", feedback_radiobutton, "media:///yourimage.gif", "i");
// add a disabled radiobutton
menu.addRadioButton("disabled radio", feedback_radiobutton, "media:///yourimage.gif", "d", false);
// add a radiobutton with text aligned to the right
menu.addRadioButton("align right", feedback_radiobutton, null, null, true, SM_ALIGNMENT.RIGHT);
// add a radiobutton at a given index (item properties must be configured after creation)
// indexes start at 0 (zero) so index 2 is in fact position 3
var rd = menu.addRadioButton(2);
rd.text = "radio at index";
rd.setMethod(feedback_item);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addRadioGroup|class=node}{tr:id=name}{td}h6.addRadioGroup{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}addRadioGroup{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:addRadioGroup_des|text=|trigger=button}{sub-section}{sub-section:addRadioGroup_des|trigger=none|class=sIndent}Add a radiogroup for radiobuttons. A radiogroup groups together all radiobuttons that are added
after the group is added. From all radiobuttons that belong to the same radiogroup only one can be
checked at a time.

If no radiogroup is added, one is created automatically when the first radiobutton is added.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addRadioGroup_snc|text=|trigger=button}{sub-section}{sub-section:addRadioGroup_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:addRadioGroup_prs|text=|trigger=button}{sub-section}{sub-section:addRadioGroup_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:addRadioGroup_ret|text=|trigger=button}{sub-section}{sub-section:addRadioGroup_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addRadioGroup_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioGroup_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addRadioGroup_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioGroup_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addRadioGroup_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioGroup_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();
	
// 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
// minimum settings are the text and method
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
menu.addRadioButton("radio", feedback_radiobutton);
// add a radiobutton with an icon
menu.addRadioButton("radio with icon", feedback_radiobutton, "media:///yourimage.gif");
	
// 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
// if no group is added, a group is created automatically when the first radiobutton is added to the menu
// so in this case we will have two groups, one with the radiobuttons added until now and one with the ones added from now on
menu.addRadioGroup();
	
// add a radiobutton with a mnemonic
menu.addRadioButton("radio with mnemonic", feedback_radiobutton, "media:///yourimage.gif", "i");
// add a disabled radiobutton
menu.addRadioButton("disabled radio", feedback_radiobutton, "media:///yourimage.gif", "d", false);
// add a radiobutton with text aligned to the right
menu.addRadioButton("align right", feedback_radiobutton, null, null, true, SM_ALIGNMENT.RIGHT);
// add a radiobutton at a given index (item properties must be configured after creation)
// indexes start at 0 (zero) so index 2 is in fact position 3
var rd = menu.addRadioButton(2);
rd.text = "radio at index";
rd.setMethod(feedback_item);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addSeparator|class=node}{tr:id=name}{td}h6.addSeparator{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}addSeparator{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:addSeparator_des|text=|trigger=button}{sub-section}{sub-section:addSeparator_des|trigger=none|class=sIndent}Add the separator at the selected index (starting at 0) or at the end (empty).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addSeparator_snc|text=|trigger=button}{sub-section}{sub-section:addSeparator_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:addSeparator_prs|text=|trigger=button}{sub-section}{sub-section:addSeparator_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:addSeparator_ret|text=|trigger=button}{sub-section}{sub-section:addSeparator_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addSeparator_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addSeparator_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addSeparator_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addSeparator_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addSeparator_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addSeparator_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add an item and a checkbox
menu.addMenuItem("item", feedback_item);
menu.addCheckBox("checkbox", feedback_checkbox);
// add a separator
menu.addSeparator();
// add a radiobutton. it will be separated from the rest of the control by the separator
menu.addRadioButton("radio", feedback_radiobutton);
// add another separator between the item and the checkbox 
menu.addSeparator(1);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addSeparator-Number|class=node}{tr:id=name}{td}h6.addSeparator{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}addSeparator{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:addSeparator-Number_des|text=|trigger=button}{sub-section}{sub-section:addSeparator-Number_des|trigger=none|class=sIndent}Add the separator at the selected index (starting at 0) or add it at the end (empty).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addSeparator-Number_snc|text=|trigger=button}{sub-section}{sub-section:addSeparator-Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:addSeparator-Number_prs|text=|trigger=button}{sub-section}{sub-section:addSeparator-Number_prs|trigger=none|class=sIndent}\{[Number]} index -- the index at which to add the separator
{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:addSeparator-Number_ret|text=|trigger=button}{sub-section}{sub-section:addSeparator-Number_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addSeparator-Number_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addSeparator-Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addSeparator-Number_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addSeparator-Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addSeparator-Number_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addSeparator_sam|trigger=none}{code:language=javascript}
// Add the separator at the selected index (starting at 0) or add it at the end (empty).
plugins.window.getMenu(0).addSeparator({sub-section:addSeparator-Number_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add an item and a checkbox
menu.addMenuItem("item", feedback_item);
menu.addCheckBox("checkbox", feedback_checkbox);
// add a separator
menu.addSeparator();
// add a radiobutton. it will be separated from the rest of the control by the separator
menu.addRadioButton("radio", feedback_radiobutton);
// add another separator between the item and the checkbox 
menu.addSeparator(1);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=doClick|class=node}{tr:id=name}{td}h6.doClick{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}doClick{span}{span:id=iets|style=float: left;}\(click){span}{td}{tr}{tr:id=des}{td}{sub-section:doClick_des|text=|trigger=button}{sub-section}{sub-section:doClick_des|trigger=none|class=sIndent}Script the selection (emulate a mouse click) of the menu.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:doClick_snc|text=|trigger=button}{sub-section}{sub-section:doClick_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{trbuilder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:doClick_prs|text=|trigger=button}{sub-section}{sub-section:doClick_prs|trigger=none|class=sIndent}click
{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:doClick_ret|text=|trigger=button}{sub-section}{sub-section:doClick_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:doClick_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:doClick_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:doClick_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:doClick_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:doClick_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:doClick_sam|trigger=none}{code:language=javascript}
// Scriptretrieve the File selectionmenu
(emulatevar amenubar mouse click) of the menu.
plugins.window= plugins.window.getMenuBar();
var menu = menubar.getMenu(0);
// simulate a click on the File menu
menu.doClick();
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getCheckBox|class=node}{tr:id=name}{td}h6.getCheckBox{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[CheckBox]{span}{span:id=iets|style=float: left; font-weight: bold;}getCheckBox{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:getCheckBox_des|text=|trigger=button}{sub-section}{sub-section:getCheckBox_des|trigger=none|class=sIndent}Get the Checkboxcheckbox at the selected index (starting at 0).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getCheckBox_snc|text=|trigger=button}{sub-section}{sub-section:getCheckBox_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getCheckBox_prs|text=|trigger=button}{sub-section}{sub-section:getCheckBox_prs|trigger=none|class=sIndent}\{[Number]} index
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getCheckBox_ret|text=|trigger=button}{sub-section}{sub-section:getCheckBox_ret|trigger=none|class=sIndent}[CheckBox]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getCheckBox_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getCheckBox_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getCheckBox_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getCheckBox_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getCheckBox_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getCheckBox_sam|trigger=none}{code:language=javascript}
// 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"); add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add two radiobuttons
menu.addRadioButton("radio one", feedback_radiobutton);
menu.addRadioButton("radio two", feedback_radiobutton);
// add a menu item, with a separator before it
menu.addSeparator();
menu.addMenuItem("item", feedback_item);
// add a checkbox, with a separator before it
menu.addSeparator();
menu.addCheckBox("check", feedback_checkbox);
// add a submenu with an item under it
var submenu = menu.addMenu("submenu");
submenu.addMenuItem("subitem", feedback_item);

// depending on some state, update the entries in the menu
var some_state = true;
if (some_state) {
	// select the first radiobutton
	menu.getRadioButton(0).selected = true;
} else {
	// select the first radiobutton
	menu.getRadioButton(1).selected = true;
}
// enable/disable the menu item
// remember to include the separators also when counting the index
menu.getItem(3).enabled = !some_state;
// select/unselect the checkbox
// remember to include the separators also when counting the index
menu.getCheckBox(5).selected = some_state;
// change the text of the submenu and its item
application.output(menu.getItemCount());
if (some_state) {
	menu.getMenu(6).text = "some state";
	menu.getMenu(6).getItem(0).text = "some text";
}
else {
	menu.getMenu(6).text = "not some state";
	menu.getMenu(6).getItem(0).text = "other text";
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getClientProperty|class=node}{tr:id=name}{td}h6.getClientProperty{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Object]{span}{span:id=iets|style=float: left; font-weight: bold;}getClientProperty{span}{span:id=iets|style=float: left;}\(key){span}{td}{tr}{tr:id=des}{td}{sub-section:getClientProperty_des|text=|trigger=button}{sub-section}{sub-section:getClientProperty_des|trigger=none|class=sIndent}Gets the specified client property for the element based on a key.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getClientProperty_snc|text=|trigger=button}{sub-section}{sub-section:getClientProperty_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getClientProperty_prs|text=|trigger=button}{sub-section}{sub-section:getClientProperty_prs|trigger=none|class=sIndent}\{[Object]} key
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getClientProperty_ret|text=|trigger=button}{sub-section}{sub-section:getClientProperty_ret|trigger=none|class=sIndent}[Object]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getClientProperty_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getClientProperty_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getClientProperty_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getClientProperty_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getClientProperty_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getClientProperty_sam|trigger=none}{code:language=javascript}
// Gets the specified client property for the element based on a key.
// NOTE: Depending on the operating system, a user interface property name may be available.
var property = plugins.window.getClientProperty('ToolTipText'*\\{sub-section:getClientProperty_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getClientProperty_sam|trigger=none}{code:language=javascript}
// NOTE: Depending on the operating system, a user interface property name may be available.
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add an item to the menu
menu.addMenuItem("item", feedback_item);

// set the tooltip of the menu via client properties
// keep the original tooltip in a form or global variable
originalTooltip = menu.getClientProperty("ToolTipText");
menu.putClientProperty("ToolTipText", "changed tooltip");

// later restore the original tooltip from the variable
//var menubar = plugins.window.getMenuBar();
//var menu = menubar.getMenu(menubar.getMenuCount()-1);
//menu.putClientProperty("ToolTipText", originalTooltip);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getItem|class=node}{tr:id=name}{td}h6.getItem{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[MenuItem]{span}{span:id=iets|style=float: left; font-weight: bold;}getItem{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:getItem_des|text=|trigger=button}{sub-section}{sub-section:getItem_des|trigger=none|class=sIndent}Get the item at the selected index (starting at 0).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getItem_snc|text=|trigger=button}{sub-section}{sub-section:getItem_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getItem_prs|text=|trigger=button}{sub-section}{sub-section:getItem_prs|trigger=none|class=sIndent}\{[Number]} index
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getItem_ret|text=|trigger=button}{sub-section}{sub-section:getItem_ret|trigger=none|class=sIndent}[MenuItem]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getItem_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getItem_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getItem_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getItem_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getItem_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getItem_sam|trigger=none}{code:language=javascript}
// 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");language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add two radiobuttons
menu.addRadioButton("radio one", feedback_radiobutton);
menu.addRadioButton("radio two", feedback_radiobutton);
// add a menu item, with a separator before it
menu.addSeparator();
menu.addMenuItem("item", feedback_item);
// add a checkbox, with a separator before it
menu.addSeparator();
menu.addCheckBox("check", feedback_checkbox);
// add a submenu with an item under it
var submenu = menu.addMenu("submenu");
submenu.addMenuItem("subitem", feedback_item);

// depending on some state, update the entries in the menu
var some_state = true;
if (some_state) {
	// select the first radiobutton
	menu.getRadioButton(0).selected = true;
} else {
	// select the first radiobutton
	menu.getRadioButton(1).selected = true;
}
// enable/disable the menu item
// remember to include the separators also when counting the index
menu.getItem(3).enabled = !some_state;
// select/unselect the checkbox
// remember to include the separators also when counting the index
menu.getCheckBox(5).selected = some_state;
// change the text of the submenu and its item
application.output(menu.getItemCount());
if (some_state) {
	menu.getMenu(6).text = "some state";
	menu.getMenu(6).getItem(0).text = "some text";
}
else {
	menu.getMenu(6).text = "not some state";
	menu.getMenu(6).getItem(0).text = "other text";
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getItemCount|class=node}{tr:id=name}{td}h6.getItemCount{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getItemCount{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getItemCount_des|text=|trigger=button}{sub-section}{sub-section:getItemCount_des|trigger=none|class=sIndent}Get the number of items in the menu.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getItemCount_snc|text=|trigger=button}{sub-section}{sub-section:getItemCount_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getItemCount_prs|text=|trigger=button}{sub-section}{sub-section:getItemCount_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getItemCount_ret|text=|trigger=button}{sub-section}{sub-section:getItemCount_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getItemCount_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getItemCount_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getItemCount_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getItemCount_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getItemCount_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getItemCount_sam|trigger=none}{code:language=javascript}
// 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()}{sub-section}{div:class=sIndent}{sub-section:getItemCount_sam|trigger=none}{code:language=javascript}
// 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
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add two radiobuttons
menu.addRadioButton("radio one", feedback_radiobutton);
menu.addRadioButton("radio two", feedback_radiobutton);
// add a checkbox
menu.addCheckBox("check", feedback_checkbox);
// add a menu item
menu.addMenuItem("item", feedback_item);
// add another menu item
menu.addMenuItem("item 2", feedback_item);

// remove the last item
menu.removeItem(menu.getItemCount() - 1);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getItemIndexByText|class=node}{tr:id=name}{td}h6.getItemIndexByText{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getItemIndexByText{span}{span:id=iets|style=float: left;}\(nametext){span}{td}{tr}{tr:id=des}{td}{sub-section:getItemIndexByText_des|text=|trigger=button}{sub-section}{sub-section:getItemIndexByText_des|trigger=none|class=sIndent}Retrieve the index of the item by text.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getItemIndexByText_snc|text=|trigger=button}{sub-section}{sub-section:getItemIndexByText_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getItemIndexByText_prs|text=|trigger=button}{sub-section}{sub-section:getItemIndexByText_prs|trigger=none|class=sIndent}name}\{[String]} text
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getItemIndexByText_ret|text=|trigger=button}{sub-section}{sub-section:getItemIndexByText_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getItemIndexByText_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getItemIndexByText_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getItemIndexByText_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getItemIndexByText_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getItemIndexByText_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getItemIndexByText_sam|trigger=none}{code:language=javascript}
// Retrieve the index of the item by text.
// Retrieve the index of the item by text.
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);
var itemIndex = menu.getItemIndexByText("someItemText");
//menu.removeItem(itemIndex);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getMenu|class=node}{tr:id=name}{td}h6.getMenu{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Menu]{span}{span:id=iets|style=float: left; font-weight: bold;}getMenu{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:getMenu_des|text=|trigger=button}{sub-section}{sub-section:getMenu_des|trigger=none|class=sIndent}Get the submenu at the selected index (starting at 0).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getMenu_snc|text=|trigger=button}{sub-section}{sub-section:getMenu_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getMenu_prs|text=|trigger=button}{sub-section}{sub-section:getMenu_prs|trigger=none|class=sIndent}index
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getMenu_ret|text=|trigger=button}{sub-section}{sub-section:getMenu_ret|trigger=none|class=sIndent}[Menu]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getMenu_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getMenu_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getMenu_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getMenu_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getMenu_sam add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add two radiobuttons
menu.addRadioButton("radio one", feedback_radiobutton);
menu.addRadioButton("radio two", feedback_radiobutton);
// add a checkbox
menu.addCheckBox("check", feedback_checkbox);
// add a menu item
menu.addMenuItem("item", feedback_item);
// add another menu item
menu.addMenuItem("item 2", feedback_item);

// find the index of the checkbox
var idx = menu.getItemIndexByText("check");
// remove the checkbox by its index
menu.removeItem(idx);
// remove both radiobuttons by their indices
menu.removeItem([0, 1]);
// remove all remaining entries
menu.removeAllItems();
// add back an item
menu.addMenuItem("new item", feedback_item);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getMenu|class=node}{tr:id=name}{td}h6.getMenu{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Menu]{span}{span:id=iets|style=float: left; font-weight: bold;}getMenu{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:getMenu_des|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getMenu_samdes|trigger=none}{code:language=javascript}
// none|class=sIndent}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");
{code}{sub-section}{div}{td}{tr}{trbuilder-show:classpermission=lastDetailRowedit}{tdtr:id=snc}{td}{tr}{tbody}{tbody:id=getRadioButton|class=node}{tr:id=name}{td}h6.getRadioButton{td}{tr*Since*\\{sub-section:getMenu_snc|text=|trigger=button}{sub-section}{sub-section:getMenu_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=sigprs}{td}{span:style=float: left; margin-right: 5px;}[RadioButton]{span}{span:id=iets|style=float: left; font-weight: bold;}getRadioButton{span}{span:id=iets|style=float: left;}\(index){span*Parameters*\\{sub-section:getMenu_prs|text=|trigger=button}{sub-section}{sub-section:getMenu_prs|trigger=none|class=sIndent}\{[Number]} index
{sub-section}{td}{tr}{tr:id=desret}{td}*Returns*\\{sub-section:getRadioButtongetMenu_desret|text=|trigger=button}{sub-section}{sub-section:getRadioButtongetMenu_desret|trigger=none|class=sIndent}Get the Radiobutton at the selected index (starting at 0).[Menu]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=sncsee}{td}*SinceAlso see*\\{sub-section:getRadioButtongetMenu_sncsee|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRadioButtongetMenu_sncsee|trigger=none|class=sIndent} Replace with version info{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prslink}{td}*ParametersExternal links*\\{sub-section:getRadioButtongetMenu_prslink|text=|trigger=button}{sub-sectionsection}{div:class=sIndent}{sub-section:getRadioButtongetMenu_prslink|trigger=none|class=sIndent}index
{sub-section}{div}{td}{tr}{builder-show}{tr:id=retsam}{td}*ReturnsSample*\\{sub-section:getRadioButtongetMenu_retsam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRadioButtongetMenu_retsam|trigger=none|class=sIndent}[RadioButton]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getRadioButton_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRadioButton_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getRadioButton_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRadioButton_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getRadioButton_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRadioButton_sam|trigger=none}{code:language=javascript}
// 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");
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=putClientProperty|class=node}{tr:id=name}{td}h6.putClientProperty{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}putClientProperty{span}{span:id=iets|style=float: left;}\(key, value){span}{td}{tr}{tr:id=des}{td}{sub-section:putClientProperty_des{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add two radiobuttons
menu.addRadioButton("radio one", feedback_radiobutton);
menu.addRadioButton("radio two", feedback_radiobutton);
// add a menu item, with a separator before it
menu.addSeparator();
menu.addMenuItem("item", feedback_item);
// add a checkbox, with a separator before it
menu.addSeparator();
menu.addCheckBox("check", feedback_checkbox);
// add a submenu with an item under it
var submenu = menu.addMenu("submenu");
submenu.addMenuItem("subitem", feedback_item);

// depending on some state, update the entries in the menu
var some_state = true;
if (some_state) {
	// select the first radiobutton
	menu.getRadioButton(0).selected = true;
} else {
	// select the first radiobutton
	menu.getRadioButton(1).selected = true;
}
// enable/disable the menu item
// remember to include the separators also when counting the index
menu.getItem(3).enabled = !some_state;
// select/unselect the checkbox
// remember to include the separators also when counting the index
menu.getCheckBox(5).selected = some_state;
// change the text of the submenu and its item
application.output(menu.getItemCount());
if (some_state) {
	menu.getMenu(6).text = "some state";
	menu.getMenu(6).getItem(0).text = "some text";
}
else {
	menu.getMenu(6).text = "not some state";
	menu.getMenu(6).getItem(0).text = "other text";
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getRadioButton|class=node}{tr:id=name}{td}h6.getRadioButton{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[RadioButton]{span}{span:id=iets|style=float: left; font-weight: bold;}getRadioButton{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:getRadioButton_des|text=|trigger=button}{sub-section}{sub-section:getRadioButton_des|trigger=none|class=sIndent}Get the radiobutton at the selected index (starting at 0).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getRadioButton_snc|text=|trigger=button}{sub-section}{sub-section:getRadioButton_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getRadioButton_prs|text=|trigger=button}{sub-section}{sub-section:getRadioButton_prs|trigger=none|class=sIndent}\{[Number]} index
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getRadioButton_ret|text=|trigger=button}{sub-section}{sub-section:getRadioButton_ret|trigger=none|class=sIndent}[RadioButton]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getRadioButton_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRadioButton_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getRadioButton_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRadioButton_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getRadioButton_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:putClientPropertygetRadioButton_des|trigger=none|class=sIndent}Sets the value for the specified element client property key.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:putClientProperty_snc|text=|trigger=button}{sub-section}{sub-section:putClientProperty_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:putClientProperty_prs|text=|trigger=button}{sub-section}{sub-section:putClientProperty_prs|trigger=none|class=sIndent}key
value
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:putClientProperty_ret|text=|trigger=button}{sub-section}{sub-section:putClientProperty_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:putClientProperty_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:putClientProperty_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:putClientProperty_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:putClientProperty_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:putClientProperty_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:putClientProperty_sam|trigger=none}{code:language=javascript}
// Sets the value for the specified element client property key.
// NOTE: Depending on the operating system, a user interface property name may be available.
plugins.window.putClientProperty('ToolTipText','some text');sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add two radiobuttons
menu.addRadioButton("radio one", feedback_radiobutton);
menu.addRadioButton("radio two", feedback_radiobutton);
// add a menu item, with a separator before it
menu.addSeparator();
menu.addMenuItem("item", feedback_item);
// add a checkbox, with a separator before it
menu.addSeparator();
menu.addCheckBox("check", feedback_checkbox);
// add a submenu with an item under it
var submenu = menu.addMenu("submenu");
submenu.addMenuItem("subitem", feedback_item);

// depending on some state, update the entries in the menu
var some_state = true;
if (some_state) {
	// select the first radiobutton
	menu.getRadioButton(0).selected = true;
} else {
	// select the first radiobutton
	menu.getRadioButton(1).selected = true;
}
// enable/disable the menu item
// remember to include the separators also when counting the index
menu.getItem(3).enabled = !some_state;
// select/unselect the checkbox
// remember to include the separators also when counting the index
menu.getCheckBox(5).selected = some_state;
// change the text of the submenu and its item
application.output(menu.getItemCount());
if (some_state) {
	menu.getMenu(6).text = "some state";
	menu.getMenu(6).getItem(0).text = "some text";
}
else {
	menu.getMenu(6).text = "not some state";
	menu.getMenu(6).getItem(0).text = "other text";
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=removeAllItemsputClientProperty|class=node}{tr:id=name}{td}h6.removeAllItemsputClientProperty{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}removeAllItemsputClientProperty{span}{span:id=iets|style=float: left;}\(key, value){span}{td}{tr}{tr:id=des}{td}{sub-section:removeAllItemsputClientProperty_des|text=|trigger=button}{sub-section}{sub-section:removeAllItemsputClientProperty_des|trigger=none|class=sIndent}RemoveSets allthe itemsvalue fromfor the menu specified element client property key.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:removeAllItemsputClientProperty_snc|text=|trigger=button}{sub-section}{sub-section:removeAllItemsputClientProperty_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:removeAllItemsputClientProperty_prs|text=|trigger=button}{sub-section}{sub-section:removeAllItemsputClientProperty_prs|trigger=none|class=sIndent}\{[Object]} key
\{[Object]} value
{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:removeAllItemsputClientProperty_ret|text=|trigger=button}{sub-section}{sub-section:removeAllItemsputClientProperty_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:removeAllItemsputClientProperty_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeAllItemsputClientProperty_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:removeAllItemsputClientProperty_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeAllItemsputClientProperty_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:removeAllItemsputClientProperty_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeAllItemsputClientProperty_sam|trigger=none}{code:language=javascript}
// NOTE: Depending on the operating system, a user interface property name may be available.
// 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
 add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add an item to the menu
menu.addMenuItem("item", feedback_item);

// set the tooltip of the menu via client properties
// keep the original tooltip in a form or global variable
originalTooltip = menu.getClientProperty("ToolTipText");
menu.putClientProperty("ToolTipText", "changed tooltip");

// later restore the original tooltip from the variable
//var menubar = plugins.window.getMenuBar();
//var menu = pluginsmenubar.window.getMenu(pluginsmenubar.window.getMenuCount() - 1);

// remove all menu items from the selected menu
menu.removeAllItems(.putClientProperty("ToolTipText", originalTooltip);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=removeItemremoveAllItems|class=node}{tr:id=name}{td}h6.removeItemremoveAllItems{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}removeItemremoveAllItems{span}{span:id=iets|style=float: left;}\(index 1, \[index 2-n\]){span}{td}{tr}{tr:id=des}{td}{sub-section:removeItemremoveAllItems_des|text=|trigger=button}{sub-section}{sub-section:removeItemremoveAllItems_des|trigger=none|class=sIndent}Remove the item(s) atall items from the selected index/indicesmenu.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:removeItemremoveAllItems_snc|text=|trigger=button}{sub-section}{sub-section:removeItemremoveAllItems_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:removeItemremoveAllItems_prs|text=|trigger=button}{sub-section}{sub-section:removeItemremoveAllItems_prs|trigger=none|class=sIndent}index 1
\[index 2\-n\]
{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:removeItemremoveAllItems_ret|text=|trigger=button}{sub-section}{sub-section:removeItemremoveAllItems_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:removeItemremoveAllItems_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeItemremoveAllItems_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:removeItemremoveAllItems_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeItemremoveAllItems_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:removeItemremoveAllItems_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeItemremoveAllItems_sam|trigger=none}{code:language=javascript}
// 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);
 add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add two radiobuttons
menu.addRadioButton("radio one", feedback_radiobutton);
menu.addRadioButton("radio two", feedback_radiobutton);
// add a checkbox
menu.addCheckBox("check", feedback_checkbox);
// add a menu item
menu.addMenuItem("item", feedback_item);
// add another menu item
menu.addMenuItem("item 2", feedback_item);

// find the index of the checkbox
var idx = menu.getItemIndexByText("check");
// remove onlythe onecheckbox itemby atits the selected index
// from the selected menu
//index
menu.removeItem(idx);
// remove both radiobuttons by their indices
menu.removeItem([0, 1]);

// remove moreall thanremaining one item at the selected indices
entries
menu.removeAllItems();
// fromadd theback selectedan menuitem
menu.removeItem(1,2addMenuItem("new item", feedback_item);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setEnabledremoveItem|class=node}{tr:id=name}{td}h6.setEnabledremoveItem{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}setEnabledremoveItem{span}{span:id=iets|style=float: left;}\(enabledindex){span}{td}{tr}{tr:id=des}{td}{sub-section:setEnabledremoveItem_des|text=|trigger=button}{sub-section}{sub-section:setEnabledremoveItem_des|trigger=none|class=sIndent}SetRemove the item(s) at the selected menu enabled or disabledindex/indices.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:setEnabledremoveItem_snc|text=|trigger=button}{sub-section}{sub-section:setEnabledremoveItem_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:setEnabledremoveItem_prs|text=|trigger=button}{sub-section}{sub-section:setEnabledremoveItem_prs|trigger=none|class=sIndent}enabled|trigger=none|class=sIndent}\{[Object]\[]} index -- array of one or moe indexes corresponding to items to remove
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:setEnabledremoveItem_ret|text=|trigger=button}{sub-section}{sub-section:setEnabledremoveItem_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:setEnabledremoveItem_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setEnabledremoveItem_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:setEnabledremoveItem_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setEnabledremoveItem_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:setEnabledremoveItem_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setEnabled_sam|trigger=none}{code:language=javascript}
// Set the the selected menu enabled or disabled.
var menu = plugins.window.getMenu(0);
menu.setText("Hello");
menu.setMnemonic("H");
menu.setEnabled(falsesub-section:removeItem_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
menu.text = "New Menu";
// alternatively create a popup menu
//var menu = plugins.window.createPopupMenu();

// add two radiobuttons
menu.addRadioButton("radio one", feedback_radiobutton);
menu.addRadioButton("radio two", feedback_radiobutton);
// add a checkbox
menu.addCheckBox("check", feedback_checkbox);
// add a menu item
menu.addMenuItem("item", feedback_item);
// add another menu item
menu.addMenuItem("item 2", feedback_item);

// find the index of the checkbox
var idx = menu.getItemIndexByText("check");
// remove the checkbox by its index
menu.removeItem(idx);
// remove both radiobuttons by their indices
menu.removeItem([0, 1]);
// remove all remaining entries
menu.removeAllItems();
// add back an item
menu.addMenuItem("new item", feedback_item);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setIconsetEnabled|class=node}{tr:id=name}{td}h6.setIconsetEnabled{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}setIconsetEnabled{span}{span:id=iets|style=float: left;}\(icon){span}{td}{tr}{tr:id=des}{td}{sub-section:setIconsetEnabled_des|text=|trigger=button}{sub-section}{sub-section:setIconsetEnabled_des|trigger=none|class=sIndent}Set the the selected iconmenu ofenabled theor menudisabled.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:setIconsetEnabled_snc|text=|trigger=button}{sub-section}{sub-section:setIconsetEnabled_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:setIconsetEnabled_prs|text=|trigger=button}{sub-section}{sub-section:setIconsetEnabled_prs|trigger=none|class=sIndent}icon
{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:setIconsetEnabled_ret|text=|trigger=button}{sub-section}{sub-section:setIconsetEnabled_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:setIconsetEnabled_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setIconsetEnabled_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:setIconsetEnabled_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setIconsetEnabled_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:setIconsetEnabled_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setIconsetEnabled_sam|trigger=none}{code:language=javascript}
// Setadd the icon of thea new menu. // getto the menu at the last index
// indexes start at 0 (zero) so index 2 is in fact position 3
var menumenubar
var menubar = plugins.window.getMenu(plugins.window.getMenuCount() - 1getMenuBar();

// 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 itemvar menu = menubar.addMenu();
// minimumset settingsthe aremenu's thetext
menu.text and= method properties"New Menu";
// disable the method can bemenu
menu.setEnabled(false);
// set a global or form methodmnemonic
menu.setMnemonic("u");
// beadd an sureicon 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();
returnmenu
menu.setIcon("media:///yourimage.gif");
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setIcon|class=node}{tr:id=name}{td}h6.setIcon{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}setIcon{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:setIcon_des|text=|trigger=button}{sub-section}{sub-section:setIcon_des|trigger=none|class=sIndent}Set the icon of the menu.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:setIcon_snc|text=|trigger=button}{sub-section}{sub-section:setIcon_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:setIcon_prs|text=|trigger=button}{sub-section}{sub-section:setIcon_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:setIcon_ret|text=|trigger=button}{sub-section}{sub-section:setIcon_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:setIcon_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setIcon_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:setIcon_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setIcon_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:setIcon_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setIcon_sam|trigger=none}{code:language=javascript}
// add a new menu to the menubar
var menubar = plugins.window.getMenuBar();
var menu = menubar.addMenu();
// set the menu's text
menu.text = "New Menu";
// disable the menu
menu.setEnabled(false);
// set a mnemonic
menu.setMnemonic("u");
// add an icon to the menu
menu.setIcon("media:///yourimage.gif");
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setMnemonic|class=node}{tr:id=name}{td}h6.setMnemonic{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}setMnemonic{span}{span:id=iets|style=float: left;}\(mnemonic){span}{td}{tr}{tr:id=des}{td}{sub-section:setMnemonic_des|text=|trigger=button}{sub-section}{sub-section:setMnemonic_des|trigger=none|class=sIndent}Set the mnemonic of the selected menu.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:setMnemonic_snc|text=|trigger=button}{sub-section}{sub-section:setMnemonic_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:setMnemonic_prs|text=|trigger=button}{sub-section}{sub-section:setMnemonic_prs|trigger=none|class=sIndent}mnemonic
{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:setMnemonic_ret|text=|trigger=button}{sub-section}{sub-section:setMnemonic_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:setMnemonic_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setMnemonic_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:setMnemonic_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setMnemonic_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:setMnemonic_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setMnemonic_sam|trigger=none}{code:language=javascript}
// add Seta thenew mnemonicmenu ofto the selectedmenubar
menu.
var menumenubar = plugins.window.getMenugetMenuBar(0);
var menu = menubar.setText("Hello");
addMenu();
// set the menu's text
menu.text = "New Menu";
// disable the menu
menu.setEnabled(false);
// set a mnemonic
menu.setMnemonic("Hu");
// add an icon to the menu
menu.setEnabled(falsesetIcon("media:///yourimage.gif");
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}