Menu functions are used for creating a menu to be displayed in the toolbar of a chart. 


Sections


Functions

Function Details


Functions


Name

Description

MenuAddCheckbox

Adds a checkbox menu item to a specified menu/submenu with two possible options to be displayed based on whether the checkbox is checked or not.

MenuAddCheckboxRGB

Adds a checkbox menu item to a specified menu/submenu with two possible options to be displayed based on whether the checkbox is checked or not.

MenuAddCombobox

Adds a combobox menu item to a specified menu/submenu with multiple possible values that can be selected.

MenuAddComboboxRGB

Adds a combobox menu item to a specified menu/submenu with multiple possible values that can be selected.

MenuAddHeader

Adds a heading below a specified menu/submenu item.

MenuAddInteger

Adds an integer picker menu item to a specified menu/submenu.

MenuAddIntegerRGB

Adds an integer picker menu item to a specified menu/submenu.

MenuAddNumber

Adds a decimal number picker menu item to a specified menu/submenu.

MenuAddNumberRGB

Adds a decimal number picker menu item to a specified menu/submenu.

MenuAddSeparator

Adds a separator below a specified menu item.

MenuAddSubMenu

Creates a submenu to the top menu or to another submenu.

MenuAddSubMenuRGB

Creates a submenu to the top menu or to another submenu.

MenuAddText

Adds a text item below a specified menu item.

MenuAddTextRGB

Adds a text item below a specified menu item.

MenuCreate

Creates the top menu object to be displayed in the toolbar.

MenuCreateRGB

Creates the top menu object to be displayed in the toolbar.

MenuDelete

Deletes a specified menu item.

MenuGetCheckboxValue

Gets the selected value of a specified checkbox.

MenuGetComboboxValue

Gets the selected value of a specified combobox.

MenuGetIntegerValue

Gets the value from a specified integer picker.

MenuGetNumberValue

Gets the number value from a specified number picker.

MenuGetParentMenuId

Gets the parent menu item of a specified menu item or -1 if the menu item has no parent or doesn't exist.

MenuGetVisibility

Determines whether a specified menu item is visible or not. Returns true if the menu item is visible, false otherwise.

MenuIsInitialized

Indicates whether the menu has been initialized.

MenuSetVisibility

Sets whether a specified menu item is visible or not.


Function Details


int MenuAddCheckbox(int parentMenuItemId, string label, string option1Label, int option1Value, string option2Label, int option2Value, bool autoRebuild, int defaultOptionValue)

Adds a checkbox menu item to a specified menu/submenu with two possible options to be displayed based on whether the checkbox is checked or not.


Returns


The ID of the newly created checkbox menu item.


Parameters


Type

Identifier

Description

int

parentMenuItemId

The ID of the parent menu/submenu to which the checkbox will be added.

string

label

The display label for the checkbox.

string

option1Label

The label for the first option.

int

option1Value

The value corresponding to the first option.

string

option2Label

The label for the second option.

int

option2Value

The value corresponding to the second option.

bool

autoRebuild

Indicates whether to trigger an immediate rebuild of the menu upon checking or unchecking.

defaultOptionValue

int

The default value to be used when the checkbox is created.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuAddCheckboxRGB(int parentMenuItemId, string label, string option1Label, int option1Value, string option2Label, int option2Value, bool autoRebuild, int defaultOptionValue, int[] labelColorRGBA, int[] option1LabelColorRGBA, int[] option2LabelColorRGBA)

Adds a checkbox menu item to a specified menu/submenu with two possible options to be displayed based on whether the checkbox is checked or not.


Returns


The ID of the newly created checkbox menu item.


Parameters


Type

Identifier

Description

int

parentMenuItemId

The ID of the parent menu/submenu to which the checkbox will be added.

string

label

The display label for the checkbox.

string

option1Label

The label for the first option.

int

option1Value

The value corresponding to the first option.

string

option2Label

The label for the second option.

int

option2Value

The value corresponding to the second option.

bool

autoRebuild

Indicates whether to trigger an immediate rebuild of the menu upon checking or unchecking.

int

defaultOptionValue

The default value to be used when the checkbox is created.

int[]

labelColorRGBA

The RGB + Alpha color of the checkbox label.

int[]

option1LabelColorRGBA

The RGB + Alpha color of the label for the first option.

int[]

option2LabelColorRGBA

The RGB + Alpha color of the label for the second option.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuAddCombobox(int parentMenuItemId, string label, string[] options, int[] values, int defaultValue, bool autoRebuild)

Adds a combobox menu item to a specified menu/submenu with multiple possible values that can be selected.


Returns


The ID of the newly created combobox menu item.


Parameters


Type

Identifier

Description

int

parentMenuItemId

The ID of the parent menu/submenu to which the checkbox will be added.

string

label

The display label for the combobox.

string[]

options

An array of strings representing the labels of the options for the combobox.

int[]

values

An array of integers representing the values of the options for the combobox.

int

defaultValue

The default value to be used when the combobox is created.

bool

autoRebuild

If true, triggers an immediate rebuild of the menu upon option selection.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuAddComboboxRGB(int parentMenuItemId, string label, string[] options, int[] values, int defaultValue, bool autoRebuild, int[] labelColorRGBA)

Adds a combobox menu item to a specified menu/submenu with multiple possible values that can be selected.


Returns


The ID of the newly created combobox menu item.


Parameters


Type

Identifier

Description

int

parentMenuItemId

The ID of the parent menu/submenu to which the checkbox will be added.

string

label

The display label for the combobox.

string[]

options

An array of strings representing the labels of the options for the combobox.

int[]

values

An array of integers representing the values of the options for the combobox.

int

defaultValue

The default value to be used when the combobox is created.

bool

autoRebuild

If true, triggers an immediate rebuild of the menu upon option selection.

int[]

labelColorRGBA

The RGB + Alpha color representing the color of the label.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuAddHeader(int parentMenuItemId, string heading)

Adds a heading below a specified menu/submenu item.


Returns


The ID of the newly created header.


Parameters


Type

Identifier

Description

int

parentMenuItemId

The ID of the parent menu/submenu to which the checkbox will be added.

string

heading

The text of the heading to be added.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuAddInteger(int parentMenuItemId, string label, int defaultValue, int min, int max)

Adds an integer picker menu item to a specified menu/submenu.


Returns


The ID of the newly created integer picker menu item.


Parameters


Type

Identifier

Description

int

parentMenuItemId

The ID of the parent menu/submenu to which the integer picker will be added.

string

label

The display label for the integer picker.

int

defaultValue

The default value to be used when the integer picker is created.

int

min

The minimum value that can be selected in the integer picker.

int

max

The maximum value that can be selected in the integer picker.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuAddIntegerRGB(int parentMenuItemId, string label, int defaultValue, int min, int max, int[] labelColorRGBA)

Adds an integer picker menu item to a specified menu/submenu.


Returns


The ID of the newly created integer picker menu item.


Parameters


Type

Identifier

Description

int

parentMenuItemId

The ID of the parent menu/submenu to which the integer picker will be added.

string

label

The display label for the integer picker.

int

defaultValue

The default value to be used when the integer picker is created.

int

min

The minimum value that can be selected in the integer picker.

int

max

The maximum value that can be selected in the integer picker.

int[]

labelColorRGBA

The RGB + Alpha color representing the color of the label.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuAddNumber(int parentMenuItemId, string label, double defaultValue, double min, double max)

Adds a number picker menu item to a specified menu/submenu.


Returns


The ID of the newly created number picker menu item.


Parameters


Type

Identifier

Description

int

parentMenuItemId

The ID of the parent menu/submenu to which the number picker will be added.

string

label

The display label for the number picker.

int

defaultValue

The default value to be used when the number picker is created.

int

min

The minimum value that can be selected in the number picker.

int

max

The maximum value that can be selected in the number picker.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuAddNumberRGB(int parentMenuItemId, string label, double defaultValue, double min, double max, int[] labelColorRGBA)

Adds a number picker menu item to a specified menu/submenu.


Returns


The ID of the newly created number picker menu item.


Parameters


Type

Identifier

Description

int

parentMenuItemId

The ID of the parent menu/submenu to which the number picker will be added.

string

label

The display label for the number picker.

int

defaultValue

The default value to be used when the number picker is created.

int

min

The minimum value that can be selected in the number picker.

int

max

The maximum value that can be selected in the number picker.

int[]

labelColorRGBA

The RGB + Alpha color representing the color of the label.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuAddSeparator(int parentMenuItemId)

Adds a separator below a specified menu item.


Returns


The ID of the newly created separator.


Parameters


Type

Identifier

Description

int

parentMenuItemId

The ID of the parent menu item below which the separator will be added.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuAddSubMenu(int parentMenuItemId, string label)

