class ContextMenu
- Extends:
- ContainerComponent, UIComponent
Description:
ContextMenu UI component that extends ContainerComponent, which 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.
Members
- [ readonly ] childCount
- [ readonly ] children
- [ readonly ] id
- [ readonly ] invoker
- [ readonly ] isContainer
- [ readonly ] parent
- [ readonly ] screenPosition
Methods
From this class:
Inherited from ContainerComponent:
Inherited from UIComponent:
- addTo()
- cursor()
- destroy()
- emit()
- enabled()
- height()
- hide()
- onAncestorEvents()
- onComponentEvents()
- onDispose()
- onError()
- onMouseEvents()
- onMouseMotion()
- onMouseWheel()
- onPropertyChange()
- onShortcut()
- opacity()
- position()
- remove()
- shortcuts()
- size()
- snapshot()
- text()
- update()
- 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
