Window Plugin

(part of package 'Servoy Default Services')

You can access it in code via: plugins.window

Properties

API

cancelFormPopup()

Close/cancels the current form popup panel without assigning a value to the configured data provider.

@example

// Show a form as popup panel, where the closeFormPopup can pass return a value to a dataprovider in the specified scope.
plugins.window.showFormPopup(null,forms.orderPicker,foundset.getSelectedRecord(),"order_id");
// plugins.window.showFormPopup(null,forms.orderPicker,foundset.getSelectedRecord(),"order_id",-1,-1,100,100,true, false, onClose);
//
// function onClose(event) {application.output("Popup closed");}

closeFormPopup(retval)

Close the current form popup panel and assign the value to the configured data provider.

@example

// Show a form as popup panel, where the closeFormPopup can pass return a value to a dataprovider in the specified scope.
plugins.window.showFormPopup(null,forms.orderPicker,foundset.getSelectedRecord(),"order_id");
// plugins.window.showFormPopup(null,forms.orderPicker,foundset.getSelectedRecord(),"order_id",-1,-1,100,100,true, false, onClose);
//
// function onClose(event) {application.output("Popup closed");}

@param {Object} retval return value for data provider

Parameters:

retval object


createFormPopup(form)

Create a form popup that can be filled with data and shown.

@example

plugins.window.createFormPopup(forms.orderPicker).show();

@param form the form to show @return FormPopup

Parameters:

form form

Returns: FormPopup


createPopupMenu(menu,callback)

Creates a new popup menu, either empty, or initialized from an existing JSMenu.

@example

// create a popup menu
var menu = plugins.window.createPopupMenu();
// add a menu item
menu.addMenuItem("an entry", feedback);
  
if (event.getSource()) {
 // display the popup over the component which is the source of the event
 menu.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);
}

@param {JSMenu} [jsmenu] The JSMenu whose structure will be used to initialize the popup menu. @param {Function} [callback] The menu item click handler that will be set on all popup menu items @return {Popup}

Parameters:

menu JSMenu (optional) callback function (optional)

Returns: Popup


createShortcut(shortcut,callback,contextFilter,arguments,consumeEvent)

Create a shortcut.

@example

// this plugin uses the java keystroke parser
// see http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/KeyStroke.html#getKeyStroke(java.lang.String)
// global handler
plugins.window.createShortcut('control shift I', scopes.globals.handleOrdersShortcut);
// global handler with a form context filter
plugins.window.createShortcut('control shift I', scopes.globals.handleOrdersShortcut, 'frm_contacts');
// form method called when shortcut is used
plugins.window.createShortcut('control RIGHT', forms.frm_contacts.handleMyShortcut);
// form method called when shortcut is used and arguments are passed to the method
plugins.window.createShortcut('control RIGHT', forms.frm_contacts.handleMyShortcut, new Array(argument1, argument2));
// Passing the method argument as a string prevents unnecessary form loading
//plugins.window.createShortcut('control RIGHT', 'frm_contacts.handleMyShortcut', new Array(argument1, argument2));
// Passing the method as a name and the contextFilter set so that this shortcut only trigger on the form 'frm_contacts'.
plugins.window.createShortcut('control RIGHT', 'frm_contacts.handleMyShortcut', 'frm_contacts', new Array(argument1, argument2));
// Num Lock and Substract shortcuts
plugins.window.createShortcut("NUMPAD8", handleMyShortcut);
plugins.window.createShortcut("SUBTRACT", handleMyShortcut);
// remove global shortcut and form-level shortcut
plugins.window.removeShortcut('menu 1');
plugins.window.removeShortcut('control RIGHT', 'frm_contacts');
// consuming they keystroke so that a default browser event will not happen
plugins.window.createShortcut('F4', scopes.globals.handleOrdersShortcut, 'frm_contacts', null, true);
// shortcut handlers are called with an JSEvent argument
///*
// * Handle keyboard shortcut.
// *
// * @param {JSEvent} event the event that triggered the action
// */
//function handleShortcut(event)
//{
//  application.output(event.getType()) // returns 'menu 1'
//  application.output(event.getFormName()) // returns 'frm_contacts'
//  application.output(event.getElementName()) // returns 'contact_name_field' or null when no element is selected
//}
// NOTES:
// 1) shortcuts will not override existing operating system or browser shortcuts,
// choose your shortcuts carefully to make sure they work in all clients.
// 2) always use lower-case letters for modifiers (shift, control, etc.), otherwise createShortcut will fail.

