Page History
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:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[String]{td}{td}[#text] {td}{tr}{tbody}{table}\\{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[CheckBox]{td}{td}[#addCheckBox]\(index) Add the Checkbox at the selected index (starting at 0) or add it at the end (empty).{td}{tr}{tbody}{tbody}{tr}{td}[MenuItem]{td}{td}[#addItem]\(index) Add the item at the selected index (starting at 0) or add it at the end (empty).{td}{tr}{tbody}{tbody}{tr}{td}[RadioButton]{td}{td}[#addRadioButton]\(index) Add the Radiobutton at the selected index (starting at 0) or add it at the end (empty).{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addRadioGroup]\() Add a Radiogroup for the Radiobuttons.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addSeparator]\(index) Add the separator at the selected index (starting at 0) or add it at the end (empty).{td}{tr}{tbody}{tbody}{tr}{td}[Menu]{td}{td}[#addSubMenu]\(index) Add the submenu at the selected index (starting at 0) or add it at the end (empty).{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#doClick]\(click) 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}[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]\(name) Retrieve the index of the item by text.{td}{tr}{tbody}{tbody}{tr}{td}[RadioButton]{td}{td}[#getRadioButton]\(index) Get the Radiobutton at the selected index (starting at 0).{td}{tr}{tbody}{tbody}{tr}{td}[Menu]{td}{td}[#getSubMenu]\(index) Get the submenu at the selected index (starting at 0).{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 1, index 2-n) Remove the item(s) at the selected index/indices.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#set]\(text, mnemonic, enabled) Set the menu with a text and optional mnemonic key.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setEnabled]\(enabled) Set the the selected menu enabled or disabled.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setIcon]\(icon) Set the icon of the menu.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setMnemonic]\(mnemonic) Set the mnemonic of the selected menu.{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=B473336766CDF0F7-3B553D74-44F54D01-9691BBC8-7D56AE03466FBE3E2F15AC2E}{tr:id=name}{td}h6.text{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:B473336766CDF0F7-3B553D74-44F54D01-9691BBC8-7D56AE03466FBE3E2F15AC2E_des|text=|trigger=button}{sub-section}{sub-section:B473336766CDF0F7-3B553D74-44F54D01-9691BBC8-7D56AE03466FBE3E2F15AC2E_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:B473336766CDF0F7-3B553D74-44F54D01-9691BBC8-7D56AE03466FBE3E2F15AC2E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B473336766CDF0F7-3B553D74-44F54D01-9691BBC8-7D56AE03466FBE3E2F15AC2E_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:B473336766CDF0F7-3B553D74-44F54D01-9691BBC8-7D56AE03466FBE3E2F15AC2E_ret|text=|trigger=button}{sub-section}{sub-section:B473336766CDF0F7-3B553D74-44F54D01-9691BBC8-7D56AE03466FBE3E2F15AC2E_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B473336766CDF0F7-3B553D74-44F54D01-9691BBC8-7D56AE03466FBE3E2F15AC2E_see|text=|trigger=button}{sub-section}{sub-section:B473336766CDF0F7-3B553D74-44F54D01-9691BBC8-7D56AE03466FBE3E2F15AC2E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B473336766CDF0F7-3B553D74-44F54D01-9691BBC8-7D56AE03466FBE3E2F15AC2E_see|text=|trigger=button}{sub-section}{sub-section:B473336766CDF0F7-3B553D74-44F54D01-9691BBC8-7D56AE03466FBE3E2F15AC2E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:B473336766CDF0F7-3B553D74-44F54D01-9691BBC8-7D56AE03466FBE3E2F15AC2E_sam|text=|trigger=button}{sub-section}{sub-section:B473336766CDF0F7-3B553D74-44F54D01-9691BBC8-7D56AE03466FBE3E2F15AC2E_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=04BDBB3697DC4A79-931484D3-440D47D3-A4BEAA47-AFB256911012C4AF38076ACE}{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;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:04BDBB3697DC4A79-931484D3-440D47D3-A4BEAA47-AFB256911012C4AF38076ACE_des|text=|trigger=button}{sub-section}{sub-section:04BDBB3697DC4A79-931484D3-440D47D3-A4BEAA47-AFB256911012C4AF38076ACE_des|trigger=none|class=sIndent}Add the Checkbox at the selected index (starting at 0) or add it at the end (empty)...{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:04BDBB3697DC4A79-931484D3-440D47D3-A4BEAA47-AFB256911012C4AF38076ACE_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:04BDBB3697DC4A79-931484D3-440D47D3-A4BEAA47-AFB256911012C4AF38076ACE_prs|trigger=none}\[index\] {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:04BDBB3697DC4A79-931484D3-440D47D3-A4BEAA47-AFB256911012C4AF38076ACE_ret|text=|trigger=button}{sub-section}{sub-section:04BDBB3697DC4A79-931484D3-440D47D3-A4BEAA47-AFB256911012C4AF38076ACE_ret|trigger=none|class=sIndent}[CheckBox]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:04BDBB3697DC4A79-931484D3-440D47D3-A4BEAA47-AFB256911012C4AF38076ACE_see|text=|trigger=button}{sub-section}{sub-section:04BDBB3697DC4A79-931484D3-440D47D3-A4BEAA47-AFB256911012C4AF38076ACE_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:04BDBB3697DC4A79-931484D3-440D47D3-A4BEAA47-AFB256911012C4AF38076ACE_see|text=|trigger=button}{sub-section}{sub-section:04BDBB3697DC4A79-931484D3-440D47D3-A4BEAA47-AFB256911012C4AF38076ACE_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:04BDBB3697DC4A79-931484D3-440D47D3-A4BEAA47-AFB256911012C4AF38076ACE_sam|text=|trigger=button}{sub-section}{sub-section:04BDBB3697DC4A79-931484D3-440D47D3-A4BEAA47-AFB256911012C4AF38076ACE_sam|class=sIndent|trigger=none}{code:language=javascript} // Add the Checkbox at the selected index (starting at 0) or add it at the end (empty)... // get the menu at the last index // indexes start at 0 (zero) so index 2 is in fact position 3 var menu = plugins.menubar.getMenu(plugins.menubar.getMenuCount() - 1); // when you don't define an index the checkbox will be added at the last position // this is what you usually do to build a new menu var checkbox = menu.addCheckBox(); // create the settings for the specified menu item // minimum settings are the text and method properties // the method can be a global or form method // be sure to enter the method WITHOUT '()' at the end checkbox.set("checkbox with feedback",feedback_checkbox); var checkbox = menu.addCheckBox(); // set the checkbox to selected checkbox.set("checkbox selected",feedback_checkbox, true); var checkbox = menu.addCheckBox(); // add an 'input' array. the array will be concatenated to the end of the arguments // array which can be read out in the selected method var input = [1,"is","the","added","input",false]; checkbox.set("checkbox with input",feedback_checkbox,false,input); var checkbox = menu.addCheckBox(); // add an icon to the item checkbox.set("checkbox with icon",feedback_checkbox,false,input,"media:///yourimage.gif"); var checkbox = menu.addCheckBox(); // add an accelerator key ('alt shift a' in the below example) // REMARK: always test the accelerator key. sometimes they will not work because // these keys already have an 'action' assigned to them via the operating system. checkbox.set("checkbox with accelerator",feedback_checkbox,false,input,"media:///yourimage.gif","alt shift a"); var checkbox = menu.addCheckBox(); // add a mnemonic key ('i' in our example) which is the underlined shortkey on windows // REMARK: setting the mnemonic key is platform dependent checkbox.set("checkbox with mnemonic",feedback_checkbox,false,input,"media:///yourimage.gif","a","i"); var checkbox = menu.addCheckBox(); // disable the menu item checkbox.set("checkbox disabled",feedback_checkbox,false,input,"media:///yourimage.gif","control 3","t",false); var checkbox = menu.addCheckBox(); // set the menu item to be visible checkbox.set("checkbox visible",feedback_checkbox,false,input,"media:///yourimage.gif","meta 4","e",true,true); var checkbox = menu.addCheckBox(); // set the menu item disabled and NOT visible checkbox.set("checkbox invisible",feedback_checkbox,false,input,"media:///yourimage.gif","alt 5","m",false,false); // add a separator at the last position or at a given index menu.addSeparator(); // WIZARD // You can use the menubar wizard Tools/Plugins/IT2Be help/Menubar Wizzzard to create you menu // The wizard will help you at least to learn how to use the plugin and will help you to find the correct // accelerator key string {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=4B714B7F6755F63B-75CDFC14-479E4769-9E288ECE-C8AAA26D3508721EED120572}{tr:id=name}{td}h6.addItem{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[MenuItem]{span}{span:id=iets|style=float: left; font-weight: bold;}addItem{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:4B714B7F6755F63B-75CDFC14-479E4769-9E288ECE-C8AAA26D3508721EED120572_des|text=|trigger=button}{sub-section}{sub-section:4B714B7F6755F63B-75CDFC14-479E4769-9E288ECE-C8AAA26D3508721EED120572_des|trigger=none|class=sIndent}Add the item at the selected index (starting at 0) or add it at the end (empty)...{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:4B714B7F6755F63B-75CDFC14-479E4769-9E288ECE-C8AAA26D3508721EED120572_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:4B714B7F6755F63B-75CDFC14-479E4769-9E288ECE-C8AAA26D3508721EED120572_prs|trigger=none}\[index\] {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:4B714B7F6755F63B-75CDFC14-479E4769-9E288ECE-C8AAA26D3508721EED120572_ret|text=|trigger=button}{sub-section}{sub-section:4B714B7F6755F63B-75CDFC14-479E4769-9E288ECE-C8AAA26D3508721EED120572_ret|trigger=none|class=sIndent}[MenuItem]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:4B714B7F6755F63B-75CDFC14-479E4769-9E288ECE-C8AAA26D3508721EED120572_see|text=|trigger=button}{sub-section}{sub-section:4B714B7F6755F63B-75CDFC14-479E4769-9E288ECE-C8AAA26D3508721EED120572_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:4B714B7F6755F63B-75CDFC14-479E4769-9E288ECE-C8AAA26D3508721EED120572_see|text=|trigger=button}{sub-section}{sub-section:4B714B7F6755F63B-75CDFC14-479E4769-9E288ECE-C8AAA26D3508721EED120572_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:4B714B7F6755F63B-75CDFC14-479E4769-9E288ECE-C8AAA26D3508721EED120572_sam|text=|trigger=button}{sub-section}{sub-section:4B714B7F6755F63B-75CDFC14-479E4769-9E288ECE-C8AAA26D3508721EED120572_sam|class=sIndent|trigger=none}{code:language=javascript} // Add the item at the selected index (starting at 0) or add it at the end (empty)... // get the menu at the last index // indexes start at 0 (zero) so index 2 is in fact position 3 var menu = plugins.menubar.getMenu(plugins.menubar.getMenuCount() - 1); // when you don't define an index the item will be added at the last position // this is what you usually do to build a new menu var item = menu.addItem(); // 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 item.set("item with feedback",globals.feedback_item); var item = menu.addItem(); // 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.set("item with input",globals.feedback_item,input); var item = menu.addItem(); // add an icon to the item item.set("item with icon",globals.feedback_item,input,"media:///yourimage.gif"); var item = menu.addItem(); // 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.set("item with accelerator",globals.feedback_item,input,"media:///yourimage.gif","alt shift 2"); var item = menu.addItem(); // 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.set("item with mnemonic",globals.feedback_item,input,"media:///yourimage.gif","pressed COMMA","i"); var item = menu.addItem(); // disable the menu item item.set("item disabled",globals.feedback_item,input,"media:///yourimage.gif","meta HOME","t",false); var item = menu.addItem(); // set the menu item to be visible // this accelerator key will work item.set("item visible",globals.feedback_item,input,"media:///yourimage.gif","shift meta PAGE_DOWN","e",true,true); var item = menu.addItem(); // now the item is enabled and NOT visible item.set("item invisible",globals.feedback_item,input,"media:///yourimage.gif","A","m",true,false); // add a separator at the last position or at a given index menu.addSeparator(); return; // when you don't define an index the checkbox will be added at the last position // this is what you usually do to build a new menu var checkbox = menu.addCheckBox(); // create the settings for the specified menu item // minimum settings are the text and method properties // the method can be a global or form method // be sure to enter the method WITHOUT '()' at the end checkbox.set("item 09",feedback_checkbox); // ,false,input,"media:///yourimage.gif"); var checkbox = menu.addCheckBox(); checkbox.set("item 10",feedback_checkbox,true,null,"media:///yourimage.gif"); // add a separator at the last position or at a given index menu.addSeparator(); // add a new Radiobutton Group // the Radiobutton Group 'binds' the added radiobuttons to each other menu.addRadioGroup(); var radiobutton = menu.addRadioButton(); radiobutton.set("item 12",feedback_radiobutton,false,input,"media:///yourimage.gif"); var radiobutton = menu.addRadioButton(); radiobutton.set("item 13",feedback_radiobutton,true,null,"media:///yourimage.gif"); // add a new Radiobutton Group menu.addRadioGroup(); var radiobutton = menu.addRadioButton(); radiobutton.set("item 14",feedback_radiobutton,false,null,null,"F6","i"); var radiobutton = menu.addRadioButton(); radiobutton.set("item 15",feedback_radiobutton,false,null,null,"meta F7","t"); // add a separator at the last position or at a given index menu.addSeparator(); // and add some submenu's var submenu1 = menu.addSubMenu(); submenu1.set("submenu 17"); submenu1.addItem().set("sub item 17-00",globals.sampleMenuExec); var submenu2 = submenu1.addSubMenu(); submenu2.set("submenu 01"); submenu2.addItem().set("sub item 01-00",globals.sampleMenuExec); var submenu3 = submenu1.addSubMenu(); submenu3.set("submenu 02"); // add a separator at the last position or at a given index menu.addSeparator(); // WIZARD // You can use the menubar wizard Tools/Plugins/IT2Be help/Menubar Wizzzard to create you menu // The wizard will help you at least to learn how to use the plugin and will help you to find the correct // accelerator key string {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=E84294337909A9DC-37D048F8-4B894199-BD8B921C-68248639B76B27FB9CA8E9AE}{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:E84294337909A9DC-37D048F8-4B894199-BD8B921C-68248639B76B27FB9CA8E9AE_des|text=|trigger=button}{sub-section}{sub-section:E84294337909A9DC-37D048F8-4B894199-BD8B921C-68248639B76B27FB9CA8E9AE_des|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}{tr:id=prs}{td}*Parameters*\\{sub-section:E84294337909A9DC-37D048F8-4B894199-BD8B921C-68248639B76B27FB9CA8E9AE_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:E84294337909A9DC-37D048F8-4B894199-BD8B921C-68248639B76B27FB9CA8E9AE_prs|trigger=none}\[index\] {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:E84294337909A9DC-37D048F8-4B894199-BD8B921C-68248639B76B27FB9CA8E9AE_ret|text=|trigger=button}{sub-section}{sub-section:E84294337909A9DC-37D048F8-4B894199-BD8B921C-68248639B76B27FB9CA8E9AE_ret|trigger=none|class=sIndent}[RadioButton]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:E84294337909A9DC-37D048F8-4B894199-BD8B921C-68248639B76B27FB9CA8E9AE_see|text=|trigger=button}{sub-section}{sub-section:E84294337909A9DC-37D048F8-4B894199-BD8B921C-68248639B76B27FB9CA8E9AE_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:E84294337909A9DC-37D048F8-4B894199-BD8B921C-68248639B76B27FB9CA8E9AE_see|text=|trigger=button}{sub-section}{sub-section:E84294337909A9DC-37D048F8-4B894199-BD8B921C-68248639B76B27FB9CA8E9AE_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:E84294337909A9DC-37D048F8-4B894199-BD8B921C-68248639B76B27FB9CA8E9AE_sam|text=|trigger=button}{sub-section}{sub-section:E84294337909A9DC-37D048F8-4B894199-BD8B921C-68248639B76B27FB9CA8E9AE_sam|class=sIndent|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 at 0 (zero) so index 2 is in fact position 3 var menu = plugins.menubar.getMenu(plugins.menubar.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 var radiobutton = menu.addRadioButton(); // 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 radiobutton.set("radiobutton with feedback",feedback_radiobutton); var radiobutton = menu.addRadioButton(); // set the radiobutton to selected radiobutton.set("radiobutton selected",feedback_radiobutton, true); var radiobutton = menu.addRadioButton(); // 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.set("radiobutton with input",feedback_radiobutton,false,input); var radiobutton = menu.addRadioButton(); // add an icon to the item radiobutton.set("radiobutton with icon",feedback_radiobutton,false,input,"media:///yourimage.gif"); var radiobutton = menu.addRadioButton(); // 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.set("radiobutton with accelerator",feedback_radiobutton,false,input,"media:///yourimage.gif","alt shift 3"); // add a separator at the last position or at a given index menu.addSeparator(); // add a new Radiobutton group menu.addRadioGroup(); var radiobutton = menu.addRadioButton(); // add a mnemonic key ('i' in our example) which is the underlined shortkey on windows // REMARK: setting the mnemonic key is platform dependent radiobutton.set("radiobutton with mnemonic",feedback_radiobutton,false,input,"media:///yourimage.gif","a","i"); var radiobutton = menu.addRadioButton(); // disable the menu item radiobutton.set("radiobutton disabled",feedback_radiobutton,false,input,"media:///yourimage.gif","control 3","t",false); var radiobutton = menu.addRadioButton(); // set the menu item to be visible radiobutton.set("radiobutton visible",feedback_radiobutton,true,input,"media:///yourimage.gif","meta 4","e",true,true); var radiobutton = menu.addRadioButton(); // now the item is enabled and NOT visible radiobutton.set("radiobutton invisible",feedback_radiobutton,false,input,"media:///yourimage.gif","alt 5","m",true,false); // add a separator at the last position or at a given index menu.addSeparator(); // WIZARD // You can use the menubar wizard Tools/Plugins/IT2Be help/Menubar Wizzzard to create you menu // The wizard will help you at least to learn how to use the plugin and will help you to find the correct // accelerator key string {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=9C6FF23A4DD9E223-C1D82273-44244AEA-AC78828A-2FE5976C20857ABE6CFF21AE}{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:9C6FF23A4DD9E223-C1D82273-44244AEA-AC78828A-2FE5976C20857ABE6CFF21AE_des|text=|trigger=button}{sub-section}{sub-section:9C6FF23A4DD9E223-C1D82273-44244AEA-AC78828A-2FE5976C20857ABE6CFF21AE_des|trigger=none|class=sIndent}Add a Radiogroup for the Radiobuttons...{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:9C6FF23A4DD9E223-C1D82273-44244AEA-AC78828A-2FE5976C20857ABE6CFF21AE_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:9C6FF23A4DD9E223-C1D82273-44244AEA-AC78828A-2FE5976C20857ABE6CFF21AE_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:9C6FF23A4DD9E223-C1D82273-44244AEA-AC78828A-2FE5976C20857ABE6CFF21AE_ret|text=|trigger=button}{sub-section}{sub-section:9C6FF23A4DD9E223-C1D82273-44244AEA-AC78828A-2FE5976C20857ABE6CFF21AE_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:9C6FF23A4DD9E223-C1D82273-44244AEA-AC78828A-2FE5976C20857ABE6CFF21AE_see|text=|trigger=button}{sub-section}{sub-section:9C6FF23A4DD9E223-C1D82273-44244AEA-AC78828A-2FE5976C20857ABE6CFF21AE_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:9C6FF23A4DD9E223-C1D82273-44244AEA-AC78828A-2FE5976C20857ABE6CFF21AE_see|text=|trigger=button}{sub-section}{sub-section:9C6FF23A4DD9E223-C1D82273-44244AEA-AC78828A-2FE5976C20857ABE6CFF21AE_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:9C6FF23A4DD9E223-C1D82273-44244AEA-AC78828A-2FE5976C20857ABE6CFF21AE_sam|text=|trigger=button}{sub-section}{sub-section:9C6FF23A4DD9E223-C1D82273-44244AEA-AC78828A-2FE5976C20857ABE6CFF21AE_sam|class=sIndent|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.menubar.getMenu(plugins.menubar.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 var radiobutton = menu.addRadioButton(); // 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 radiobutton.set("radiobutton with feedback",feedback_radiobutton); var radiobutton = menu.addRadioButton(); // set the radiobutton to selected radiobutton.set("radiobutton selected",feedback_radiobutton, true); var radiobutton = menu.addRadioButton(); // 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.set("radiobutton with input",feedback_radiobutton,false,input); var radiobutton = menu.addRadioButton(); // add an icon to the item radiobutton.set("radiobutton with icon",feedback_radiobutton,false,input,"media:///yourimage.gif"); var radiobutton = menu.addRadioButton(); // 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.set("radiobutton with accelerator",feedback_radiobutton,false,input,"media:///yourimage.gif","alt shift 3"); // add a separator at the last position or at a given index menu.addSeparator(); // add a new Radiobutton group menu.addRadioGroup(); var radiobutton = menu.addRadioButton(); // add a mnemonic key ('i' in our example) which is the underlined shortkey on windows // REMARK: setting the mnemonic key is platform dependent radiobutton.set("radiobutton with mnemonic",feedback_radiobutton,false,input,"media:///yourimage.gif","a","i"); var radiobutton = menu.addRadioButton(); // disable the menu item radiobutton.set("radiobutton disabled",feedback_radiobutton,false,input,"media:///yourimage.gif","control 3","t",false); var radiobutton = menu.addRadioButton(); // set the menu item to be visible radiobutton.set("radiobutton visible",feedback_radiobutton,true,input,"media:///yourimage.gif","meta 4","e",true,true); var radiobutton = menu.addRadioButton(); // now the item is enabled and NOT visible radiobutton.set("radiobutton invisible",feedback_radiobutton,false,input,"media:///yourimage.gif","alt 5","m",true,false); // add a separator at the last position or at a given index menu.addSeparator(); // WIZARD // You can use the menubar wizard Tools/Plugins/IT2Be help/Menubar Wizzzard to create you menu // The wizard will help you at least to learn how to use the plugin and will help you to find the correct // accelerator key string {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=9CA71612A84F418E-AF6FF6E5-4EE24AF5-AD4EBC2E-1433F9CEF99B1C7F2AA75DF8}{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:9CA71612A84F418E-AF6FF6E5-4EE24AF5-AD4EBC2E-1433F9CEF99B1C7F2AA75DF8_des|text=|trigger=button}{sub-section}{sub-section:9CA71612A84F418E-AF6FF6E5-4EE24AF5-AD4EBC2E-1433F9CEF99B1C7F2AA75DF8_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}{tr:id=prs}{td}*Parameters*\\{sub-section:9CA71612A84F418E-AF6FF6E5-4EE24AF5-AD4EBC2E-1433F9CEF99B1C7F2AA75DF8_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:9CA71612A84F418E-AF6FF6E5-4EE24AF5-AD4EBC2E-1433F9CEF99B1C7F2AA75DF8_prs|trigger=none}\[index\] {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:9CA71612A84F418E-AF6FF6E5-4EE24AF5-AD4EBC2E-1433F9CEF99B1C7F2AA75DF8_ret|text=|trigger=button}{sub-section}{sub-section:9CA71612A84F418E-AF6FF6E5-4EE24AF5-AD4EBC2E-1433F9CEF99B1C7F2AA75DF8_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:9CA71612A84F418E-AF6FF6E5-4EE24AF5-AD4EBC2E-1433F9CEF99B1C7F2AA75DF8_see|text=|trigger=button}{sub-section}{sub-section:9CA71612A84F418E-AF6FF6E5-4EE24AF5-AD4EBC2E-1433F9CEF99B1C7F2AA75DF8_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:9CA71612A84F418E-AF6FF6E5-4EE24AF5-AD4EBC2E-1433F9CEF99B1C7F2AA75DF8_see|text=|trigger=button}{sub-section}{sub-section:9CA71612A84F418E-AF6FF6E5-4EE24AF5-AD4EBC2E-1433F9CEF99B1C7F2AA75DF8_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:9CA71612A84F418E-AF6FF6E5-4EE24AF5-AD4EBC2E-1433F9CEF99B1C7F2AA75DF8_sam|text=|trigger=button}{sub-section}{sub-section:9CA71612A84F418E-AF6FF6E5-4EE24AF5-AD4EBC2E-1433F9CEF99B1C7F2AA75DF8_sam|class=sIndent|trigger=none}{code:language=javascript} // Add the separator at the selected index (starting at 0) or add it at the end (empty)... plugins.menubar.getMenu(0).addSeparator(); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=D4B75257F83BDF0D-F63CD3BC-40CB4E95-AADA857E-EC2D96785A0036014AC736EE}{tr:id=name}{td}h6.addSubMenu{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Menu]{span}{span:id=iets|style=float: left; font-weight: bold;}addSubMenu{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:D4B75257F83BDF0D-F63CD3BC-40CB4E95-AADA857E-EC2D96785A0036014AC736EE_des|text=|trigger=button}{sub-section}{sub-section:D4B75257F83BDF0D-F63CD3BC-40CB4E95-AADA857E-EC2D96785A0036014AC736EE_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}{tr:id=prs}{td}*Parameters*\\{sub-section:D4B75257F83BDF0D-F63CD3BC-40CB4E95-AADA857E-EC2D96785A0036014AC736EE_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:D4B75257F83BDF0D-F63CD3BC-40CB4E95-AADA857E-EC2D96785A0036014AC736EE_prs|trigger=none}\[index\] {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:D4B75257F83BDF0D-F63CD3BC-40CB4E95-AADA857E-EC2D96785A0036014AC736EE_ret|text=|trigger=button}{sub-section}{sub-section:D4B75257F83BDF0D-F63CD3BC-40CB4E95-AADA857E-EC2D96785A0036014AC736EE_ret|trigger=none|class=sIndent}[Menu]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:D4B75257F83BDF0D-F63CD3BC-40CB4E95-AADA857E-EC2D96785A0036014AC736EE_see|text=|trigger=button}{sub-section}{sub-section:D4B75257F83BDF0D-F63CD3BC-40CB4E95-AADA857E-EC2D96785A0036014AC736EE_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:D4B75257F83BDF0D-F63CD3BC-40CB4E95-AADA857E-EC2D96785A0036014AC736EE_see|text=|trigger=button}{sub-section}{sub-section:D4B75257F83BDF0D-F63CD3BC-40CB4E95-AADA857E-EC2D96785A0036014AC736EE_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:D4B75257F83BDF0D-F63CD3BC-40CB4E95-AADA857E-EC2D96785A0036014AC736EE_sam|text=|trigger=button}{sub-section}{sub-section:D4B75257F83BDF0D-F63CD3BC-40CB4E95-AADA857E-EC2D96785A0036014AC736EE_sam|class=sIndent|trigger=none}{builder-show:permission=edit}{code:language=javascript} {code}{builder-show}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=7DA9BCAE681971D5-3A3FC883-4EA341AB-8204B751-51501BC78FB03811AC230746}{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:7DA9BCAE681971D5-3A3FC883-4EA341AB-8204B751-51501BC78FB03811AC230746_des|text=|trigger=button}{sub-section}{sub-section:7DA9BCAE681971D5-3A3FC883-4EA341AB-8204B751-51501BC78FB03811AC230746_des|trigger=none|class=sIndent}Script the selection (emulate a mouse click) of the menu...{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:7DA9BCAE681971D5-3A3FC883-4EA341AB-8204B751-51501BC78FB03811AC230746_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:7DA9BCAE681971D5-3A3FC883-4EA341AB-8204B751-51501BC78FB03811AC230746_prs|trigger=none}click {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:7DA9BCAE681971D5-3A3FC883-4EA341AB-8204B751-51501BC78FB03811AC230746_ret|text=|trigger=button}{sub-section}{sub-section:7DA9BCAE681971D5-3A3FC883-4EA341AB-8204B751-51501BC78FB03811AC230746_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:7DA9BCAE681971D5-3A3FC883-4EA341AB-8204B751-51501BC78FB03811AC230746_see|text=|trigger=button}{sub-section}{sub-section:7DA9BCAE681971D5-3A3FC883-4EA341AB-8204B751-51501BC78FB03811AC230746_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:7DA9BCAE681971D5-3A3FC883-4EA341AB-8204B751-51501BC78FB03811AC230746_see|text=|trigger=button}{sub-section}{sub-section:7DA9BCAE681971D5-3A3FC883-4EA341AB-8204B751-51501BC78FB03811AC230746_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:7DA9BCAE681971D5-3A3FC883-4EA341AB-8204B751-51501BC78FB03811AC230746_sam|text=|trigger=button}{sub-section}{sub-section:7DA9BCAE681971D5-3A3FC883-4EA341AB-8204B751-51501BC78FB03811AC230746_sam|class=sIndent|trigger=none}{code:language=javascript} // Script the selection (emulate a mouse click) of the menu... plugins.menubar.getMenu(0).doClick(); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=AF5BBBDEA5A0F307-CC64CCBB-44714F06-81648CE0-A6C0D5373932FC8DACFD9BEB}{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:AF5BBBDEA5A0F307-CC64CCBB-44714F06-81648CE0-A6C0D5373932FC8DACFD9BEB_des|text=|trigger=button}{sub-section}{sub-section:AF5BBBDEA5A0F307-CC64CCBB-44714F06-81648CE0-A6C0D5373932FC8DACFD9BEB_des|trigger=none|class=sIndent}Get the Checkbox at the selected index (starting at 0)...{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:AF5BBBDEA5A0F307-CC64CCBB-44714F06-81648CE0-A6C0D5373932FC8DACFD9BEB_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:AF5BBBDEA5A0F307-CC64CCBB-44714F06-81648CE0-A6C0D5373932FC8DACFD9BEB_prs|trigger=none}index {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:AF5BBBDEA5A0F307-CC64CCBB-44714F06-81648CE0-A6C0D5373932FC8DACFD9BEB_ret|text=|trigger=button}{sub-section}{sub-section:AF5BBBDEA5A0F307-CC64CCBB-44714F06-81648CE0-A6C0D5373932FC8DACFD9BEB_ret|trigger=none|class=sIndent}[CheckBox]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:AF5BBBDEA5A0F307-CC64CCBB-44714F06-81648CE0-A6C0D5373932FC8DACFD9BEB_see|text=|trigger=button}{sub-section}{sub-section:AF5BBBDEA5A0F307-CC64CCBB-44714F06-81648CE0-A6C0D5373932FC8DACFD9BEB_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:AF5BBBDEA5A0F307-CC64CCBB-44714F06-81648CE0-A6C0D5373932FC8DACFD9BEB_see|text=|trigger=button}{sub-section}{sub-section:AF5BBBDEA5A0F307-CC64CCBB-44714F06-81648CE0-A6C0D5373932FC8DACFD9BEB_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:AF5BBBDEA5A0F307-CC64CCBB-44714F06-81648CE0-A6C0D5373932FC8DACFD9BEB_sam|text=|trigger=button}{sub-section}{sub-section:AF5BBBDEA5A0F307-CC64CCBB-44714F06-81648CE0-A6C0D5373932FC8DACFD9BEB_sam|class=sIndent|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.menubar.getMenu(plugins.menubar.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.menubar.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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=7A4DEE70B62121B6-89640E08-4B764BB2-B3B2B763-11B8A8B85FA515E7B7A149A7}{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:7A4DEE70B62121B6-89640E08-4B764BB2-B3B2B763-11B8A8B85FA515E7B7A149A7_des|text=|trigger=button}{sub-section}{sub-section:7A4DEE70B62121B6-89640E08-4B764BB2-B3B2B763-11B8A8B85FA515E7B7A149A7_des|trigger=none|class=sIndent}Get the item at the selected index (starting at 0)...{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:7A4DEE70B62121B6-89640E08-4B764BB2-B3B2B763-11B8A8B85FA515E7B7A149A7_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:7A4DEE70B62121B6-89640E08-4B764BB2-B3B2B763-11B8A8B85FA515E7B7A149A7_prs|trigger=none}index {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:7A4DEE70B62121B6-89640E08-4B764BB2-B3B2B763-11B8A8B85FA515E7B7A149A7_ret|text=|trigger=button}{sub-section}{sub-section:7A4DEE70B62121B6-89640E08-4B764BB2-B3B2B763-11B8A8B85FA515E7B7A149A7_ret|trigger=none|class=sIndent}[MenuItem]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:7A4DEE70B62121B6-89640E08-4B764BB2-B3B2B763-11B8A8B85FA515E7B7A149A7_see|text=|trigger=button}{sub-section}{sub-section:7A4DEE70B62121B6-89640E08-4B764BB2-B3B2B763-11B8A8B85FA515E7B7A149A7_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:7A4DEE70B62121B6-89640E08-4B764BB2-B3B2B763-11B8A8B85FA515E7B7A149A7_see|text=|trigger=button}{sub-section}{sub-section:7A4DEE70B62121B6-89640E08-4B764BB2-B3B2B763-11B8A8B85FA515E7B7A149A7_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:7A4DEE70B62121B6-89640E08-4B764BB2-B3B2B763-11B8A8B85FA515E7B7A149A7_sam|text=|trigger=button}{sub-section}{sub-section:7A4DEE70B62121B6-89640E08-4B764BB2-B3B2B763-11B8A8B85FA515E7B7A149A7_sam|class=sIndent|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.menubar.getMenu(plugins.menubar.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.menubar.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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=29CE220FD3046A2B-575D7D37-47484BC2-A02086A7-A484FEBF21173241FD765745}{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:29CE220FD3046A2B-575D7D37-47484BC2-A02086A7-A484FEBF21173241FD765745_des|text=|trigger=button}{sub-section}{sub-section:29CE220FD3046A2B-575D7D37-47484BC2-A02086A7-A484FEBF21173241FD765745_des|trigger=none|class=sIndent}Get the number of items in the menu...{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:29CE220FD3046A2B-575D7D37-47484BC2-A02086A7-A484FEBF21173241FD765745_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:29CE220FD3046A2B-575D7D37-47484BC2-A02086A7-A484FEBF21173241FD765745_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:29CE220FD3046A2B-575D7D37-47484BC2-A02086A7-A484FEBF21173241FD765745_ret|text=|trigger=button}{sub-section}{sub-section:29CE220FD3046A2B-575D7D37-47484BC2-A02086A7-A484FEBF21173241FD765745_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:29CE220FD3046A2B-575D7D37-47484BC2-A02086A7-A484FEBF21173241FD765745_see|text=|trigger=button}{sub-section}{sub-section:29CE220FD3046A2B-575D7D37-47484BC2-A02086A7-A484FEBF21173241FD765745_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:29CE220FD3046A2B-575D7D37-47484BC2-A02086A7-A484FEBF21173241FD765745_see|text=|trigger=button}{sub-section}{sub-section:29CE220FD3046A2B-575D7D37-47484BC2-A02086A7-A484FEBF21173241FD765745_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:29CE220FD3046A2B-575D7D37-47484BC2-A02086A7-A484FEBF21173241FD765745_sam|text=|trigger=button}{sub-section}{sub-section:29CE220FD3046A2B-575D7D37-47484BC2-A02086A7-A484FEBF21173241FD765745_sam|class=sIndent|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.menubar.getMenu(0).getItemCount()); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=2FE944F7B37B1B22-23AFA7B4-4E5A4074-81D49D2E-367852398B9FF5F3F523BCC0}{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;}\(name){span}{td}{tr}{tr:id=des}{td}{sub-section:2FE944F7B37B1B22-23AFA7B4-4E5A4074-81D49D2E-367852398B9FF5F3F523BCC0_des|text=|trigger=button}{sub-section}{sub-section:2FE944F7B37B1B22-23AFA7B4-4E5A4074-81D49D2E-367852398B9FF5F3F523BCC0_des|trigger=none|class=sIndent}Retrieve the index of the item by text...{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:2FE944F7B37B1B22-23AFA7B4-4E5A4074-81D49D2E-367852398B9FF5F3F523BCC0_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:2FE944F7B37B1B22-23AFA7B4-4E5A4074-81D49D2E-367852398B9FF5F3F523BCC0_prs|trigger=none}name {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:2FE944F7B37B1B22-23AFA7B4-4E5A4074-81D49D2E-367852398B9FF5F3F523BCC0_ret|text=|trigger=button}{sub-section}{sub-section:2FE944F7B37B1B22-23AFA7B4-4E5A4074-81D49D2E-367852398B9FF5F3F523BCC0_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:2FE944F7B37B1B22-23AFA7B4-4E5A4074-81D49D2E-367852398B9FF5F3F523BCC0_see|text=|trigger=button}{sub-section}{sub-section:2FE944F7B37B1B22-23AFA7B4-4E5A4074-81D49D2E-367852398B9FF5F3F523BCC0_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:2FE944F7B37B1B22-23AFA7B4-4E5A4074-81D49D2E-367852398B9FF5F3F523BCC0_see|text=|trigger=button}{sub-section}{sub-section:2FE944F7B37B1B22-23AFA7B4-4E5A4074-81D49D2E-367852398B9FF5F3F523BCC0_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:2FE944F7B37B1B22-23AFA7B4-4E5A4074-81D49D2E-367852398B9FF5F3F523BCC0_sam|text=|trigger=button}{sub-section}{sub-section:2FE944F7B37B1B22-23AFA7B4-4E5A4074-81D49D2E-367852398B9FF5F3F523BCC0_sam|class=sIndent|trigger=none}{builder-show:permission=edit}{code:language=javascript} {code}{builder-show}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=60C9C8911E20DB0A-70977D8E-408B4A27-962C82F0-0F4C4F0BF83F13A9199CF64D}{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:60C9C8911E20DB0A-70977D8E-408B4A27-962C82F0-0F4C4F0BF83F13A9199CF64D_des|text=|trigger=button}{sub-section}{sub-section:60C9C8911E20DB0A-70977D8E-408B4A27-962C82F0-0F4C4F0BF83F13A9199CF64D_des|trigger=none|class=sIndent}Get the Radiobutton at the selected index (starting at 0)...{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:60C9C8911E20DB0A-70977D8E-408B4A27-962C82F0-0F4C4F0BF83F13A9199CF64D_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:60C9C8911E20DB0A-70977D8E-408B4A27-962C82F0-0F4C4F0BF83F13A9199CF64D_prs|trigger=none}index {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:60C9C8911E20DB0A-70977D8E-408B4A27-962C82F0-0F4C4F0BF83F13A9199CF64D_ret|text=|trigger=button}{sub-section}{sub-section:60C9C8911E20DB0A-70977D8E-408B4A27-962C82F0-0F4C4F0BF83F13A9199CF64D_ret|trigger=none|class=sIndent}[RadioButton]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:60C9C8911E20DB0A-70977D8E-408B4A27-962C82F0-0F4C4F0BF83F13A9199CF64D_see|text=|trigger=button}{sub-section}{sub-section:60C9C8911E20DB0A-70977D8E-408B4A27-962C82F0-0F4C4F0BF83F13A9199CF64D_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:60C9C8911E20DB0A-70977D8E-408B4A27-962C82F0-0F4C4F0BF83F13A9199CF64D_see|text=|trigger=button}{sub-section}{sub-section:60C9C8911E20DB0A-70977D8E-408B4A27-962C82F0-0F4C4F0BF83F13A9199CF64D_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:60C9C8911E20DB0A-70977D8E-408B4A27-962C82F0-0F4C4F0BF83F13A9199CF64D_sam|text=|trigger=button}{sub-section}{sub-section:60C9C8911E20DB0A-70977D8E-408B4A27-962C82F0-0F4C4F0BF83F13A9199CF64D_sam|class=sIndent|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.menubar.getMenu(plugins.menubar.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.menubar.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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=AD3548A5C0D0D19B-392C4236-4C174A6E-90E4B22A-92DF7DEE4991E3937DCC01FD}{tr:id=name}{td}h6.getSubMenu{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Menu]{span}{span:id=iets|style=float: left; font-weight: bold;}getSubMenu{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:AD3548A5C0D0D19B-392C4236-4C174A6E-90E4B22A-92DF7DEE4991E3937DCC01FD_des|text=|trigger=button}{sub-section}{sub-section:AD3548A5C0D0D19B-392C4236-4C174A6E-90E4B22A-92DF7DEE4991E3937DCC01FD_des|trigger=none|class=sIndent}Get the submenu at the selected index (starting at 0)...{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:AD3548A5C0D0D19B-392C4236-4C174A6E-90E4B22A-92DF7DEE4991E3937DCC01FD_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:AD3548A5C0D0D19B-392C4236-4C174A6E-90E4B22A-92DF7DEE4991E3937DCC01FD_prs|trigger=none}index {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:AD3548A5C0D0D19B-392C4236-4C174A6E-90E4B22A-92DF7DEE4991E3937DCC01FD_ret|text=|trigger=button}{sub-section}{sub-section:AD3548A5C0D0D19B-392C4236-4C174A6E-90E4B22A-92DF7DEE4991E3937DCC01FD_ret|trigger=none|class=sIndent}[Menu]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:AD3548A5C0D0D19B-392C4236-4C174A6E-90E4B22A-92DF7DEE4991E3937DCC01FD_see|text=|trigger=button}{sub-section}{sub-section:AD3548A5C0D0D19B-392C4236-4C174A6E-90E4B22A-92DF7DEE4991E3937DCC01FD_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:AD3548A5C0D0D19B-392C4236-4C174A6E-90E4B22A-92DF7DEE4991E3937DCC01FD_see|text=|trigger=button}{sub-section}{sub-section:AD3548A5C0D0D19B-392C4236-4C174A6E-90E4B22A-92DF7DEE4991E3937DCC01FD_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:AD3548A5C0D0D19B-392C4236-4C174A6E-90E4B22A-92DF7DEE4991E3937DCC01FD_sam|text=|trigger=button}{sub-section}{sub-section:AD3548A5C0D0D19B-392C4236-4C174A6E-90E4B22A-92DF7DEE4991E3937DCC01FD_sam|class=sIndent|trigger=none}{builder-show:permission=edit}{code:language=javascript} {code}{builder-show}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=668480D067DB7BC1-2BE84DB9-4D9441B8-B35DB38C-17112D5062F97E6BF4C1B815}{tr:id=name}{td}h6.removeAllItems{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}removeAllItems{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:668480D067DB7BC1-2BE84DB9-4D9441B8-B35DB38C-17112D5062F97E6BF4C1B815_des|text=|trigger=button}{sub-section}{sub-section:668480D067DB7BC1-2BE84DB9-4D9441B8-B35DB38C-17112D5062F97E6BF4C1B815_des|trigger=none|class=sIndent}Remove all items from the menu...{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:668480D067DB7BC1-2BE84DB9-4D9441B8-B35DB38C-17112D5062F97E6BF4C1B815_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:668480D067DB7BC1-2BE84DB9-4D9441B8-B35DB38C-17112D5062F97E6BF4C1B815_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:668480D067DB7BC1-2BE84DB9-4D9441B8-B35DB38C-17112D5062F97E6BF4C1B815_ret|text=|trigger=button}{sub-section}{sub-section:668480D067DB7BC1-2BE84DB9-4D9441B8-B35DB38C-17112D5062F97E6BF4C1B815_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:668480D067DB7BC1-2BE84DB9-4D9441B8-B35DB38C-17112D5062F97E6BF4C1B815_see|text=|trigger=button}{sub-section}{sub-section:668480D067DB7BC1-2BE84DB9-4D9441B8-B35DB38C-17112D5062F97E6BF4C1B815_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:668480D067DB7BC1-2BE84DB9-4D9441B8-B35DB38C-17112D5062F97E6BF4C1B815_see|text=|trigger=button}{sub-section}{sub-section:668480D067DB7BC1-2BE84DB9-4D9441B8-B35DB38C-17112D5062F97E6BF4C1B815_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:668480D067DB7BC1-2BE84DB9-4D9441B8-B35DB38C-17112D5062F97E6BF4C1B815_sam|text=|trigger=button}{sub-section}{sub-section:668480D067DB7BC1-2BE84DB9-4D9441B8-B35DB38C-17112D5062F97E6BF4C1B815_sam|class=sIndent|trigger=none}{code:language=javascript} // Remove all items from the menu... // get the menu at the last index // indexes start at 0 (zero) so index 2 is in fact position 3 var menu = plugins.menubar.getMenu(plugins.menubar.getMenuCount() - 1); // remove all menu items from the selected menu menu.removeAllItems(); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=38F305092021CFDE-D554279B-45354781-AFB6B0F0-9E23849DD976F4D0C11B69E5}{tr:id=name}{td}h6.removeItem{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}removeItem{span}{span:id=iets|style=float: left;}\(index 1, index 2-n){span}{td}{tr}{tr:id=des}{td}{sub-section:38F305092021CFDE-D554279B-45354781-AFB6B0F0-9E23849DD976F4D0C11B69E5_des|text=|trigger=button}{sub-section}{sub-section:38F305092021CFDE-D554279B-45354781-AFB6B0F0-9E23849DD976F4D0C11B69E5_des|trigger=none|class=sIndent}Remove the item(s) at the selected index/indices...{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:38F305092021CFDE-D554279B-45354781-AFB6B0F0-9E23849DD976F4D0C11B69E5_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:38F305092021CFDE-D554279B-45354781-AFB6B0F0-9E23849DD976F4D0C11B69E5_prs|trigger=none}index 1 \[index 2-n\] {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:38F305092021CFDE-D554279B-45354781-AFB6B0F0-9E23849DD976F4D0C11B69E5_ret|text=|trigger=button}{sub-section}{sub-section:38F305092021CFDE-D554279B-45354781-AFB6B0F0-9E23849DD976F4D0C11B69E5_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:38F305092021CFDE-D554279B-45354781-AFB6B0F0-9E23849DD976F4D0C11B69E5_see|text=|trigger=button}{sub-section}{sub-section:38F305092021CFDE-D554279B-45354781-AFB6B0F0-9E23849DD976F4D0C11B69E5_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:38F305092021CFDE-D554279B-45354781-AFB6B0F0-9E23849DD976F4D0C11B69E5_see|text=|trigger=button}{sub-section}{sub-section:38F305092021CFDE-D554279B-45354781-AFB6B0F0-9E23849DD976F4D0C11B69E5_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:38F305092021CFDE-D554279B-45354781-AFB6B0F0-9E23849DD976F4D0C11B69E5_sam|text=|trigger=button}{sub-section}{sub-section:38F305092021CFDE-D554279B-45354781-AFB6B0F0-9E23849DD976F4D0C11B69E5_sam|class=sIndent|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.menubar.getMenu(plugins.menubar.getMenuCount() - 1); // remove only one item at the selected index // from the selected menu // menu.removeItem(0); // remove more than one item at the selected indices // from the selected menu menu.removeItem(1,2); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=72CF9D97DA32E1A9-BE08874F-41484C4C-9A20BD34-67F8A7E5F0667ADFE8C3834A}{tr:id=name}{td}h6.set{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}set{span}{span:id=iets|style=float: left;}\(text, mnemonic, enabled){span}{td}{tr}{tr:id=des}{td}{sub-section:72CF9D97DA32E1A9-BE08874F-41484C4C-9A20BD34-67F8A7E5F0667ADFE8C3834A_des|text=|trigger=button}{sub-section}{sub-section:72CF9D97DA32E1A9-BE08874F-41484C4C-9A20BD34-67F8A7E5F0667ADFE8C3834A_des|trigger=none|class=sIndent}Set the menu with a text and optional mnemonic key. The menu is enabled by default...{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:72CF9D97DA32E1A9-BE08874F-41484C4C-9A20BD34-67F8A7E5F0667ADFE8C3834A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:72CF9D97DA32E1A9-BE08874F-41484C4C-9A20BD34-67F8A7E5F0667ADFE8C3834A_prs|trigger=none}text \[mnemonic\] \[enabled\] {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:72CF9D97DA32E1A9-BE08874F-41484C4C-9A20BD34-67F8A7E5F0667ADFE8C3834A_ret|text=|trigger=button}{sub-section}{sub-section:72CF9D97DA32E1A9-BE08874F-41484C4C-9A20BD34-67F8A7E5F0667ADFE8C3834A_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:72CF9D97DA32E1A9-BE08874F-41484C4C-9A20BD34-67F8A7E5F0667ADFE8C3834A_see|text=|trigger=button}{sub-section}{sub-section:72CF9D97DA32E1A9-BE08874F-41484C4C-9A20BD34-67F8A7E5F0667ADFE8C3834A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:72CF9D97DA32E1A9-BE08874F-41484C4C-9A20BD34-67F8A7E5F0667ADFE8C3834A_see|text=|trigger=button}{sub-section}{sub-section:72CF9D97DA32E1A9-BE08874F-41484C4C-9A20BD34-67F8A7E5F0667ADFE8C3834A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:72CF9D97DA32E1A9-BE08874F-41484C4C-9A20BD34-67F8A7E5F0667ADFE8C3834A_sam|text=|trigger=button}{sub-section}{sub-section:72CF9D97DA32E1A9-BE08874F-41484C4C-9A20BD34-67F8A7E5F0667ADFE8C3834A_sam|class=sIndent|trigger=none}{code:language=javascript} // add a menu at the given index // when you don't define an index the menu will be added at the last // positon of the menubar var menu = plugins.menubar.addMenu(); // set the text of the menu at the chose position menu.setText("add menu"); // set the mnemonic key menu.setMnemonic("a"); // disable the menu menu.setEnabled(true); // another way of doing the same thing would have been to use // the set() method menu.set("add menu", "a", true); // REMARK: normally you would add menu items, checkboxes etc in the same method // this example will show no menu items for now! // IMPORTANT: Working with menu's on developer and client can differ // WIZARD // You can use the menubar wizard Tools/Plugins/IT2Be help/Menubar Wizzzard to create you menu // The wizard will help you at least to learn how to use the plugin and will help you to find the correct // accelerator key string {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=81D2E1CDCEA6692F-841A14D2-4A164F07-9E09ADC7-A854B8AFA028BC423516D893}{tr:id=name}{td}h6.setEnabled{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}setEnabled{span}{span:id=iets|style=float: left;}\(enabled){span}{td}{tr}{tr:id=des}{td}{sub-section:81D2E1CDCEA6692F-841A14D2-4A164F07-9E09ADC7-A854B8AFA028BC423516D893_des|text=|trigger=button}{sub-section}{sub-section:81D2E1CDCEA6692F-841A14D2-4A164F07-9E09ADC7-A854B8AFA028BC423516D893_des|trigger=none|class=sIndent}Set the the selected menu enabled or disabled...{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:81D2E1CDCEA6692F-841A14D2-4A164F07-9E09ADC7-A854B8AFA028BC423516D893_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:81D2E1CDCEA6692F-841A14D2-4A164F07-9E09ADC7-A854B8AFA028BC423516D893_prs|trigger=none}enabled {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:81D2E1CDCEA6692F-841A14D2-4A164F07-9E09ADC7-A854B8AFA028BC423516D893_ret|text=|trigger=button}{sub-section}{sub-section:81D2E1CDCEA6692F-841A14D2-4A164F07-9E09ADC7-A854B8AFA028BC423516D893_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:81D2E1CDCEA6692F-841A14D2-4A164F07-9E09ADC7-A854B8AFA028BC423516D893_see|text=|trigger=button}{sub-section}{sub-section:81D2E1CDCEA6692F-841A14D2-4A164F07-9E09ADC7-A854B8AFA028BC423516D893_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:81D2E1CDCEA6692F-841A14D2-4A164F07-9E09ADC7-A854B8AFA028BC423516D893_see|text=|trigger=button}{sub-section}{sub-section:81D2E1CDCEA6692F-841A14D2-4A164F07-9E09ADC7-A854B8AFA028BC423516D893_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:81D2E1CDCEA6692F-841A14D2-4A164F07-9E09ADC7-A854B8AFA028BC423516D893_sam|text=|trigger=button}{sub-section}{sub-section:81D2E1CDCEA6692F-841A14D2-4A164F07-9E09ADC7-A854B8AFA028BC423516D893_sam|class=sIndent|trigger=none}{code:language=javascript} // Set the the selected menu enabled or disabled... var menu = plugins.menubar.getMenu(0); menu.setText("Hello"); menu.setMnemonic("H"); menu.setEnabled(false); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=573E2210553352DB-5126C48C-4D874915-B885847F-624EFF6462C3F98E064B8D64}{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;}\(icon){span}{td}{tr}{tr:id=des}{td}{sub-section:573E2210553352DB-5126C48C-4D874915-B885847F-624EFF6462C3F98E064B8D64_des|text=|trigger=button}{sub-section}{sub-section:573E2210553352DB-5126C48C-4D874915-B885847F-624EFF6462C3F98E064B8D64_des|trigger=none|class=sIndent}Set the icon of the menu...{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:573E2210553352DB-5126C48C-4D874915-B885847F-624EFF6462C3F98E064B8D64_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:573E2210553352DB-5126C48C-4D874915-B885847F-624EFF6462C3F98E064B8D64_prs|trigger=none}icon {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:573E2210553352DB-5126C48C-4D874915-B885847F-624EFF6462C3F98E064B8D64_ret|text=|trigger=button}{sub-section}{sub-section:573E2210553352DB-5126C48C-4D874915-B885847F-624EFF6462C3F98E064B8D64_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:573E2210553352DB-5126C48C-4D874915-B885847F-624EFF6462C3F98E064B8D64_see|text=|trigger=button}{sub-section}{sub-section:573E2210553352DB-5126C48C-4D874915-B885847F-624EFF6462C3F98E064B8D64_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:573E2210553352DB-5126C48C-4D874915-B885847F-624EFF6462C3F98E064B8D64_see|text=|trigger=button}{sub-section}{sub-section:573E2210553352DB-5126C48C-4D874915-B885847F-624EFF6462C3F98E064B8D64_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:573E2210553352DB-5126C48C-4D874915-B885847F-624EFF6462C3F98E064B8D64_sam|text=|trigger=button}{sub-section}{sub-section:573E2210553352DB-5126C48C-4D874915-B885847F-624EFF6462C3F98E064B8D64_sam|class=sIndent|trigger=none}{builder-show:permission=edit}{code:language=javascript} {code}{builder-show}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=CEAEEDDC74395653-5634C19D-42F94510-A280A5C2-CEC0D3E75F2786846DAA6C57}{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:CEAEEDDC74395653-5634C19D-42F94510-A280A5C2-CEC0D3E75F2786846DAA6C57_des|text=|trigger=button}{sub-section}{sub-section:CEAEEDDC74395653-5634C19D-42F94510-A280A5C2-CEC0D3E75F2786846DAA6C57_des|trigger=none|class=sIndent}Set the mnemonic of the selected menu...{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:CEAEEDDC74395653-5634C19D-42F94510-A280A5C2-CEC0D3E75F2786846DAA6C57_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:CEAEEDDC74395653-5634C19D-42F94510-A280A5C2-CEC0D3E75F2786846DAA6C57_prs|trigger=none}mnemonic {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:CEAEEDDC74395653-5634C19D-42F94510-A280A5C2-CEC0D3E75F2786846DAA6C57_ret|text=|trigger=button}{sub-section}{sub-section:CEAEEDDC74395653-5634C19D-42F94510-A280A5C2-CEC0D3E75F2786846DAA6C57_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:CEAEEDDC74395653-5634C19D-42F94510-A280A5C2-CEC0D3E75F2786846DAA6C57_see|text=|trigger=button}{sub-section}{sub-section:CEAEEDDC74395653-5634C19D-42F94510-A280A5C2-CEC0D3E75F2786846DAA6C57_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:CEAEEDDC74395653-5634C19D-42F94510-A280A5C2-CEC0D3E75F2786846DAA6C57_see|text=|trigger=button}{sub-section}{sub-section:CEAEEDDC74395653-5634C19D-42F94510-A280A5C2-CEC0D3E75F2786846DAA6C57_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:CEAEEDDC74395653-5634C19D-42F94510-A280A5C2-CEC0D3E75F2786846DAA6C57_sam|text=|trigger=button}{sub-section}{sub-section:CEAEEDDC74395653-5634C19D-42F94510-A280A5C2-CEC0D3E75F2786846DAA6C57_sam|class=sIndent|trigger=none}{code:language=javascript} // Set the mnemonic of the selected menu... var menu = plugins.menubar.getMenu(0); menu.setText("Hello"); menu.setMnemonic("H"); menu.setEnabled(false); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table} |
Overview
Content Tools
Activity