Child pages
  • MenuItem

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

styledisplay:none

...

iddescription

...

padding0px
width80px

...

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Constants Summary

...

Table Cell (td)
Number

...

Cache
indextrue
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Constants SummaryConstant for centering menu items/checkbox/radiobuttons at creation.

...

Table Cell (td)
Number

...

Table Cell (td)
Number

...

Constant for left aligning menu items/checkbox/radiobuttons at creation.

...

...

Constant for right aligning menu items/checkbox/radiobuttons at creation.

...

...

padding0px
width80px

...

servoy sSummary12%30%58%height: 30px;

...

Table Head (th)
colspan2
Property Summary

...

Table Cell (td)
Boolean

...

Table Cell (td)
Object[]

...

3Property SummaryEnable/disable the menu item/checkbox/radiobutton.

...

Set arguments that are sent to the callback method.

...

Table Cell (td)
String

...

Table Cell (td)
Boolean

...

The name of the menu item/checkbox/radiobutton.

...

Select/unselect the checkbox/radiobutton.

...

Table Cell (td)
String

...

padding0px
width80px

...

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary

...

Table Cell (td)
void

...

Get/set the text of the menu item/checkbox/radiobutton.

...

servoy sSummary12%30%58%height: 30px;3Methods SummaryvoidScript the selection (emulate a mouse click) of the item.

...

Table Cell (td)
Object

...

Gets the specified client property for the menu item/checkbox/radiobutton based on a key.

...

void

...

Sets the value for the specified client property key of the menu item/checkbox/radiobutton.

...

Table Cell (td)
MenuItem

...

Set the accelerator key of the menu item/checkbox/radiobutton.

...

void

...

Set the background color of the menu item/checkbox/radiobutton.

...

void

...

Set the foreground color

...

Table Cell (td)
MenuItem

...

of the menu item

...

Table Row (tr)
Table Cell (td)
MenuItem
Table Cell (td)
setMethod(method)
Set the method for the menu item/checkbox/radiobutton.
Table Row (tr)
Table Cell (td)
MenuItem
Table Cell (td)
setMethod(method, arguments)
Set the method for the menu item/checkbox/radiobutton.
Table Row (tr)
Table Cell (td)
MenuItem
Table Cell (td)
setMnemonic()
Set the mnemonic key of the menu item/checkbox/radiobutton.
Table Row (tr)
Table Cell (td)
MenuItem
Table Cell (td)
setVisible(visible)
Set the item visible.

...

idconstant
classservoy sDetail

...

padding0px
width100%
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Constants Details

...

idALIGN_CENTER
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant for centering menu items/checkbox/radiobuttons at creation.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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 left aligned menu item
menu.addMenuItem("significantly long text", feedback, null, null, true, MenuItem.ALIGN_LEFT);
// add a centered checkbox
menu.addCheckBox("a bit shorter", feedback, null, null, true, MenuItem.ALIGN_CENTER);
// add a right aligned radiobutton
menu.addRadioButton("short", feedback, null, null, true, MenuItem.ALIGN_RIGHT);

...

classlastDetailRow

...

idALIGN_LEFT
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant for left aligning menu items/checkbox/radiobuttons at creation.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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 left aligned menu item
menu.addMenuItem("significantly long text", feedback, null, null, true, MenuItem.ALIGN_LEFT);
// add a centered checkbox
menu.addCheckBox("a bit shorter", feedback, null, null, true, MenuItem.ALIGN_CENTER);
// add a right aligned radiobutton
menu.addRadioButton("short", feedback, null, null, true, MenuItem.ALIGN_RIGHT);

...

classlastDetailRow

...

idALIGN_RIGHT
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant for right aligning menu items/checkbox/radiobuttons at creation.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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 left aligned menu item
menu.addMenuItem("significantly long text", feedback, null, null, true, MenuItem.ALIGN_LEFT);
// add a centered checkbox
menu.addCheckBox("a bit shorter", feedback, null, null, true, MenuItem.ALIGN_CENTER);
// add a right aligned radiobutton
menu.addRadioButton("short", feedback, null, null, true, MenuItem.ALIGN_RIGHT);

...

classlastDetailRow

...

idproperty
classservoy sDetail

...

padding0px
width100%
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Property Details

...

idenabled
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Enable/disable the menu item/checkbox/radiobutton.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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"];

...

classlastDetailRow

...

idmethodArguments
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set arguments that are sent to the callback method.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Object[]
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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"];

...

classlastDetailRow

...

idname
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
The name of the menu item/checkbox/radiobutton. The name is used only internally, it is not
visible in the user interface.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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"];

...

classlastDetailRow

...

idselected
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Select/unselect the checkbox/radiobutton.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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"];

...

classlastDetailRow

...

idtext
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get/set the text of the menu item/checkbox/radiobutton.; This can be also html if enclosed between html tags
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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"];

...

classlastDetailRow

...

idfunction
classservoy sDetail

...

padding0px
width100%
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details

...

iddoClick
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
doClick
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Script the selection (emulate a mouse click) of the item.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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();

...

classlastDetailRow

...

idgetClientProperty-Object
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Object
Span
stylefont-weight: bold;
getClientProperty
Span
(key)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Gets the specified client property for the menu item/checkbox/radiobutton based on a key.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object} key
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Object
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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);