@param {String} shortcut @param {String} methodName scopes.scopename.methodname or formname.methodname String to target the method to execute @param {String} contextFilter form or element name ( ng only - specified by formName.elementName); only triggers the shortcut when on this form/element @param arguments @param {Boolean} consumeEvent if true then the shotcut will consume the event and the default browser behavior will not be executed (default false)

Parameters:

shortcut string callback function contextFilter string (optional) arguments object [] (optional) consumeEvent boolean (optional)

Returns: boolean


getFormPopup(form)

It will return a FormPopup with the form passed as an argument or null.

@example

plugins.window.getFormPopup(forms.orderPicker)

@param {RuntimeForm} form @return {FormPopup}

Parameters:

form form

Returns: FormPopup


removeShortcut(shortcut,contextFilter)

@clonedesc js_removeShortcut(String) @example

as js_removeShortcut(String)

@param {String} shortcut @param {String} contextFilter form or element name ( ng only - specified by formName.elementName); only triggers the shortcut when on this form/element

Parameters:

shortcut string contextFilter string (optional)

Returns: boolean


showFormPopup(component,form,scope,dataProviderID,width,height,x,y,showBackdrop,doNotCloseOnClickOutside,onClose)

Show a form as popup panel, where the closeFormPopup can pass return a value to a dataprovider in the specified scope. Can show relative to a component or at specified coordinates. Show on specified location and backdrop is only supported in NGClient.

@example

// Show a form as popup panel, where the closeFormPopup can pass return a value to a dataprovider in the specified scope.
plugins.window.showFormPopup(null,forms.orderPicker,foundset.getSelectedRecord(),"order_id");
// plugins.window.showFormPopup(null,forms.orderPicker,foundset.getSelectedRecord(),"order_id",-1,-1,100,100,true, false, onClose);
//
// function onClose(event) {application.output("Popup closed");}

@param {RuntimeComponent} elementToShowRelatedTo element to show related to or null to center in screen @param {RuntimeForm} form the form to show @param {Object} scope the scope to put retval into @param {String} dataproviderID the dataprovider of scope to fill @param {Number} width popup width @param {Number} height popup height @param {Number} x popup x location @param {Number} y popup y location @param {Boolean} showBackdrop whatever to show a dimmed backdrop under the popup @param {Boolean} doNotCloseOnClickOutside whether to close on not close the popup on clicking outside @param {Function} onClose a callback function that is being triggered once the formpopup window is being closed

Parameters:

component runtimecomponent form form scope object dataProviderID string width int (optional) height int (optional) x int (optional) y int (optional) showBackdrop boolean (optional) doNotCloseOnClickOutside boolean (optional) onClose function (optional)


Types

CheckBox

scripting type: CustomType<window.CheckBox> extends: MenuItem

FormPopup

scripting type: CustomType<window.FormPopup>

cancel()

Close/Cancel the current form and his children if applicable.

@example

plugins.window.getFormPopup(forms.orderPicker).cancel();

component()

Set component form popup will be shown relative to. If null, will use coordinates or show at screen center.

Without an argument it is a getter, it returns the component.

@example

plugins.window.createFormPopup(forms.orderPicker).component(elements.myelement).show();

@param {RuntimeComponent} [component] the form to show @return The FormPopup itself if it's used as a setter or the component if no argument is given

Returns: runtimecomponent


component(component)

Set component form popup will be shown relative to. If null, will use coordinates or show at screen center.

Without an argument it is a getter, it returns the component.

@example

plugins.window.createFormPopup(forms.orderPicker).component(elements.myelement).show();

@param {RuntimeComponent} [component] the form to show @return The FormPopup itself if it's used as a setter or the component if no argument is given

Parameters:

component runtimecomponent

Returns: FormPopup


createFormPopup(form)

Create a form popup that can be filled with data and shown.

@example

plugins.window.createFormPopup(forms.orderPicker).show();

@param form the form to show @return FormPopup

Parameters:

form form

Returns: FormPopup


dataprovider()

Set form popup dataprovider that will be set. If this is set, also scope needs to be specified.

Without an argument it is a getter, it returns the datprovider value

@example

plugins.window.createFormPopup(forms.orderPicker).dataprovider('myid').scope(foundset.getSelectedRecord()).show();

@param {string} [dataprovider] form popup dataprovider @return The FormPopup itself if it's used as a setter or the dataprovider value if no argument is given

Returns: string


dataprovider(dataprovider)

Set form popup dataprovider that will be set. If this is set, also scope needs to be specified.

Without an argument it is a getter, it returns the datprovider value

@example

plugins.window.createFormPopup(forms.orderPicker).dataprovider('myid').scope(foundset.getSelectedRecord()).show();

@param {string} [dataprovider] form popup dataprovider @return The FormPopup itself if it's used as a setter or the dataprovider value if no argument is given

Parameters:

dataprovider string

Returns: FormPopup


height()

Set form popup height. If not set, form design height will be used.

Without an argument it is a getter, it returns the height.

@example

plugins.window.createFormPopup(forms.orderPicker).height(100).show();

@param {number} [height] form popup height @return The FormPopup itself if it's used as a setter or the height if no argument is given

Returns: int


height(height)

Set form popup height. If not set, form design height will be used.

Without an argument it is a getter, it returns the height.

@example

plugins.window.createFormPopup(forms.orderPicker).height(100).show();

@param {number} [height] form popup height @return The FormPopup itself if it's used as a setter or the height if no argument is given

Parameters:

height int

Returns: FormPopup


onClose()

Get/Set the onclose function that is called when the closeFormPopup is called. This onClose will get a JSEvent as the first argument, and the return value that is given to the closeFormPopup(retvalue) call.

Without an argument it is a getter, it returns the onclose function value

@example

plugins.window.createFormPopup(forms.orderPicker).dataprovider('myid').onClose(closePopupFunction).show();

@param {function} [func] function that needs to be called when closed @return The FormPopup itself if it's used as a setter or the dataprovider value if no argument is given

Returns: function


onClose(onClose)

Get/Set the onclose function that is called when the closeFormPopup is called. This onClose will get a JSEvent as the first argument, and the return value that is given to the closeFormPopup(retvalue) call.

Without an argument it is a getter, it returns the onclose function value

@example

plugins.window.createFormPopup(forms.orderPicker).dataprovider('myid').onClose(closePopupFunction).show();

@param {function} [func] function that needs to be called when closed @return The FormPopup itself if it's used as a setter or the dataprovider value if no argument is given

Parameters:

onClose function

Returns: FormPopup


scope()

Set form popup scope that will be modified. If this is set, also dataprovider needs to be specified.

Without an argument it is a getter, it returns the scope object

@example

plugins.window.createFormPopup(forms.orderPicker).dataprovider('myid').scope(foundset.getSelectedRecord()).show();

@param {object} scope form popup scope to modify @return The FormPopup itself if it's used as a setter or the dataprovider value if no argument is given

Returns: object


scope(scope)

Set form popup scope that will be modified. If this is set, also dataprovider needs to be specified.

Without an argument it is a getter, it returns the scope object

@example

plugins.window.createFormPopup(forms.orderPicker).dataprovider('myid').scope(foundset.getSelectedRecord()).show();

@param {object} scope form popup scope to modify @return The FormPopup itself if it's used as a setter or the dataprovider value if no argument is given

Parameters:

scope object

Returns: FormPopup


show()

Show form popup using parameters that were set

@example

plugins.window.createFormPopup(forms.orderPicker).x(100).y(100).width(100).height(100).showBackdrop(true).show();

showBackdrop()

Set whether backdrop will be shown. Default value is false.

Without an argument it is a getter, it returns the backdrop value

@example

plugins.window.createFormPopup(forms.orderPicker).showBackdrop(true).show();

@param {boolean} [showBackdrop] form popup showBackdrop @return The FormPopup itself if it's used as a setter or the showBackdrop value if no argument is given

Returns: boolean


showBackdrop(showBackdrop)

Set whether backdrop will be shown. Default value is false.

Without an argument it is a getter, it returns the backdrop value

@example

plugins.window.createFormPopup(forms.orderPicker).showBackdrop(true).show();

@param {boolean} [showBackdrop] form popup showBackdrop @return The FormPopup itself if it's used as a setter or the showBackdrop value if no argument is given

