You are here: Core Reference > Coding > Scripting > AlarmBanner.AddMenuItem

AlarmBanner.AddMenuItem

The AddMenuItem function allows a script to add a menu option to the context sensitive menu that is available via the Alarm Banner in ViewX. The AddMenuItem function is only available for use in Alarm Banner scripts and has to come after the BuildAlarmMenu function in the script.

Syntax

AlarmBanner.AddMenuItem (Title, Function)

Description

Adds a menu item to the context sensitive menu that is available for alarms in the Alarm Banner.

Arguments

Title {string}

Defines the name that will be shown for the new option on the Alarm Banner’s context sensitive menu.

 

Function {string}

The name of the function that will be called when the menu option is selected. The function has to be defined later in the script

Returns

None.

NOTE: Any alarm options that you add to the context sensitive menu for the Alarm Banner or Alarms List are only available in ViewX.

Example:

In this example, the AddMenuitem function is used to add 3 options to the context sensitive menu for the Alarm Banner: Show Alarm Details, Print Alarm Details, and Display Alarm Report Form. Each option has a function that defines what action occurs when the option is selected. These functions would be defined elsewhere in the script (AlarmInfo, PrintAlarmInfo, and DisplayAlarmForm).

  • Function BuildAlarmMenu
    • AlarmBanner.AddMenuItem "Show Alarm Details","AlarmInfo"
    • AlarmBanner.AddMenuItem "Print Alarm Details","PrintAlarmInfo"
    • AlarmBanner.AddMenuItem "Display Alarm Report Form","DisplayAlarmForm"
  • End Function


ClearSCADA 2015 R2