{column:width=80px|padding=0px}{column}{column}{column}
Property Summary
Object[]
methodArguments
Set arguments that are sent to the callback method.
{column:width=80px|padding=0px}{column}{column}{column}
Method Summary
void
doClick()
Script the selection (emulate a mouse click) of the item.
getClientProperty(key)
Gets the specified client property for the menu item/checkbox/radiobutton based on a key.
void
putClientProperty(key, value)
Sets the value for the specified client property key of the menu item/checkbox/radiobutton.
setAccelerator()
Set the accelerator key of the menu item/checkbox/radiobutton.
void
setAlign(align)
Sets the alignment of the radiobutton.
void
setBackgroundColor()
Set the background color of the menu item/checkbox/radiobutton.
void
setForegroundColor()
Set the foreground color of the menu item/checkbox/radiobutton.
setIcon()
Set the icon of the menu item/checkbox/radiobutton.
setMethod(method)
Set the method for the menu item/checkbox/radiobutton.
setMethod(method, arguments)
Set the method for the menu item/checkbox/radiobutton.
setMnemonic()
Set the mnemonic key of the menu item/checkbox/radiobutton.
setVisible(visible)
Set the item visible.
{column:width=100%|padding=0px}{column}
Property Details
Enable/disable the menu item/checkbox/radiobutton.
Since
Replace with version info
Parameters
Also see
External links
Sample
// add a new menu to the menubar var menubar = plugins.window.getMenuBar(); var menu = menubar.addMenu(); menu.text = "New Menu"; // alternatively create a popup menu //var menu = plugins.window.createPopupMenu(); // add a menu item at the first position in the menu var entry = menu.addMenuItem(0); // alternatively add a checkbox at the first position //var entry = menu.addCheckBox(0); // or alternatively add a radiobutton at the first position //var entry = menu.addRadioButton(0); // disable the newly added entry entry.enabled = false; // give a name to the entry (the name is not visible anywhere) entry.name = "my_name"; // make the entry selected (affects checkboxes and radiobuttons) entry.selected = true; // set the text of the entry entry.text = "menu entry"; // set the callback method entry.setMethod(feedback); // set the arguments to be sent to the callback method // (an array of elements which will be passed as arguments 5, 6 and so on to the callback method) // the first 5 arguments are fixed: // [0] item index // [1] parent item index // [2] isSelected boolean // [3] parent menu text // [4] menu text entry.methodArguments = [17, "data"];
Set arguments that are sent to the callback method.
Since
Replace with version info
Parameters
Also see
External links
Sample
// add a new menu to the menubar var menubar = plugins.window.getMenuBar(); var menu = menubar.addMenu(); menu.text = "New Menu"; // alternatively create a popup menu //var menu = plugins.window.createPopupMenu(); // add a menu item at the first position in the menu var entry = menu.addMenuItem(0); // alternatively add a checkbox at the first position //var entry = menu.addCheckBox(0); // or alternatively add a radiobutton at the first position //var entry = menu.addRadioButton(0); // disable the newly added entry entry.enabled = false; // give a name to the entry (the name is not visible anywhere) entry.name = "my_name"; // make the entry selected (affects checkboxes and radiobuttons) entry.selected = true; // set the text of the entry entry.text = "menu entry"; // set the callback method entry.setMethod(feedback); // set the arguments to be sent to the callback method // (an array of elements which will be passed as arguments 5, 6 and so on to the callback method) // the first 5 arguments are fixed: // [0] item index // [1] parent item index // [2] isSelected boolean // [3] parent menu text // [4] menu text entry.methodArguments = [17, "data"];
The name of the menu item/checkbox/radiobutton. The name is used only internally, it is not
visible in the user interface.
Since
Replace with version info
Parameters
Also see
External links
Sample
// add a new menu to the menubar var menubar = plugins.window.getMenuBar(); var menu = menubar.addMenu(); menu.text = "New Menu"; // alternatively create a popup menu //var menu = plugins.window.createPopupMenu(); // add a menu item at the first position in the menu var entry = menu.addMenuItem(0); // alternatively add a checkbox at the first position //var entry = menu.addCheckBox(0); // or alternatively add a radiobutton at the first position //var entry = menu.addRadioButton(0); // disable the newly added entry entry.enabled = false; // give a name to the entry (the name is not visible anywhere) entry.name = "my_name"; // make the entry selected (affects checkboxes and radiobuttons) entry.selected = true; // set the text of the entry entry.text = "menu entry"; // set the callback method entry.setMethod(feedback); // set the arguments to be sent to the callback method // (an array of elements which will be passed as arguments 5, 6 and so on to the callback method) // the first 5 arguments are fixed: // [0] item index // [1] parent item index // [2] isSelected boolean // [3] parent menu text // [4] menu text entry.methodArguments = [17, "data"];
Select/unselect the checkbox/radiobutton.
Since
Replace with version info
Parameters
Also see
External links
Sample
// add a new menu to the menubar var menubar = plugins.window.getMenuBar(); var menu = menubar.addMenu(); menu.text = "New Menu"; // alternatively create a popup menu //var menu = plugins.window.createPopupMenu(); // add a menu item at the first position in the menu var entry = menu.addMenuItem(0); // alternatively add a checkbox at the first position //var entry = menu.addCheckBox(0); // or alternatively add a radiobutton at the first position //var entry = menu.addRadioButton(0); // disable the newly added entry entry.enabled = false; // give a name to the entry (the name is not visible anywhere) entry.name = "my_name"; // make the entry selected (affects checkboxes and radiobuttons) entry.selected = true; // set the text of the entry entry.text = "menu entry"; // set the callback method entry.setMethod(feedback); // set the arguments to be sent to the callback method // (an array of elements which will be passed as arguments 5, 6 and so on to the callback method) // the first 5 arguments are fixed: // [0] item index // [1] parent item index // [2] isSelected boolean // [3] parent menu text // [4] menu text entry.methodArguments = [17, "data"];
Get/set the text of the menu item/checkbox/radiobutton.; This can be also html if enclosed between html tags
Since
Replace with version info
Parameters
Also see
External links
Sample
// add a new menu to the menubar var menubar = plugins.window.getMenuBar(); var menu = menubar.addMenu(); menu.text = "New Menu"; // alternatively create a popup menu //var menu = plugins.window.createPopupMenu(); // add a menu item at the first position in the menu var entry = menu.addMenuItem(0); // alternatively add a checkbox at the first position //var entry = menu.addCheckBox(0); // or alternatively add a radiobutton at the first position //var entry = menu.addRadioButton(0); // disable the newly added entry entry.enabled = false; // give a name to the entry (the name is not visible anywhere) entry.name = "my_name"; // make the entry selected (affects checkboxes and radiobuttons) entry.selected = true; // set the text of the entry entry.text = "menu entry"; // set the callback method entry.setMethod(feedback); // set the arguments to be sent to the callback method // (an array of elements which will be passed as arguments 5, 6 and so on to the callback method) // the first 5 arguments are fixed: // [0] item index // [1] parent item index // [2] isSelected boolean // [3] parent menu text // [4] menu text entry.methodArguments = [17, "data"];
{column:width=100%|padding=0px}{column}
Method Details
void
doClick
()
Script the selection (emulate a mouse click) of the item.
Since
Replace with version info
Parameters
Returns
void
Also see
External links
Sample
// add a new menu to the menubar var menubar = plugins.window.getMenuBar(); var menu = menubar.addMenu(); menu.text = "New Menu"; // alternatively create a popup menu //var menu = plugins.window.createPopupMenu(); // add a menu item var entry = menu.addMenuItem("menu entry", feedback); // alternatively add a checkbox //var entry = menu.addCheckBox("menu entry", feedback); // or alternatively add a radiobutton //var entry = menu.addRadioButton("menu entry", feedback); // simulate a click on the entry entry.doClick();
getClientProperty
(key)
Gets the specified client property for the menu item/checkbox/radiobutton based on a key.
Since
Replace with version info
Parameters
{Object} key
Also see
External links
Sample
// add a new menu to the menubar var menubar = plugins.window.getMenuBar(); var menu = menubar.addMenu(); menu.text = "New Menu"; // alternatively create a popup menu //var menu = plugins.window.createPopupMenu(); // add a menu item var entry = menu.addMenuItem("menu entry", feedback); // alternatively add a checkbox //var entry = menu.addCheckBox("menu entry", feedback); // or alternatively add a radiobutton //var entry = menu.addRadioButton("menu entry", feedback); // NOTE: Depending on the operating system, a user interface property name may be available. // set the tooltip of the menu item/checkbox/radiobutton via client properties // keep the original tooltip in a form or global variable originalTooltip = entry.getClientProperty("ToolTipText"); entry.putClientProperty("ToolTipText", "changed tooltip"); // later restore the original tooltip from the variable //var menubar = plugins.window.getMenuBar(); //var menuIndex = menubar.getMenuIndexByText("New Menu"); //var menu = menubar.getMenu(menuIndex); //var entry = menu.getItem(0); //entry.putClientProperty("ToolTipText", originalTooltip);
void
putClientProperty
(key, value)
Sets the value for the specified client property key of the menu item/checkbox/radiobutton.
Since
Replace with version info
Returns
void
Also see
External links
Sample
// add a new menu to the menubar var menubar = plugins.window.getMenuBar(); var menu = menubar.addMenu(); menu.text = "New Menu"; // alternatively create a popup menu //var menu = plugins.window.createPopupMenu(); // add a menu item var entry = menu.addMenuItem("menu entry", feedback); // alternatively add a checkbox //var entry = menu.addCheckBox("menu entry", feedback); // or alternatively add a radiobutton //var entry = menu.addRadioButton("menu entry", feedback); // NOTE: Depending on the operating system, a user interface property name may be available. // set the tooltip of the menu item/checkbox/radiobutton via client properties // keep the original tooltip in a form or global variable originalTooltip = entry.getClientProperty("ToolTipText"); entry.putClientProperty("ToolTipText", "changed tooltip"); // later restore the original tooltip from the variable //var menubar = plugins.window.getMenuBar(); //var menuIndex = menubar.getMenuIndexByText("New Menu"); //var menu = menubar.getMenu(menuIndex); //var entry = menu.getItem(0); //entry.putClientProperty("ToolTipText", originalTooltip);
setAccelerator
()
Set the accelerator key of the menu item/checkbox/radiobutton.
Since
Replace with version info
Parameters
Also see
External links
Sample
// add a new menu to the menubar var menubar = plugins.window.getMenuBar(); var menu = menubar.addMenu(); menu.text = "New Menu"; // alternatively create a popup menu //var menu = plugins.window.createPopupMenu(); // add a menu item var entry = menu.addMenuItem("menu entry", feedback); // alternatively add a checkbox //var entry = menu.addCheckBox("menu entry", feedback); // or alternatively add a radiobutton //var entry = menu.addRadioButton("menu entry", feedback); // define an accelerator for the menu entry entry.setAccelerator("ctrl alt Y"); // also define a mnemonic entry.setMnemonic("y"); // set a custom background color entry.setBackgroundColor("#111111"); // set a custom foreground color entry.setForegroundColor("#EE5555"); // set an icon entry.setIcon("media:///yourimage.gif");
void
setAlign
(align)
Sets the alignment of the radiobutton.
Since
Replace with version info
Parameters
{Boolean} align
Returns
void
Also see
External links
Sample
// add a new menu to the menubar var menubar = plugins.window.getMenuBar(); var menu = menubar.addMenu(); menu.text = "New Menu"; // alternatively create a popup menu //var menu = plugins.window.createPopupMenu(); // add a checkbox var entry = menu.addCheckBox("menu entry", feedback); // alternatively add a radiobutton //var entry = menu.addRadioButton("menu entry", feedback); // enable alignment of the new entry entry.setAlign(true);
void
setBackgroundColor
()
Set the background color of the menu item/checkbox/radiobutton.
Since
Replace with version info
Parameters
Returns
void
Also see
External links
Sample
// add a new menu to the menubar var menubar = plugins.window.getMenuBar(); var menu = menubar.addMenu(); menu.text = "New Menu"; // alternatively create a popup menu //var menu = plugins.window.createPopupMenu(); // add a menu item var entry = menu.addMenuItem("menu entry", feedback); // alternatively add a checkbox //var entry = menu.addCheckBox("menu entry", feedback); // or alternatively add a radiobutton //var entry = menu.addRadioButton("menu entry", feedback); // define an accelerator for the menu entry entry.setAccelerator("ctrl alt Y"); // also define a mnemonic entry.setMnemonic("y"); // set a custom background color entry.setBackgroundColor("#111111"); // set a custom foreground color entry.setForegroundColor("#EE5555"); // set an icon entry.setIcon("media:///yourimage.gif");
void
setForegroundColor
()
Set the foreground color of the menu item/checkbox/radiobutton.
Since
Replace with version info
Parameters
Returns
void
Also see
External links
Sample
// add a new menu to the menubar var menubar = plugins.window.getMenuBar(); var menu = menubar.addMenu(); menu.text = "New Menu"; // alternatively create a popup menu //var menu = plugins.window.createPopupMenu(); // add a menu item var entry = menu.addMenuItem("menu entry", feedback); // alternatively add a checkbox //var entry = menu.addCheckBox("menu entry", feedback); // or alternatively add a radiobutton //var entry = menu.addRadioButton("menu entry", feedback); // define an accelerator for the menu entry entry.setAccelerator("ctrl alt Y"); // also define a mnemonic entry.setMnemonic("y"); // set a custom background color entry.setBackgroundColor("#111111"); // set a custom foreground color entry.setForegroundColor("#EE5555"); // set an icon entry.setIcon("media:///yourimage.gif");
setIcon
()
Set the icon of the menu item/checkbox/radiobutton.
Since
Replace with version info
Parameters
Also see
External links
Sample
// add a new menu to the menubar var menubar = plugins.window.getMenuBar(); var menu = menubar.addMenu(); menu.text = "New Menu"; // alternatively create a popup menu //var menu = plugins.window.createPopupMenu(); // add a menu item var entry = menu.addMenuItem("menu entry", feedback); // alternatively add a checkbox //var entry = menu.addCheckBox("menu entry", feedback); // or alternatively add a radiobutton //var entry = menu.addRadioButton("menu entry", feedback); // define an accelerator for the menu entry entry.setAccelerator("ctrl alt Y"); // also define a mnemonic entry.setMnemonic("y"); // set a custom background color entry.setBackgroundColor("#111111"); // set a custom foreground color entry.setForegroundColor("#EE5555"); // set an icon entry.setIcon("media:///yourimage.gif");
setMethod
(method)
Set the method for the menu item/checkbox/radiobutton.
Since
Replace with version info
Parameters
{Function} method
Also see
External links
Sample
// add a new menu to the menubar var menubar = plugins.window.getMenuBar(); var menu = menubar.addMenu(); menu.text = "New Menu"; // alternatively create a popup menu //var menu = plugins.window.createPopupMenu(); // add a menu item at the first position in the menu var entry = menu.addMenuItem(0); // alternatively add a checkbox at the first position //var entry = menu.addCheckBox(0); // or alternatively add a radiobutton at the first position //var entry = menu.addRadioButton(0); // disable the newly added entry entry.enabled = false; // give a name to the entry (the name is not visible anywhere) entry.name = "my_name"; // make the entry selected (affects checkboxes and radiobuttons) entry.selected = true; // set the text of the entry entry.text = "menu entry"; // set the callback method entry.setMethod(feedback); // set the arguments to be sent to the callback method // (an array of elements which will be passed as arguments 5, 6 and so on to the callback method) // the first 5 arguments are fixed: // [0] item index // [1] parent item index // [2] isSelected boolean // [3] parent menu text // [4] menu text entry.methodArguments = [17, "data"];
setMethod
(method, arguments)
Set the method for the menu item/checkbox/radiobutton.
Since
Replace with version info
Also see
External links
Sample
// add a new menu to the menubar var menubar = plugins.window.getMenuBar(); var menu = menubar.addMenu(); menu.text = "New Menu"; // alternatively create a popup menu //var menu = plugins.window.createPopupMenu(); // add a menu item at the first position in the menu var entry = menu.addMenuItem(0); // alternatively add a checkbox at the first position //var entry = menu.addCheckBox(0); // or alternatively add a radiobutton at the first position //var entry = menu.addRadioButton(0); // disable the newly added entry entry.enabled = false; // give a name to the entry (the name is not visible anywhere) entry.name = "my_name"; // make the entry selected (affects checkboxes and radiobuttons) entry.selected = true; // set the text of the entry entry.text = "menu entry"; // set the callback method entry.setMethod(feedback); // set the arguments to be sent to the callback method // (an array of elements which will be passed as arguments 5, 6 and so on to the callback method) // the first 5 arguments are fixed: // [0] item index // [1] parent item index // [2] isSelected boolean // [3] parent menu text // [4] menu text entry.methodArguments = [17, "data"];
setMnemonic
()
Set the mnemonic key of the menu item/checkbox/radiobutton.
Since
Replace with version info
Parameters
Also see
External links
Sample
// add a new menu to the menubar var menubar = plugins.window.getMenuBar(); var menu = menubar.addMenu(); menu.text = "New Menu"; // alternatively create a popup menu //var menu = plugins.window.createPopupMenu(); // add a menu item var entry = menu.addMenuItem("menu entry", feedback); // alternatively add a checkbox //var entry = menu.addCheckBox("menu entry", feedback); // or alternatively add a radiobutton //var entry = menu.addRadioButton("menu entry", feedback); // define an accelerator for the menu entry entry.setAccelerator("ctrl alt Y"); // also define a mnemonic entry.setMnemonic("y"); // set a custom background color entry.setBackgroundColor("#111111"); // set a custom foreground color entry.setForegroundColor("#EE5555"); // set an icon entry.setIcon("media:///yourimage.gif");
setVisible
(visible)
Set the item visible.
Since
Replace with version info
Parameters
{Boolean} visible
Also see
External links
Sample
// add a new menu to the menubar var menubar = plugins.window.getMenuBar(); var menu = menubar.addMenu(); menu.text = "New Menu"; // alternatively create a popup menu //var menu = plugins.window.createPopupMenu(); // add a menu item var entry_one = menu.addMenuItem("an entry", feedback); // add a checkbox var entry_two = menu.addCheckBox("another entry", feedback); // add a radiobutton var entry_three = menu.addRadioButton("yet another entry", feedback); // hide the menu item entry_one.setVisible(false); // make sure the checkbox is visible entry_two.setVisible(true); // hide the radiobutton entry_three.setVisible(false);