...

classlastDetailRow

...

idputClientProperty-Object_Object
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
putClientProperty
Span
(key, value)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Sets the value for the specified client property key of the menu item/checkbox/radiobutton.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object} key
{Object} value
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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);

...

classlastDetailRow

...

idsetAccelerator
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
MenuItem
Span
stylefont-weight: bold;
setAccelerator
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the accelerator key of the menu item/checkbox/radiobutton.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
MenuItem
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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");

...

classlastDetailRow

...

idsetBackgroundColor
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
setBackgroundColor
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the background color of the menu item/checkbox/radiobutton.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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");

...

classlastDetailRow

...

idsetForegroundColor
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
setForegroundColor
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the foreground color of the menu item/checkbox/radiobutton.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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");

...

classlastDetailRow

...

idsetIcon
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
MenuItem
Span
stylefont-weight: bold;
setIcon
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the icon of the menu item/checkbox/radiobutton.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
MenuItem
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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");

...

classlastDetailRow

...

idsetMethod-Function
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
MenuItem
Span
stylefont-weight: bold;
setMethod
Span
(method)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the method for the menu item/checkbox/radiobutton.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Function} method
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
MenuItem
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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"];

...

classlastDetailRow

...

idsetMethod-Function_ObjectArray
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
MenuItem
Span
stylefont-weight: bold;
setMethod
Span
(method, arguments)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the method for the menu item/checkbox/radiobutton.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Function} method
{Object[]} arguments
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
MenuItem
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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"];

...

classlastDetailRow

...

idsetMnemonic
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
MenuItem
Span
stylefont-weight: bold;
setMnemonic
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the mnemonic key of the menu item/checkbox/radiobutton.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
MenuItem
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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");

...

classlastDetailRow

...

idsetVisible-Boolean
Table Row (tr)
idname
Table Cell (td)
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
MenuItem
Span
stylefont-weight: bold;
setVisible
Span
(visible)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set the item visible.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Boolean} visible
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
MenuItem
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
// 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);

...

classlastDetailRow

...

/checkbox/radiobutton.Set the icon of the menu item/checkbox/radiobutton.Set the method for the menu item/checkbox/radiobutton.Set the method for the menu item/checkbox/radiobutton.Set the mnemonic key of the menu item/checkbox/radiobutton.Set the item visible.

constantservoy sDetail2100%height:30px2Constants DetailsALIGN_CENTERname

ALIGN_CENTER

dessIndent
Constant for centering menu items/checkbox/radiobuttons at creation.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowALIGN_LEFTname

ALIGN_LEFT

dessIndent
Constant for left aligning menu items/checkbox/radiobuttons at creation.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
ALIGN_RIGHTname

ALIGN_RIGHT

dessIndent
Constant for right aligning menu items/checkbox/radiobuttons at creation.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow

propertyservoy sDetail2100%height:30px2Property Detailsenabledname

enabled

dessIndent
Enable/disable the menu item/checkbox/radiobutton.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowmethodArgumentsname

methodArguments

dessIndent
Set arguments that are sent to the callback method.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
namename

name

dessIndent
The name of the menu item/checkbox/radiobutton. The name is used only internally, it is not
visible in the user interface.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
selectedname

selected

dessIndent
Select/unselect the checkbox/radiobutton.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
textname

text

dessIndent
Get/set the text of the menu item/checkbox/radiobutton.; This can be also html if enclosed between html tags
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow

functionservoy sDetail2100%height:30px2Methods DetailsdoClickname

doClick()

dessIndent
Script the selection (emulate a mouse click) of the item.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowgetClientPropertyname

getClientProperty(key)

dessIndent
Gets the specified client property for the menu item/checkbox/radiobutton based on a key.
prs

Parameters

sIndentkey ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
putClientPropertyname

putClientProperty(key, value)

dessIndent
Sets the value for the specified client property key of the menu item/checkbox/radiobutton.
prs

Parameters

sIndentkey ;value ;
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setAcceleratorname

setAccelerator(String)

dessIndent
Set the accelerator key of the menu item/checkbox/radiobutton.
prs

Parameters

sIndent
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setBackgroundColorname

setBackgroundColor(String)

dessIndent
Set the background color of the menu item/checkbox/radiobutton.
prs

Parameters

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setForegroundColorname

setForegroundColor(String)

dessIndent
Set the foreground color of the menu item/checkbox/radiobutton.
prs

Parameters

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setIconname

setIcon(Object)

dessIndent
Set the icon of the menu item/checkbox/radiobutton.
prs

Parameters

sIndent
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setMethodname

setMethod(method)

dessIndent
Set the method for the menu item/checkbox/radiobutton.
prs

Parameters

sIndentmethod ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setMethodname

setMethod(method, arguments)

dessIndent
Set the method for the menu item/checkbox/radiobutton.
prs

Parameters

sIndentmethod ;arguments ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setMnemonicname

setMnemonic(String)

dessIndent
Set the mnemonic key of the menu item/checkbox/radiobutton.
prs

Parameters

sIndent
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setVisiblename

setVisible(visible)

dessIndent
Set the item visible.
prs

Parameters

sIndentvisible ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow