NGDesktop UI (ref)
Last updated
Last updated
(part of package '')
You can access it in code via: plugins.ngdesktopui
Add a checkbox to the specified menu. NOTE: when adding the checkbox to an existing menuitem, that menuitem will turn from type "normal" to type "submenu". If a callback has been set previously, that callback will no longer be called.
Parameters:
{} index - menu index
{} text Text - checkbox label
{} callback - callback function to call. The callback function will receive:- text of the clicked item- type of the clicked item ("normal", "radio", "checkbox")- checked value for checkboxes and radio buttons, otherwise undefined
{} [checked] - checkbox initial status (unchecked by default)
{} [position] - insert position
{} [itemIndex] - submenu index; when specified the position is relative to this submenu
Returns: - the index of the added checkbox
Add Developer Tools menu to the menu bar
Use it just for debugging. Remove any call to this function once you're done.
Add new menu to the menu bar
Parameters:
Add menu items to existing menu. NOTE: when adding an item to an existing menuitem, that menuitem will turn from type "normal" to type "submenu". If a callback has been set previously, that callback will no longer be called.
Parameters:
Add a radio button to the specified menu.
NOTE: when adding the checkbox to an existing menuitem, that menuitem will turn from type "normal" to type "submenu". If a callback has been set previously, that callback will no longer be called. NOTE: For the first added radio button in a group, the radio button will be selected ignoring the 'selected' param.
Parameters:
Add a menuitem with standard native system behavior. For a complete list of allowed values see: https://github.com/Servoy/ngdesktopui
Parameters:
Add separator line to the specified menu
Parameters:
Closes a and destroys a previously created BrowserView by the given id.
Parameters:
Creates a BrowserView (looks like an iframe) and adds this to the current window at the given coordinates with the given width and height. It returns and id that can be used to close/clean up this view later on, or to target that view to inject some javascript.
Parameters:
@return {trayMenu}
Count menus from the menu bar.
Return the menu text at the specified position.
Parameters:
Get menuitem index from the specified menu
Parameters:
Get menuitem text from the specified menu
Parameters:
Count menu items for the specified menu
Parameters:
Return the menu text from the specified menu position.
Parameters:
Get window size
Get the zoom factor of the current window
Hide the window
Injects the given javascript into the content of the BrowserView of the given id. The javascript can be a function declaration that is then called later on. The last statement return value is given back to the callback as a first argument. If something goes wrong then the callback is called where the first argument is null and a second argument has the message of the exception.
Example:
Parameters:
Return true if window is in full screen state
Return true if window is in maximized state
Return true if window is in minimized state
Return true whether the window is in normal state (not maximized, not minimized, not in fullscreen mode)
Return true if window is in visible to the user
Maximize the window
Minimize the window
Register callback to be executed before closing ngdesktop
Parameters:
Cleanup the specified menu
Parameters:
Cleanup the menubar. For MacOS that means to display a minimal menu
Delete menu from the specified position from the menu bar
Parameters:
Removes a menu item from an existing menu. NOTE: when the last item from a submenu is removed, that submenu will turn from type "submenu" to type "normal". If a callback has been set previously for the item, that callback will be called from then on.
Parameters:
Reset ngdesktop menu to default
Restore the window
Set window to full screen mode
Parameters:
Show/hide menubar visibility. This function is working only on Windows/Linux
Parameters:
Set window size to the specified dimensions
Parameters:
Set the zoom factor of the current window 1 == 100%. 0.5 == 50%.
Parameters:
Show and gives focus to the window
Unmaximize the window
Unregister the callback to be executed before closing ngdesktop.
Set the way external links will be handled from ngdesktop. When the flag parameter is set to: - true: open external links using OS default browser - false: open external links using a new ngdesktop window
Parameters:
scripting type: CustomType<ngdesktopui.trayMenu>
icon
pressedIcon
title
tooltip
scripting type: CustomType<ngdesktopui.trayMenuItem>
checked
click
label
role
type
{} text - menu text
{} [index] - menu insert position (zero based)
Returns: - the index of the added menu
{} index - menu index
{} text - menuitem text
{} callback - callback function to call. The callback function will receive:- text of the clicked item- type of the clicked item ("normal", "radio", "checkbox")- checked value for checkboxes and radio buttons, otherwise undefined
{} [position] - insert position
{} [itemIndex] - submenu index; when specified the position is relative to this submenu
Returns: - the index of the added menu item
{} index - menu index
{} text Text - checkbox label
{} callback - callback function to call. The callback function will receive:- text of the clicked item- type of the clicked item ("normal", "radio", "checkbox")- checked value for checkboxes and radio buttons, otherwise undefined
{} [selected] - initial selected status
{} [position] - insert position
{} [itemIndex] - submenu index; when specified the position is relative to this submenu
Returns: - the index of the added radio button
{} index - menu index
{} role - item role.
{} [text] - menuitem text; when not specified the System will provide a standard (localized) one
{} [position] - insert position; when role is a predefined menu, this parameter is ignored;
{} [itemIndex] - submenu index; when specified the position is relative to this submenu; when role is a predefined menu this parameter is ignored
Returns: - the index of the added role item
{} index - menu index
{} [position] - insert position
{} [itemIndex] - submenu index; when specified the position is relative to this submenu
Returns: - the index of the added separator
{} id - the id of the view to close.
{} x - the X coordinate to position this view
{} y - the Y coordinate to position this view
{} width - the width of this view
{} height - the height of this view
{} url - the url to load into this view
Returns: The id to target this view later on.
Returns:
Returns:
{} text ** (string) text - the text to query for
Returns: Menu index containing the specified text; if not found return -1
{} index - menu index
{} text - menuitem text to query for index
Returns:
{} index - menu index
{} itemIndex ItemIndex - menuitem index to query for text
Returns:
{} index - menu index
{} [itemIndex] ** (int) [itemIndex] - submenu index; when specified the submenu items will be count
Returns:
{} index Position to query for
Returns: Menu's text; if index is out of range - null is returned
Returns: - an array containing window's width and height
Returns: Zoom factor of the current window
{} id - the id of the view to execute javascript in.
{} js Js - the piece of javascript that is injected into this view.
{} callback - the callback function that is used to get the results or exception if the call fails.
Returns:
Returns:
Returns:
Returns:
Returns:
{} callback Callback - function to be executed before closing ngdesktop. Must return a boolean value: true if ngdesktop will close; false if ngdesktop will not close
Returns: - whether function executed succesfully or not
{} index Index - menu position
{} [itemIndex] - submenu index
{} index Index - menu position to be deleted
{} index - menu index
{} position - menuitem position to be removed
{} [itemIndex] - submenu index; when specified the position is relative to this submenu
{} flag - whether the window should be in fullscreen mode
{} visible
{} width - width (integer value greater than zero)
{} height - height (integer value greater than zero)
{} factor Factor (values greater than 0.0 and smaller or equal to 5.0)
Returns:
{} flag
Type:
Type:
Type:
Type:
Type:
Type:
Type:
Type:
Type: