NGDesktop UI (ref)
Last updated
Was this helpful?
Last updated
Was this helpful?
(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 - 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:
Creates a system tray menu for the application. The tray menu allows users to interact with the application via a small icon in the system tray.
Example:
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:
Represents a Tray Menu. Contains properties for setting the tray menu's title, tooltip, and icons. scripting type: CustomType<ngdesktopui.trayMenu>
icon
The icon image data for the tray menu.
pressedIcon
The icon image data displayed when the tray menu is pressed.
title
The title displayed on the tray menu.
tooltip
The tooltip text displayed when hovering over the tray menu.
Represents a Tray Menu Item. Defines the properties for an individual item within a tray menu. scripting type: CustomType<ngdesktopui.trayMenuItem>
checked
Indicates whether the tray menu item is checked (for checkbox or radio items).
click
The callback function to be executed when the tray menu item is clicked.
label
The label text for the tray menu item.
role
The role associated with the tray menu item.
type
The type of the tray menu item (e.g., "normal", "separator").
Returns: - the index of the added menu or -1 if nothing has changed
{} 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 - 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: The tray menu object that can be customized with title, tooltip, icon, and menu items.
Returns: The total number of menus currently present in the menu bar.
{} 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: The index of the menu item with the specified text, or -1 if not found.
{} index - menu index
{} itemIndex - menuitem index to query for text
Returns: The text of the specified menu item, or null if the index is out of range.
{} index - menu index
{} [itemIndex] - submenu index; when specified the submenu items will be count
Returns: The number of menu items in the specified menu or submenu.
{} index The index 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: The zoom factor of the current window
{} id - the id of the view to execute javascript in.
{} 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: True if the window is currently in full-screen mode; otherwise, false.
Returns: True if the window is currently maximized; otherwise, false.
Returns: True if the window is currently minimized; otherwise, false.
Returns: True if the window is in its default (normal) state; otherwise, false.
Returns: True if the window is currently visible to the user; otherwise, false.
{} 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 - menu position
{} [itemIndex] - submenu 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 If true, sets the window to full-screen mode; if false, exits full-screen mode.
{} visible If true, the menu bar will be shown; if false, it will be hidden.
{} width Integer value greater than zero
{} height Integer value greater than zero
{} factor (values greater than 0.0 and smaller or equal to 5.0)
Returns: True if the zoom factor was successfully set; otherwise, false.
{} flag If true, external links will open in the OS default browser; if false, they will open in a new ngdesktop window.
Type:
Type:
Type:
Type:
Type:
Type:
Type:
Type:
Type: