class ContextMenu
- Extends:
- UIComponent
Description:
ContextMenu UI component that extends UIComponent class.
ContextMenu is used to create menus that pop up when user right clicks on UI component or system tray icon.
Constructor
constructor()
ContextMenu constructor.
Parameters:
No parameters
Members
- [ readonly ] childCount
- [ readonly ] children
- [ readonly ] container
- [ readonly ] id
- [ readonly ] invoker
- [ readonly ] parent
- [ readonly ] screenPosition
Methods
From this class:
Inherited from UIComponent:
- addChild()
- addTo()
- child()
- childIndex()
- cursor()
- destroy()
- emit()
- enabled()
- height()
- hide()
- onAncestorEvents()
- onComponentEvents()
- onContainerEvents()
- onDispose()
- onError()
- onMouseEvents()
- onMouseMotion()
- onMouseWheel()
- onPropertyChange()
- opacity()
- position()
- remove()
- size()
- snapshot()
- text()
- updateUI()
- verifyComponent()
- visible()
- width()
- x()
- y()
Examples:
// Usage example:
const menu = new ContextMenu(); // creates new context menu
new MenuItem("Item 1").addTo(menu); // adds menu item to context menu
new MenuItem("Item 2").addTo(menu); // adds menu item to context menu
textfield.contextMenu(menu); // set context menu for text field