Creates a submenu to the top menu or to another submenu.


Returns


The ID of the newly created submenu.


Parameters


Type

Identifier

Description

int

parentMenuItemId

The ID of the parent menu/submenu to which the new submenu will be added.

string

label

The display label for the submenu.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuAddSubMenuRGB(int parentMenuItemId, string label, int[] labelColorRGB)

Creates a submenu to the top menu or to another submenu.


Returns


The ID of the newly created submenu.


Parameters


Type

Identifier

Description

int

parentMenuItemId

The ID of the parent menu/submenu to which the new submenu will be added.

string

label

The display label for the submenu.

int[]

labelColorRGB

The RGB + Alpha color representing the color of the label.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuAddText(int parentMenuItemId, string text, bool autoRebuild)

Adds a text item below a specified menu item.


Returns


The ID of the newly created text item.


Parameters


Type

Identifier

Description

int

parentMenuItemId

The ID of the parent menu item below which the text will be added.

string

text

The text content to be added.

bool

autoReubild

If true, triggers an immediate rebuild of the menu on click.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuAddTextRGB(int parentMenuItemId, string text, bool autoRebuild, int[] textColorRGBA)

Adds a text item below a specified menu item.


Returns


The ID of the newly created text item.


Parameters


Type

Identifier

Description

int

parentMenuItemId

The ID of the parent menu item below which the text will be added.

string

text

The text content to be added.

bool

autoReubild

If true, triggers an immediate rebuild of the menu on click.

int[]

textColorRGB

The RGB + Alpha color representing the color of the text.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuCreate(string label)

Creates the top menu object to be displayed in the toolbar.


Returns


The ID of the newly created menu object.


Parameters


Type

Identifier

Description

string

text

The display label for the top menu object.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuCreateRGB(string label, int[] labelColorRGBA)

Creates the top menu object to be displayed in the toolbar.


Returns


The ID of the newly created menu object.


Parameters


Type

Identifier

Description

string

label

The display label for the top menu object.

int[]

labelColorRGBA

The RGB + Alpha color representing the color of the label.


Scripts


Indicator, Signal, Pattern, Drawing


MenuDelete(int menuItemId)

Deletes a specified menu item.



Parameters


Type

Identifier

Description

int

menuItemId

The ID of the menu item to be deleted.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuGetCheckboxValue(int menuItemId)

Gets the selected value of a specified checkbox.


Returns


The checkbox value of the specified checkbox menu item.



Parameters


Type

Identifier

Description

int

menuItemId

The ID of the checkbox menu item.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuGetComboboxValue(int menuItemId)

Gets the selected value of a specified combobox.


Returns


The combobox value of the specified combobox menu item.



Parameters


Type

Identifier

Description

int

menuItemId

The ID of the combobox menu item.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuGetIntegerValue(int menuItemId)

Gets the value from a specified integer picker.


Returns


The value of the specified integer menu item.



Parameters


Type

Identifier

Description

int

menuItemId

The ID of the integer picker menu item.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuGetNumberValue(int menuItemId)

Gets the value from a specified number picker.


Returns


The value of the specified number menu item.



Parameters


Type

Identifier

Description

int

menuItemId

The ID of the number picker menu item.


Scripts


Indicator, Signal, Pattern, Drawing


int MenuGetParentMenuId(int menuItemId)

Gets the parent menu item of a specified menu item or -1 if the menu item has no parent or doesn't exist.


Returns


The parent menu id of the specified menu item.



Parameters


Type

Identifier

Description

int

menuItemId

The ID of the menu item.


Scripts


Indicator, Signal, Pattern, Drawing


bool MenuGetVisibility(int menuItemId)

Determines whether a specified menu item is visible or not. Returns true if the menu item is visible, false otherwise.


Returns


True if the menu is visible, false otherwise.



Parameters


Type

Identifier

Description

int

menuItemId

The ID of the menu item.


Scripts


Indicator, Signal, Pattern, Drawing


MenuIsInitialized()

Indicates whether the menu has been initialized.


Returns


True if the menu has been initialized, false otherwise.



Scripts


Indicator, Signal, Pattern, Drawing


MenuSetVisibility(int menuItemId, bool visible)

Sets whether a specified menu item is visible or not.



Parameters


Type

Identifier

Description

int

menuItemId

The ID of the menu item.

bool

visible

True to make the menu item visible, false to hide it.


Scripts


Indicator, Signal, Pattern, Drawing