Parameters:

showBackdrop boolean

Returns: FormPopup


width()

Set form popup width. If not set, form design width will be used.

Without an argument it is a getter, it returns the width.

@example

plugins.window.createFormPopup(forms.orderPicker).width(100).show();

@param {number} [width] form popup width @return The FormPopup itself if it's used as a setter or the width if no argument is given

Returns: int


width(width)

Set form popup width. If not set, form design width will be used.

Without an argument it is a getter, it returns the width.

@example

plugins.window.createFormPopup(forms.orderPicker).width(100).show();

@param {number} [width] form popup width @return The FormPopup itself if it's used as a setter or the width if no argument is given

Parameters:

width int

Returns: FormPopup


x()

Set form popup x location. The priority sequence for location is: related element, set location, center of screen.

Without an argument it is a getter, it returns the x.

@example

plugins.window.createFormPopup(forms.orderPicker).x(100).show();

@param {number} [x] form popup x location @return The FormPopup itself if it's used as a setter or the x if no argument is given

Returns: int


x(x)

Set form popup x location. The priority sequence for location is: related element, set location, center of screen.

Without an argument it is a getter, it returns the x.

@example

plugins.window.createFormPopup(forms.orderPicker).x(100).show();

@param {number} [x] form popup x location @return The FormPopup itself if it's used as a setter or the x if no argument is given

Parameters:

x int

Returns: FormPopup


y()

Set form popup y location. The priority sequence for location is: related element, set location, center of screen.

Without an argument it is a getter, it returns the y value

@example

plugins.window.createFormPopup(forms.orderPicker).y(100).show();

@param {number} [y] form popup y location @return The FormPopup itself if it's used as a setter or the y value if no argument is given

Returns: int


y(y)

Set form popup y location. The priority sequence for location is: related element, set location, center of screen.

Without an argument it is a getter, it returns the y value

@example

plugins.window.createFormPopup(forms.orderPicker).y(100).show();

@param {number} [y] form popup y location @return The FormPopup itself if it's used as a setter or the y value if no argument is given

Parameters:

y int

Returns: FormPopup


scripting type: CustomType<window.Menu> extends: BaseMenu

doClick()

Script the selection (emulate a mouse click) of the menu.

@example

// simulate a click on the popup menu
menu.doClick();

setEnabled(enabled)

Set the the selected menu enabled or disabled.

@example

var popup = plugins.window.createPopupMenu();
var menu = popup.addMenu();
// set the menu's text
menu.text = "New Menu";
// disable the menu
menu.setEnabled(false);
// set a mnemonic
menu.setMnemonic("u");
// add an icon to the menu
menu.setIcon("media:///yourimage.gif");

@param {Boolean} enabled

Parameters:

enabled boolean


setIcon(icon)

Set the icon of the menu.

@example

var popup = plugins.window.createPopupMenu();
var menu = popup.addMenu();
// set the menu's text
menu.text = "New Menu";
// disable the menu
menu.setEnabled(false);
// set a mnemonic
menu.setMnemonic("u");
// add an icon to the menu
menu.setIcon("media:///yourimage.gif");

@param {Object} icon

Parameters:

icon object


setMnemonic(mnemonic)

Set the mnemonic of the selected menu.

@example

var popup = plugins.window.createPopupMenu();
var menu = popup.addMenu();
// set the menu's text
menu.text = "New Menu";
// disable the menu
menu.setEnabled(false);
// set a mnemonic
menu.setMnemonic("u");
// add an icon to the menu
menu.setIcon("media:///yourimage.gif");

@param {String} mnemonic

Parameters:

mnemonic string


scripting type: CustomType<window.MenuItem>

doClick()

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

@example

// 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.

@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); @param {Object} key

Parameters:

key object


putClientProperty(key,value)

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

@example

// 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);

@param {Object} key @param {Object} value

Parameters:

key object value object


setAccelerator(accelerator)

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

@example

// 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");

@param {String} accelerator @return s {MenuItem}

Parameters:

accelerator string


setBackgroundColor(bgColor)

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

@param {String} bgColor

Parameters:

bgColor string


setForegroundColor(fgColor)

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

@param {String} fgColor

Parameters:

fgColor string


setIcon(icon)

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

@example

// 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");

@param {Object} icon @return s {MenuItem}

