// add a new menu to the menubarvar 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 endmenu.addCheckBox("checkbox", feedback_checkbox);// add a checkbox with an iconmenu.addCheckBox("checkbox with icon", feedback_checkbox,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addCheckBox("checkbox with icon", feedback_checkbox, pic_bytes);// add a checkbox with a mnemonicmenu.addCheckBox("checkbox with mnemonic", feedback_checkbox,"media:///yourimage.gif","c");// add a disabled checkboxmenu.addCheckBox("checkbox disabled", feedback_checkbox,"media:///yourimage.gif","d",false);// add a checkbox with text aligned to the rightmenu.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 3var chk =menu.addCheckBox(2);chk.text ="checkbox at index";chk.setMethod(feedback_checkbox);
addCheckBox(index)
Add a checkbox at the selected index (starting at 0) or at the end.
Parameters
Numberindex the index at which to add the checkbox
// add a new menu to the menubarvar 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 endmenu.addCheckBox("checkbox", feedback_checkbox);// add a checkbox with an iconmenu.addCheckBox("checkbox with icon", feedback_checkbox,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addCheckBox("checkbox with icon", feedback_checkbox, pic_bytes);// add a checkbox with a mnemonicmenu.addCheckBox("checkbox with mnemonic", feedback_checkbox,"media:///yourimage.gif","c");// add a disabled checkboxmenu.addCheckBox("checkbox disabled", feedback_checkbox,"media:///yourimage.gif","d",false);// add a checkbox with text aligned to the rightmenu.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 3var chk =menu.addCheckBox(2);chk.text ="checkbox at index";chk.setMethod(feedback_checkbox);
addCheckBox(name)
Add a checkbox with given name.
Parameters
Stringname the checkbox text; this can be also html if enclosed between html tags
// add a new menu to the menubarvar 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 endmenu.addCheckBox("checkbox", feedback_checkbox);// add a checkbox with an iconmenu.addCheckBox("checkbox with icon", feedback_checkbox,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addCheckBox("checkbox with icon", feedback_checkbox, pic_bytes);// add a checkbox with a mnemonicmenu.addCheckBox("checkbox with mnemonic", feedback_checkbox,"media:///yourimage.gif","c");// add a disabled checkboxmenu.addCheckBox("checkbox disabled", feedback_checkbox,"media:///yourimage.gif","d",false);// add a checkbox with text aligned to the rightmenu.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 3var chk =menu.addCheckBox(2);chk.text ="checkbox at index";chk.setMethod(feedback_checkbox);
addCheckBox(name, feedback_item)
Add a checkbox at the selected index (starting at 0) or at the end.
Parameters
Stringname the checkbox text; this can be also html if enclosed between html tags
// add a new menu to the menubarvar 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 endmenu.addCheckBox("checkbox", feedback_checkbox);// add a checkbox with an iconmenu.addCheckBox("checkbox with icon", feedback_checkbox,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addCheckBox("checkbox with icon", feedback_checkbox, pic_bytes);// add a checkbox with a mnemonicmenu.addCheckBox("checkbox with mnemonic", feedback_checkbox,"media:///yourimage.gif","c");// add a disabled checkboxmenu.addCheckBox("checkbox disabled", feedback_checkbox,"media:///yourimage.gif","d",false);// add a checkbox with text aligned to the rightmenu.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 3var chk =menu.addCheckBox(2);chk.text ="checkbox at index";chk.setMethod(feedback_checkbox);
addCheckBox(name, feedback_item, icon)
Add a checkbox at the selected index (starting at 0) or at the end.
Parameters
Stringname the checkbox text; this can be also html if enclosed between html tags
// add a new menu to the menubarvar 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 endmenu.addCheckBox("checkbox", feedback_checkbox);// add a checkbox with an iconmenu.addCheckBox("checkbox with icon", feedback_checkbox,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addCheckBox("checkbox with icon", feedback_checkbox, pic_bytes);// add a checkbox with a mnemonicmenu.addCheckBox("checkbox with mnemonic", feedback_checkbox,"media:///yourimage.gif","c");// add a disabled checkboxmenu.addCheckBox("checkbox disabled", feedback_checkbox,"media:///yourimage.gif","d",false);// add a checkbox with text aligned to the rightmenu.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 3var chk =menu.addCheckBox(2);chk.text ="checkbox at index";chk.setMethod(feedback_checkbox);
addCheckBox(name, feedback_item, icon, mnemonic)
Add a checkbox at the selected index (starting at 0) or at the end.
Parameters
Stringname the checkbox text; this can be also html if enclosed between html tags
// add a new menu to the menubarvar 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 endmenu.addCheckBox("checkbox", feedback_checkbox);// add a checkbox with an iconmenu.addCheckBox("checkbox with icon", feedback_checkbox,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addCheckBox("checkbox with icon", feedback_checkbox, pic_bytes);// add a checkbox with a mnemonicmenu.addCheckBox("checkbox with mnemonic", feedback_checkbox,"media:///yourimage.gif","c");// add a disabled checkboxmenu.addCheckBox("checkbox disabled", feedback_checkbox,"media:///yourimage.gif","d",false);// add a checkbox with text aligned to the rightmenu.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 3var chk =menu.addCheckBox(2);chk.text ="checkbox at index";chk.setMethod(feedback_checkbox);
// add a new menu to the menubarvar 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 endmenu.addCheckBox("checkbox", feedback_checkbox);// add a checkbox with an iconmenu.addCheckBox("checkbox with icon", feedback_checkbox,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addCheckBox("checkbox with icon", feedback_checkbox, pic_bytes);// add a checkbox with a mnemonicmenu.addCheckBox("checkbox with mnemonic", feedback_checkbox,"media:///yourimage.gif","c");// add a disabled checkboxmenu.addCheckBox("checkbox disabled", feedback_checkbox,"media:///yourimage.gif","d",false);// add a checkbox with text aligned to the rightmenu.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 3var chk =menu.addCheckBox(2);chk.text ="checkbox at index";chk.setMethod(feedback_checkbox);
// add a new menu to the menubarvar 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 endmenu.addCheckBox("checkbox", feedback_checkbox);// add a checkbox with an iconmenu.addCheckBox("checkbox with icon", feedback_checkbox,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addCheckBox("checkbox with icon", feedback_checkbox, pic_bytes);// add a checkbox with a mnemonicmenu.addCheckBox("checkbox with mnemonic", feedback_checkbox,"media:///yourimage.gif","c");// add a disabled checkboxmenu.addCheckBox("checkbox disabled", feedback_checkbox,"media:///yourimage.gif","d",false);// add a checkbox with text aligned to the rightmenu.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 3var chk =menu.addCheckBox(2);chk.text ="checkbox at index";chk.setMethod(feedback_checkbox);
// add a new menu to the menubarvar 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 submenuvar submenu1 =menu.addMenu("submenu 1");submenu1.addMenuItem("sub item 1 - 1", feedback_item);// add a submenu as child of the first submenuvar 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 submenuvar 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 submenuvar 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 positionvar submenu0 =menu.addMenu(0);submenu0.text ="submenu 0";submenu0.addMenuItem("sub item 0 - 1", feedback_item);
addMenu(index)
Add a submenu at the selected index (starting at 0).
// add a new menu to the menubarvar 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 submenuvar submenu1 =menu.addMenu("submenu 1");submenu1.addMenuItem("sub item 1 - 1", feedback_item);// add a submenu as child of the first submenuvar 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 submenuvar 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 submenuvar 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 positionvar submenu0 =menu.addMenu(0);submenu0.text ="submenu 0";submenu0.addMenuItem("sub item 0 - 1", feedback_item);
addMenu(name)
Add a submenu with given name.
Parameters
Stringname the text of the submenu; this can be also html if enclosed between html tags
// add a new menu to the menubarvar 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 submenuvar submenu1 =menu.addMenu("submenu 1");submenu1.addMenuItem("sub item 1 - 1", feedback_item);// add a submenu as child of the first submenuvar 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 submenuvar 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 submenuvar 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 positionvar submenu0 =menu.addMenu(0);submenu0.text ="submenu 0";submenu0.addMenuItem("sub item 0 - 1", feedback_item);
// add a new menu to the menubarvar 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 endmenu.addMenuItem("item", feedback_item);// add an item with an iconmenu.addMenuItem("item with icon", feedback_item,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addMenuItem("item with icon", feedback_item, pic_bytes);// add an item with a mnemonicmenu.addMenuItem("item with mnemonic", feedback_item,"media:///yourimage.gif","i");//add an entry with fontawesome icon. Only supported in NGClient!menu.addMenuItem("an entry",this.feedback,'fas fa-trash-alt');// add a disabled itemmenu.addMenuItem("disabled item", feedback_item,"media:///yourimage.gif","d",false);// add an item with text aligned to the rightmenu.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 3var item =menu.addMenuItem(2);item.text ="item at index";item.setMethod(feedback_item);
addMenuItem(index)
Add a menu item at the selected index (starting at 0) or at the end.
Parameters
Numberindex the index at which to add the menu item
// add a new menu to the menubarvar 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 endmenu.addMenuItem("item", feedback_item);// add an item with an iconmenu.addMenuItem("item with icon", feedback_item,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addMenuItem("item with icon", feedback_item, pic_bytes);// add an item with a mnemonicmenu.addMenuItem("item with mnemonic", feedback_item,"media:///yourimage.gif","i");//add an entry with fontawesome icon. Only supported in NGClient!menu.addMenuItem("an entry",this.feedback,'fas fa-trash-alt');// add a disabled itemmenu.addMenuItem("disabled item", feedback_item,"media:///yourimage.gif","d",false);// add an item with text aligned to the rightmenu.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 3var item =menu.addMenuItem(2);item.text ="item at index";item.setMethod(feedback_item);
addMenuItem(name)
Add a menu item with given name.
Parameters
Stringname the menu item text; this can be also html if enclosed between html tags
// add a new menu to the menubarvar 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 endmenu.addMenuItem("item", feedback_item);// add an item with an iconmenu.addMenuItem("item with icon", feedback_item,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addMenuItem("item with icon", feedback_item, pic_bytes);// add an item with a mnemonicmenu.addMenuItem("item with mnemonic", feedback_item,"media:///yourimage.gif","i");//add an entry with fontawesome icon. Only supported in NGClient!menu.addMenuItem("an entry",this.feedback,'fas fa-trash-alt');// add a disabled itemmenu.addMenuItem("disabled item", feedback_item,"media:///yourimage.gif","d",false);// add an item with text aligned to the rightmenu.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 3var item =menu.addMenuItem(2);item.text ="item at index";item.setMethod(feedback_item);
addMenuItem(name, feedback_item)
Add a menu item at the selected index (starting at 0) or at the end.
Parameters
Stringname the menu item text; this can be also html if enclosed between html tags
// add a new menu to the menubarvar 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 endmenu.addMenuItem("item", feedback_item);// add an item with an iconmenu.addMenuItem("item with icon", feedback_item,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addMenuItem("item with icon", feedback_item, pic_bytes);// add an item with a mnemonicmenu.addMenuItem("item with mnemonic", feedback_item,"media:///yourimage.gif","i");//add an entry with fontawesome icon. Only supported in NGClient!menu.addMenuItem("an entry",this.feedback,'fas fa-trash-alt');// add a disabled itemmenu.addMenuItem("disabled item", feedback_item,"media:///yourimage.gif","d",false);// add an item with text aligned to the rightmenu.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 3var item =menu.addMenuItem(2);item.text ="item at index";item.setMethod(feedback_item);
addMenuItem(name, feedback_item, icon)
Add a menu item at the selected index (starting at 0) or at the end.
Parameters
Stringname the menu item text; this can be also html if enclosed between html tags
// add a new menu to the menubarvar 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 endmenu.addMenuItem("item", feedback_item);// add an item with an iconmenu.addMenuItem("item with icon", feedback_item,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addMenuItem("item with icon", feedback_item, pic_bytes);// add an item with a mnemonicmenu.addMenuItem("item with mnemonic", feedback_item,"media:///yourimage.gif","i");//add an entry with fontawesome icon. Only supported in NGClient!menu.addMenuItem("an entry",this.feedback,'fas fa-trash-alt');// add a disabled itemmenu.addMenuItem("disabled item", feedback_item,"media:///yourimage.gif","d",false);// add an item with text aligned to the rightmenu.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 3var item =menu.addMenuItem(2);item.text ="item at index";item.setMethod(feedback_item);
addMenuItem(name, feedback_item, icon, mnemonic)
Add a menu item at the selected index (starting at 0) or at the end.
Parameters
Stringname the menu item text; this can be also html if enclosed between html tags
// add a new menu to the menubarvar 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 endmenu.addMenuItem("item", feedback_item);// add an item with an iconmenu.addMenuItem("item with icon", feedback_item,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addMenuItem("item with icon", feedback_item, pic_bytes);// add an item with a mnemonicmenu.addMenuItem("item with mnemonic", feedback_item,"media:///yourimage.gif","i");//add an entry with fontawesome icon. Only supported in NGClient!menu.addMenuItem("an entry",this.feedback,'fas fa-trash-alt');// add a disabled itemmenu.addMenuItem("disabled item", feedback_item,"media:///yourimage.gif","d",false);// add an item with text aligned to the rightmenu.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 3var item =menu.addMenuItem(2);item.text ="item at index";item.setMethod(feedback_item);
// add a new menu to the menubarvar 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 endmenu.addMenuItem("item", feedback_item);// add an item with an iconmenu.addMenuItem("item with icon", feedback_item,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addMenuItem("item with icon", feedback_item, pic_bytes);// add an item with a mnemonicmenu.addMenuItem("item with mnemonic", feedback_item,"media:///yourimage.gif","i");//add an entry with fontawesome icon. Only supported in NGClient!menu.addMenuItem("an entry",this.feedback,'fas fa-trash-alt');// add a disabled itemmenu.addMenuItem("disabled item", feedback_item,"media:///yourimage.gif","d",false);// add an item with text aligned to the rightmenu.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 3var item =menu.addMenuItem(2);item.text ="item at index";item.setMethod(feedback_item);
// add a new menu to the menubarvar 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 endmenu.addMenuItem("item", feedback_item);// add an item with an iconmenu.addMenuItem("item with icon", feedback_item,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addMenuItem("item with icon", feedback_item, pic_bytes);// add an item with a mnemonicmenu.addMenuItem("item with mnemonic", feedback_item,"media:///yourimage.gif","i");//add an entry with fontawesome icon. Only supported in NGClient!menu.addMenuItem("an entry",this.feedback,'fas fa-trash-alt');// add a disabled itemmenu.addMenuItem("disabled item", feedback_item,"media:///yourimage.gif","d",false);// add an item with text aligned to the rightmenu.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 3var item =menu.addMenuItem(2);item.text ="item at index";item.setMethod(feedback_item);
// add a new menu to the menubarvar 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 endmenu.addRadioButton("radio", feedback_radiobutton);// add a radiobutton with an iconmenu.addRadioButton("radio with icon", feedback_radiobutton,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addRadioButton("radio with icon", feedback_radiobutton, pic_bytes);// 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 mnemonicmenu.addRadioButton("radio with mnemonic", feedback_radiobutton,"media:///yourimage.gif","i");// add a disabled radiobuttonmenu.addRadioButton("disabled radio", feedback_radiobutton,"media:///yourimage.gif","d",false);// add a radiobutton with text aligned to the rightmenu.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 3var rd =menu.addRadioButton(2);rd.text ="radio at index";rd.setMethod(feedback_item);
addRadioButton(index)
Add a radiobutton at the selected index (starting at 0) or at the end.
Parameters
Numberindex the index at which to add the radio button
// add a new menu to the menubarvar 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 endmenu.addRadioButton("radio", feedback_radiobutton);// add a radiobutton with an iconmenu.addRadioButton("radio with icon", feedback_radiobutton,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addRadioButton("radio with icon", feedback_radiobutton, pic_bytes);// 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 mnemonicmenu.addRadioButton("radio with mnemonic", feedback_radiobutton,"media:///yourimage.gif","i");// add a disabled radiobuttonmenu.addRadioButton("disabled radio", feedback_radiobutton,"media:///yourimage.gif","d",false);// add a radiobutton with text aligned to the rightmenu.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 3var rd =menu.addRadioButton(2);rd.text ="radio at index";rd.setMethod(feedback_item);
addRadioButton(name)
Add a radio button with given name.
Parameters
Stringname the radio button text; this can be also html if enclosed between html tags
// add a new menu to the menubarvar 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 endmenu.addRadioButton("radio", feedback_radiobutton);// add a radiobutton with an iconmenu.addRadioButton("radio with icon", feedback_radiobutton,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addRadioButton("radio with icon", feedback_radiobutton, pic_bytes);// 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 mnemonicmenu.addRadioButton("radio with mnemonic", feedback_radiobutton,"media:///yourimage.gif","i");// add a disabled radiobuttonmenu.addRadioButton("disabled radio", feedback_radiobutton,"media:///yourimage.gif","d",false);// add a radiobutton with text aligned to the rightmenu.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 3var rd =menu.addRadioButton(2);rd.text ="radio at index";rd.setMethod(feedback_item);
addRadioButton(name, feedback_item)
Add a radiobutton at the selected index (starting at 0) or at the end.
Parameters
Stringname the radio button text; this can be also html if enclosed between html tags
// add a new menu to the menubarvar 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 endmenu.addRadioButton("radio", feedback_radiobutton);// add a radiobutton with an iconmenu.addRadioButton("radio with icon", feedback_radiobutton,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addRadioButton("radio with icon", feedback_radiobutton, pic_bytes);// 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 mnemonicmenu.addRadioButton("radio with mnemonic", feedback_radiobutton,"media:///yourimage.gif","i");// add a disabled radiobuttonmenu.addRadioButton("disabled radio", feedback_radiobutton,"media:///yourimage.gif","d",false);// add a radiobutton with text aligned to the rightmenu.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 3var rd =menu.addRadioButton(2);rd.text ="radio at index";rd.setMethod(feedback_item);
addRadioButton(name, feedback_item, icon)
Add a radiobutton at the selected index (starting at 0) or at the end.
Parameters
Stringname the radio button text; this can be also html if enclosed between html tags
// add a new menu to the menubarvar 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 endmenu.addRadioButton("radio", feedback_radiobutton);// add a radiobutton with an iconmenu.addRadioButton("radio with icon", feedback_radiobutton,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addRadioButton("radio with icon", feedback_radiobutton, pic_bytes);// 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 mnemonicmenu.addRadioButton("radio with mnemonic", feedback_radiobutton,"media:///yourimage.gif","i");// add a disabled radiobuttonmenu.addRadioButton("disabled radio", feedback_radiobutton,"media:///yourimage.gif","d",false);// add a radiobutton with text aligned to the rightmenu.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 3var rd =menu.addRadioButton(2);rd.text ="radio at index";rd.setMethod(feedback_item);
// add a new menu to the menubarvar 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 endmenu.addRadioButton("radio", feedback_radiobutton);// add a radiobutton with an iconmenu.addRadioButton("radio with icon", feedback_radiobutton,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addRadioButton("radio with icon", feedback_radiobutton, pic_bytes);// 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 mnemonicmenu.addRadioButton("radio with mnemonic", feedback_radiobutton,"media:///yourimage.gif","i");// add a disabled radiobuttonmenu.addRadioButton("disabled radio", feedback_radiobutton,"media:///yourimage.gif","d",false);// add a radiobutton with text aligned to the rightmenu.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 3var rd =menu.addRadioButton(2);rd.text ="radio at index";rd.setMethod(feedback_item);
// add a new menu to the menubarvar 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 endmenu.addRadioButton("radio", feedback_radiobutton);// add a radiobutton with an iconmenu.addRadioButton("radio with icon", feedback_radiobutton,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addRadioButton("radio with icon", feedback_radiobutton, pic_bytes);// 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 mnemonicmenu.addRadioButton("radio with mnemonic", feedback_radiobutton,"media:///yourimage.gif","i");// add a disabled radiobuttonmenu.addRadioButton("disabled radio", feedback_radiobutton,"media:///yourimage.gif","d",false);// add a radiobutton with text aligned to the rightmenu.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 3var rd =menu.addRadioButton(2);rd.text ="radio at index";rd.setMethod(feedback_item);
// add a new menu to the menubarvar 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 endmenu.addRadioButton("radio", feedback_radiobutton);// add a radiobutton with an iconmenu.addRadioButton("radio with icon", feedback_radiobutton,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addRadioButton("radio with icon", feedback_radiobutton, pic_bytes);// 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 mnemonicmenu.addRadioButton("radio with mnemonic", feedback_radiobutton,"media:///yourimage.gif","i");// add a disabled radiobuttonmenu.addRadioButton("disabled radio", feedback_radiobutton,"media:///yourimage.gif","d",false);// add a radiobutton with text aligned to the rightmenu.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 3var rd =menu.addRadioButton(2);rd.text ="radio at index";rd.setMethod(feedback_item);
addRadioGroup()
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.
Returns: void
Sample
// add a new menu to the menubarvar 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 endmenu.addRadioButton("radio", feedback_radiobutton);// add a radiobutton with an iconmenu.addRadioButton("radio with icon", feedback_radiobutton,"media:///yourimage.gif");//var pic_bytes = plugins.file.readFile("/path/to/image.jpg");//menu.addRadioButton("radio with icon", feedback_radiobutton, pic_bytes);// 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 mnemonicmenu.addRadioButton("radio with mnemonic", feedback_radiobutton,"media:///yourimage.gif","i");// add a disabled radiobuttonmenu.addRadioButton("disabled radio", feedback_radiobutton,"media:///yourimage.gif","d",false);// add a radiobutton with text aligned to the rightmenu.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 3var rd =menu.addRadioButton(2);rd.text ="radio at index";rd.setMethod(feedback_item);
addSeparator()
Add the separator at the selected index (starting at 0) or at the end (empty).
Returns: void
Sample
// add a new menu to the menubarvar 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 checkboxmenu.addMenuItem("item", feedback_item);menu.addCheckBox("checkbox", feedback_checkbox);// add a separatormenu.addSeparator();// add a radiobutton. it will be separated from the rest of the control by the separatormenu.addRadioButton("radio", feedback_radiobutton);// add another separator between the item and the checkboxmenu.addSeparator(1);
addSeparator(index)
Add the separator at the selected index (starting at 0) or at the end (empty).
Parameters
Numberindex the index at which to add the separator
Returns: void
Sample
// add a new menu to the menubarvar 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 checkboxmenu.addMenuItem("item", feedback_item);menu.addCheckBox("checkbox", feedback_checkbox);// add a separatormenu.addSeparator();// add a radiobutton. it will be separated from the rest of the control by the separatormenu.addRadioButton("radio", feedback_radiobutton);// add another separator between the item and the checkboxmenu.addSeparator(1);
getCheckBox(index)
Get the checkbox at the selected index (starting at 0).
// add a new menu to the menubarvar menubar =plugins.window.getMenuBar();var menu =menubar.addMenu();menu.text ="New Menu";// alternatively create a popup menu//var menu = plugins.window.createPopupMenu();// add two radiobuttonsmenu.addRadioButton("radio one", feedback_radiobutton);menu.addRadioButton("radio two", feedback_radiobutton);// add a menu item, with a separator before itmenu.addSeparator();menu.addMenuItem("item", feedback_item);// add a checkbox, with a separator before itmenu.addSeparator();menu.addCheckBox("check", feedback_checkbox);// add a submenu with an item under itvar submenu =menu.addMenu("submenu");submenu.addMenuItem("subitem", feedback_item);// depending on some state, update the entries in the menuvar some_state =true;if (some_state) {// select the first radiobuttonmenu.getRadioButton(0).selected =true;} else {// select the first radiobuttonmenu.getRadioButton(1).selected =true;}// enable/disable the menu item// remember to include the separators also when counting the indexmenu.getItem(3).enabled =!some_state;// select/unselect the checkbox// remember to include the separators also when counting the indexmenu.getCheckBox(5).selected = some_state;// change the text of the submenu and its itemapplication.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";}
getClientProperty(key)
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.// add a new menu to the menubarvar 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 menumenu.addMenuItem("item", feedback_item);// set the tooltip of the menu via client properties// keep the original tooltip in a form or global variableoriginalTooltip =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);
getItem(index)
Get the item at the selected index (starting at 0).
// add a new menu to the menubarvar menubar =plugins.window.getMenuBar();var menu =menubar.addMenu();menu.text ="New Menu";// alternatively create a popup menu//var menu = plugins.window.createPopupMenu();// add two radiobuttonsmenu.addRadioButton("radio one", feedback_radiobutton);menu.addRadioButton("radio two", feedback_radiobutton);// add a menu item, with a separator before itmenu.addSeparator();menu.addMenuItem("item", feedback_item);// add a checkbox, with a separator before itmenu.addSeparator();menu.addCheckBox("check", feedback_checkbox);// add a submenu with an item under itvar submenu =menu.addMenu("submenu");submenu.addMenuItem("subitem", feedback_item);// depending on some state, update the entries in the menuvar some_state =true;if (some_state) {// select the first radiobuttonmenu.getRadioButton(0).selected =true;} else {// select the first radiobuttonmenu.getRadioButton(1).selected =true;}// enable/disable the menu item// remember to include the separators also when counting the indexmenu.getItem(3).enabled =!some_state;// select/unselect the checkbox// remember to include the separators also when counting the indexmenu.getCheckBox(5).selected = some_state;// change the text of the submenu and its itemapplication.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";}
// 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 menubarvar menubar =plugins.window.getMenuBar();var menu =menubar.addMenu();menu.text ="New Menu";// alternatively create a popup menu//var menu = plugins.window.createPopupMenu();// add two radiobuttonsmenu.addRadioButton("radio one", feedback_radiobutton);menu.addRadioButton("radio two", feedback_radiobutton);// add a checkboxmenu.addCheckBox("check", feedback_checkbox);// add a menu itemmenu.addMenuItem("item", feedback_item);// add another menu itemmenu.addMenuItem("item 2", feedback_item);// remove the last itemmenu.removeItem(menu.getItemCount() -1);
// add a new menu to the menubarvar menubar =plugins.window.getMenuBar();var menu =menubar.addMenu();menu.text ="New Menu";// alternatively create a popup menu//var menu = plugins.window.createPopupMenu();// add two radiobuttonsmenu.addRadioButton("radio one", feedback_radiobutton);menu.addRadioButton("radio two", feedback_radiobutton);// add a checkboxmenu.addCheckBox("check", feedback_checkbox);// add a menu itemmenu.addMenuItem("item", feedback_item);// add another menu itemmenu.addMenuItem("item 2", feedback_item);// find the index of the checkboxvar idx =menu.getItemIndexByText("check");// remove the checkbox by its indexmenu.removeItem(idx);// remove both radiobuttons by their indicesmenu.removeItem([0,1]);// remove all remaining entriesmenu.removeAllItems();// add back an itemmenu.addMenuItem("new item", feedback_item);
getMenu(index)
Get the submenu at the selected index (starting at 0).
// add a new menu to the menubarvar menubar =plugins.window.getMenuBar();var menu =menubar.addMenu();menu.text ="New Menu";// alternatively create a popup menu//var menu = plugins.window.createPopupMenu();// add two radiobuttonsmenu.addRadioButton("radio one", feedback_radiobutton);menu.addRadioButton("radio two", feedback_radiobutton);// add a menu item, with a separator before itmenu.addSeparator();menu.addMenuItem("item", feedback_item);// add a checkbox, with a separator before itmenu.addSeparator();menu.addCheckBox("check", feedback_checkbox);// add a submenu with an item under itvar submenu =menu.addMenu("submenu");submenu.addMenuItem("subitem", feedback_item);// depending on some state, update the entries in the menuvar some_state =true;if (some_state) {// select the first radiobuttonmenu.getRadioButton(0).selected =true;} else {// select the first radiobuttonmenu.getRadioButton(1).selected =true;}// enable/disable the menu item// remember to include the separators also when counting the indexmenu.getItem(3).enabled =!some_state;// select/unselect the checkbox// remember to include the separators also when counting the indexmenu.getCheckBox(5).selected = some_state;// change the text of the submenu and its itemapplication.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";}
getRadioButton(index)
Get the radiobutton at the selected index (starting at 0).
// add a new menu to the menubarvar menubar =plugins.window.getMenuBar();var menu =menubar.addMenu();menu.text ="New Menu";// alternatively create a popup menu//var menu = plugins.window.createPopupMenu();// add two radiobuttonsmenu.addRadioButton("radio one", feedback_radiobutton);menu.addRadioButton("radio two", feedback_radiobutton);// add a menu item, with a separator before itmenu.addSeparator();menu.addMenuItem("item", feedback_item);// add a checkbox, with a separator before itmenu.addSeparator();menu.addCheckBox("check", feedback_checkbox);// add a submenu with an item under itvar submenu =menu.addMenu("submenu");submenu.addMenuItem("subitem", feedback_item);// depending on some state, update the entries in the menuvar some_state =true;if (some_state) {// select the first radiobuttonmenu.getRadioButton(0).selected =true;} else {// select the first radiobuttonmenu.getRadioButton(1).selected =true;}// enable/disable the menu item// remember to include the separators also when counting the indexmenu.getItem(3).enabled =!some_state;// select/unselect the checkbox// remember to include the separators also when counting the indexmenu.getCheckBox(5).selected = some_state;// change the text of the submenu and its itemapplication.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";}
putClientProperty(key, value)
Sets the value for the specified element client property key.
// NOTE: Depending on the operating system, a user interface property name may be available.// add a new menu to the menubarvar 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 menumenu.addMenuItem("item", feedback_item);// set the tooltip of the menu via client properties// keep the original tooltip in a form or global variableoriginalTooltip =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);
removeAllItems()
Remove all items from the menu.
Returns: void
Sample
// add a new menu to the menubarvar menubar =plugins.window.getMenuBar();var menu =menubar.addMenu();menu.text ="New Menu";// alternatively create a popup menu//var menu = plugins.window.createPopupMenu();// add two radiobuttonsmenu.addRadioButton("radio one", feedback_radiobutton);menu.addRadioButton("radio two", feedback_radiobutton);// add a checkboxmenu.addCheckBox("check", feedback_checkbox);// add a menu itemmenu.addMenuItem("item", feedback_item);// add another menu itemmenu.addMenuItem("item 2", feedback_item);// find the index of the checkboxvar idx =menu.getItemIndexByText("check");// remove the checkbox by its indexmenu.removeItem(idx);// remove both radiobuttons by their indicesmenu.removeItem([0,1]);// remove all remaining entriesmenu.removeAllItems();// add back an itemmenu.addMenuItem("new item", feedback_item);
removeItem(index)
Remove the item(s) at the selected index/indices.
Parameters
Arrayindex array of one or moe indexes corresponding to items to remove
Returns: void
Sample
// add a new menu to the menubarvar menubar =plugins.window.getMenuBar();var menu =menubar.addMenu();menu.text ="New Menu";// alternatively create a popup menu//var menu = plugins.window.createPopupMenu();// add two radiobuttonsmenu.addRadioButton("radio one", feedback_radiobutton);menu.addRadioButton("radio two", feedback_radiobutton);// add a checkboxmenu.addCheckBox("check", feedback_checkbox);// add a menu itemmenu.addMenuItem("item", feedback_item);// add another menu itemmenu.addMenuItem("item 2", feedback_item);// find the index of the checkboxvar idx =menu.getItemIndexByText("check");// remove the checkbox by its indexmenu.removeItem(idx);// remove both radiobuttons by their indicesmenu.removeItem([0,1]);// remove all remaining entriesmenu.removeAllItems();// add back an itemmenu.addMenuItem("new item", feedback_item);
show()
Show the popup at the mouse coordinates (Smart client only).
Returns: void
Sample
// NOTE: usually this code is placed in a handler of an event (e.g. right click on some component)// create a popup menuvar menu =plugins.window.createPopupMenu();// add a menu itemmenu.addMenuItem("item", feedback_item);// add another menu itemmenu.addMenuItem("item 2", feedback_item);if (event.getSource()){// display the popup over the component which is the source of the eventmenu.show(event.getSource());// display the popup over the components, at specified coordinates relative to the component//menu.show(event.getSource(), 10, 10);// display the popup at specified coordinates relative to the main window//menu.show(100, 100);}// in Smart client, you can also use show with no parameters, it will show at the mouse coordinates://menu.show();
show(jsEvent)
Show the popup based on JSEvent information. This can be used to show popup in tableview header that is styled with labelfor label.
// NOTE: usually this code is placed in a handler of an event (e.g. right click on some component)// create a popup menuvar menu =plugins.window.createPopupMenu();// add a menu itemmenu.addMenuItem("item", feedback_item);// add another menu itemmenu.addMenuItem("item 2", feedback_item);if (event.getSource()){// display the popup over the component which is the source of the eventmenu.show(event.getSource());// display the popup over the components, at specified coordinates relative to the component//menu.show(event.getSource(), 10, 10);// display the popup at specified coordinates relative to the main window//menu.show(100, 100);}// in Smart client, you can also use show with no parameters, it will show at the mouse coordinates://menu.show();
show(component)
Show the popup below the specified element. If there is no available room, the popup is displayed above.
In NGClient, using a component from tableview/listview form doesn't work, you have to specify coordinates (from JSEvent).
// NOTE: usually this code is placed in a handler of an event (e.g. right click on some component)// create a popup menuvar menu =plugins.window.createPopupMenu();// add a menu itemmenu.addMenuItem("item", feedback_item);// add another menu itemmenu.addMenuItem("item 2", feedback_item);if (event.getSource()){// display the popup over the component which is the source of the eventmenu.show(event.getSource());// display the popup over the components, at specified coordinates relative to the component//menu.show(event.getSource(), 10, 10);// display the popup at specified coordinates relative to the main window//menu.show(100, 100);}// in Smart client, you can also use show with no parameters, it will show at the mouse coordinates://menu.show();
show(component, positionTop)
Show the popup menu according to the positionTop parameter.
By default the popup menu is displayed below the component, and if there is no room available it is displayed above.
If positionTop is true, and there is enough room available, then popup menu is displayed above;
By default, positionTop is false.
If there is not enough space above or under the component, the behavior is undefined (the browser will decide how menu is displayed)
// create a popup menuvar menu =plugins.window.createPopupMenu();// add a menu itemmenu.addMenuItem("item", feedback_item);// display the popup above the components (if there is room available)menu.show(event.getSource(),true);// display the popup above the components (if there is room available) adding the specified coordinated relative to the component
menu.show(event.getSource(),3,5,true);
show(component, x, y)
Show the popup below to the specified element, adding x an y values relative to the element.
If there is no available room, the popup is displayed above.
// NOTE: usually this code is placed in a handler of an event (e.g. right click on some component)// create a popup menuvar menu =plugins.window.createPopupMenu();// add a menu itemmenu.addMenuItem("item", feedback_item);// add another menu itemmenu.addMenuItem("item 2", feedback_item);if (event.getSource()){// display the popup over the component which is the source of the eventmenu.show(event.getSource());// display the popup over the components, at specified coordinates relative to the component//menu.show(event.getSource(), 10, 10);// display the popup at specified coordinates relative to the main window//menu.show(100, 100);}// in Smart client, you can also use show with no parameters, it will show at the mouse coordinates://menu.show();
show(component, x, y, positionTop)
Show the popup menu according to the positionTop, x, y parameters.
By default the popup menu is show at the x, y coordinates.
If positionTop is true, and there is enough room available, then popup menu's bottom - left corner is ending at the specified coordinates;
x, y values are relative to top-left corner of the component.
By default, positionTop is false.
If there is not enough space above or under the component, the behavior is undefined (the browser will decide how menu is displayed)
// create a popup menuvar menu =plugins.window.createPopupMenu();// add a menu itemmenu.addMenuItem("item", feedback_item);// display the popup above the components (if there is room available)menu.show(event.getSource(),true);// display the popup above the components (if there is room available) adding the specified coordinated relative to the component
menu.show(event.getSource(),3,5,true);
// NOTE: usually this code is placed in a handler of an event (e.g. right click on some component)// create a popup menuvar menu =plugins.window.createPopupMenu();// add a menu itemmenu.addMenuItem("item", feedback_item);// add another menu itemmenu.addMenuItem("item 2", feedback_item);if (event.getSource()){// display the popup over the component which is the source of the eventmenu.show(event.getSource());// display the popup over the components, at specified coordinates relative to the component//menu.show(event.getSource(), 10, 10);// display the popup at specified coordinates relative to the main window//menu.show(100, 100);}// in Smart client, you can also use show with no parameters, it will show at the mouse coordinates://menu.show();