Functions
The Charms API contains the following functions, which are part of the voltmx.application Namespace.
voltmx.application.createSettingsMenu
This API enables you to create a Charm settings menu for an application.
Syntax
Input Parameters
Parameter | Description |
---|---|
id [String] - Mandatory | Identifier of the Charm setting menu created. |
menuSettings [Hash table] - Mandatory | The menuSettings hash table comprises the following key-value pairs:id: ID of the Charm menu item.text: Name of the menu item. |
Example
Return Values
None.
Special Considerations
If a Charm setting menu is already created with the identifier passed, a new Charm setting menu will be created and the old Charm setting menu will be replaced with the new one. The same holds true for menu items as well.
At least one menu item must be present in the Charm settings menu created. A Charm settings menu with no menu items is invalid.
Platform Availability
Available on Windows only.
voltmx.application.setCurrentSettingsMenu
This method uses the unique identifier which represents the Charm settings menu and sets it as current settings menu. There can be only one current settings menu that can be set any time. Calling this method multiple times, replaces the current Charm settings menu.
Syntax
Input Parameters
Parameter | Description |
---|---|
id [String] - Mandatory | Identifier of the Charm setting menu to be set. |
Example
Return Values
None
Platform Availability
Available on Windows only.
voltmx.application.getCurrentSettingsMenu
This method returns the unique identifier of the current menu that is set through getCurrentSettingsMenu.
Syntax
Input Parameters None
Example
Return Values
Return value | Description |
---|---|
Unique Identifier | Identifier of the Charm setting menu to be set. |
Platform Availability
Available on Windows only.
voltmx.application.addSettingsMenuItemAt
This API enables you to add a menu item at a given index in the Charm settings menu.
Syntax
Input Parameters
Parameter | Description |
---|---|
id [String] - Mandatory. | Identifier of the Charm setting menu created. |
index [Number] - Mandatory. | The index at which the menu item must be added. The index value lies between 0 and n-1. If the index is beyond the current length of the Charm menu items then the item is added to the end. |
menuSettings [Hash table] - Mandatory | The menuSettings hash table comprises the following key-value pairs: id: ID of the Charm menu item. text: Name of the menu item. onClick: onclick event to be executed for the menu item. |
Example
To add a menu item at a given index, enter the following:
Return Values
None.
Platform Availability
Available on Windows only.
voltmx.application.removeSettingsMenuItemAt
This API enables you to removes the specified App Menu item based on the index.
Syntax
Input Parameters
Parameter | Description |
---|---|
id [String] - Mandatory | Identifier of the Charm setting menu created. |
index [Number] - Mandatory | The index from which the menu item must be removed. The index value lies between 0 and n-1. |
Example
To remove a menu item from a given index, enter the following:
Return Values
None
Platform Availability
Available on Windows only.