Parameters:

icon object


setMethod(method,arguments)

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

@example

// 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"];

@param {Function} method @param {Array} arguments @return s {MenuItem}

Parameters:

method function arguments object[] (optional)


setMnemonic(mnemonic)

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

@example

// 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");

@param {String} icon @return s {MenuItem}

Parameters:

mnemonic string


setVisible(visible)

Set the item visible.

@example

// 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);

@param {Boolean} visible @return s {MenuItem}

Parameters:

visible boolean


scripting type: CustomType<window.Popup> extends: BaseMenu

show(component,positionTop)

Show the popup menu at the specified location this can have 3 different signatures:</br> 1> component param with optionally x,y and/or positionTop parameters</br> 2> event parameter</br> 3> x and y parameters</br> 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)

@example

// create a popup menu
var menu = plugins.window.createPopupMenu();
// add a menu item
menu.addMenuItem("an entry", feedback);

if (event.getSource()) {
 // display the popup over the component which is the source of the event
 menu.show(event.getSource());
 // or you can just use direct they event:
 //menu.show(event);
 // 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);
}

@param {Object} component_or_event_or_x The component or the event or the x coordinate of the popup @param {Object} [x_or_y_or_positionTop] The x or y coordinate of the popup (depending on the first parameter) or positionTop @param {Number} [y] The y coordinate of the popup @param {Boolean} [positionTop] The positionTop where to show the popup (default false)

Parameters:

component runtimecomponent positionTop boolean (optional)


show(component,x,y,positionTop)

Show the popup menu at the specified location this can have 3 different signatures:</br> 1> component param with optionally x,y and/or positionTop parameters</br> 2> event parameter</br> 3> x and y parameters</br> 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)

@example

// create a popup menu
var menu = plugins.window.createPopupMenu();
// add a menu item
menu.addMenuItem("an entry", feedback);

if (event.getSource()) {
 // display the popup over the component which is the source of the event
 menu.show(event.getSource());
 // or you can just use direct they event:
 //menu.show(event);
 // 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);
}

@param {Object} component_or_event_or_x The component or the event or the x coordinate of the popup @param {Object} [x_or_y_or_positionTop] The x or y coordinate of the popup (depending on the first parameter) or positionTop @param {Number} [y] The y coordinate of the popup @param {Boolean} [positionTop] The positionTop where to show the popup (default false)

Parameters:

component runtimecomponent x int y int positionTop boolean (optional)


show(event)

Show the popup menu at the specified location this can have 3 different signatures:</br> 1> component param with optionally x,y and/or positionTop parameters</br> 2> event parameter</br> 3> x and y parameters</br> 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)

@example

// create a popup menu
var menu = plugins.window.createPopupMenu();
// add a menu item
menu.addMenuItem("an entry", feedback);

if (event.getSource()) {
 // display the popup over the component which is the source of the event
 menu.show(event.getSource());
 // or you can just use direct they event:
 //menu.show(event);
 // 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);
}

@param {Object} component_or_event_or_x The component or the event or the x coordinate of the popup @param {Object} [x_or_y_or_positionTop] The x or y coordinate of the popup (depending on the first parameter) or positionTop @param {Number} [y] The y coordinate of the popup @param {Boolean} [positionTop] The positionTop where to show the popup (default false)

Parameters:

event JSEvent


show(x,y)

Show the popup menu at the specified location this can have 3 different signatures:</br> 1> component param with optionally x,y and/or positionTop parameters</br> 2> event parameter</br> 3> x and y parameters</br> 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)

@example

// create a popup menu
var menu = plugins.window.createPopupMenu();
// add a menu item
menu.addMenuItem("an entry", feedback);

if (event.getSource()) {
 // display the popup over the component which is the source of the event
 menu.show(event.getSource());
 // or you can just use direct they event:
 //menu.show(event);
 // 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);
}

@param {Object} component_or_event_or_x The component or the event or the x coordinate of the popup @param {Object} [x_or_y_or_positionTop] The x or y coordinate of the popup (depending on the first parameter) or positionTop @param {Number} [y] The y coordinate of the popup @param {Boolean} [positionTop] The positionTop where to show the popup (default false)

Parameters:

x int y int


RadioButton

scripting type: CustomType<window.RadioButton> extends: MenuItem


Last updated