Configuring a Context Menu

The Canvas screen and many controls support a right-click context menu that is available in run mode. Each context menu contains a set of standard (fixed) menu items, which may differ depending on the screen or control, and optionally any configured custom context menu items, which can be scripted to support customized screen and control behavior.

For more information, see the following subsections below:

Standard Context Menus

For the screen the context menu with fixed items is always available. There is no option to turn it off.

Screen

The screen has its own set of fixed context menu items:

  • Copy full path — Copy the full path of the screen's location, either in an APPS or BSS folder or a local or network file-system folder, to the clipboard. The file name is displayed in the context menu. A temporary file name will be used if the screen is in an "unsaved" state.
  • Facility configuration — Open the Properties for <Facility> dialog box. The facility ID is displayed in the context menu, including resolved facilities if appropriate. If no facility is defined for the screen, this context menu item is not displayed.
  • Show default chart — Navigate to the default chart associated with this screen. See Default Chart for more information.
  • Show historical playback — Click to open the Historical Playback bar to replay historical data for all open screens. See Using Historical Playback for more information. Not supported by TWC
 

Context menu

Screen context menu

 

 

Controls

For the controls the context menu with fixed items is optional. The context menu is configured via the Show context menu property in the Properties pane for the control —

The Show context menu check box indicates whether a right-click context menu will be available or suppressed in run mode. The default context menu will allow alarm acknowledgment, access to point history and alarm history, point configuration, and facility configuration.

Note: The CygNet Thin Web Client supports its own context menu in the web view. When activated the context menu appears on the right side of the page. From the CygNet TWC web view context menu you can view point values, acknowledge a point in alarm, view and edit alarm values, and add a selected point to an ad-hoc chart. See Using the Thin Web Client Context Menu.

The standard context menu for controls and the CygNet Grid displaying point data displays the following fixed items:

  • Current value — Open the Point Properties dialog box
  • Acknowledge alarm — Acknowledge an unacknowledged alarm
  • History Arrow right
    • History values — Open the History Values dialog box
    • Alarm history — Open the Alarm History dialog box
  • Point configuration Arrow right
    • Comments — Open the Comments tab of the PNT Editor
    • Alarm settings — Open the Alarm Settings dialog box for the point type
    • All settings — Open the PNT Editor
    • Questionable state — Open the Edit Questionable State dialog box
    • Alarm suppression — Open the Alarm Suppression Settings dialog box
  • Facility configuration — Open the Properties for <Facility> dialog box
  • Add to chart — Add point values to a default chart
    • New chart — Add values to a new default chart
    • New chart with rollups — Add rolled-up values to a new chart. Four labelled rollup series will be added to the default chart:
      • Real Time — No rollup
      • Min — Calculated minimum
      • Max — Calculate maximum
      • Mean — Calculated mean
    • Chart n — Add values to a previously opened default chart
 

Context menu

Standard context menu
Point configuration

 

Context menu

Standard context menu
Add to chart

The Alarm Grid has a unique set of fixed context menu items:

  • Acknowledge alarm — Acknowledge an alarm
  • Clear alarm — Clear the alarm
  • Force clear alarm — Remove an alarm associated with a specified point tag that has not been reset or acknowledged
  • Hide alarm... — Hide the alarm
  • Unhide alarm — Unhide the alarm
  • Alarm suppression... — Suppress an alarm on an ad hoc basis
 

Context menu

Alarm Grid context menu

Custom Context Menu Items

Not supported by TWC Canvas supports scripted context menu items, in addition to the standard context menu items that display in run mode. A custom context menu item will call an event into script allowing customized control behavior. The custom context menu options will appear at the bottom of the fixed context menu options, separated by a line.

Relevant Property

Context menu items

Not supported by TWC The Custom Context Menu Configuration dialog box is where you configure any custom context menu items that will appear in the right-click context menu for the screen or control. Each custom context menu item will call an event into script so that you can customize screen or control behavior.

The custom context menu options will appear at the bottom of the fixed context menu options, separated by a line.

Each custom context menu item has a title and an event script ID; items can be designated as a separator; and custom context menus support nested menu items.

Click Configure custom context menu items to open the Custom Context Menu Configuration dialog box.

Relevant Script Event

Custom Context Menu Action

The Custom Context Menu Action event is called when the custom context menu item is clicked. A Script event ID (configured for each custom context menu item in the Context Menu Items property for the screen or control) is passed in along with other relevant information in the context of the click, for example, facility or point tag, as appropriate.

Example

The following example shows how to use the Custom Context Menu Action event for the CygNet Grid. Substitute Grid1 with your control.

Canvas.Controls.Grid.CustomContextMenuActionEventArgs

When you click on a custom context menu item from a control, Canvas will execute the following function:

CustomContextMenuActionEventArgs.EventActionID indicates the Script event ID defined in the Custom Context Menu Configuration dialog box.

Copy
Custom Context Menu Action event
private void Grid1_CustomContextMenuAction(object sender, EventArgs args)

{
    CustomContextMenuActionEventArgs myargs = (CustomContextMenuActionEventArgs)args;
    MessageBox.Show(myargs.MenuItemText + " " + myargs.EventActionID + " " + myargs.FacilityTag + " " + myargs.PointTag);
}

See Event Argument Type for more information about EventArgs.

CygNet Thin Web Client Context Menu Items

The CygNet Thin Web Client supports its own context menu visible in the web view.

Perform the following actions from the TWC context menu:

  • Right-click on a control to view the context menu for a selected point. When the context menu is active the main part of the page is dimmed. The context menu is divided into four sections:
    1. Acknowledge Alarm — If the point is in alarm, the Acknowledge Alarm icon will indicate this state. Click to acknowledge it and the Acknowledge Alarm will disappear.
    2. Current Value — View read-only Current Value attributes for the selected point.
    3. Alarm Summary — Click the toggle switch to view Alarm Summary values.

      From here you can edit alarm threshold values or the alarm priority in the context menu, which will be written back to the point on the CygNet host server. A warning will show if you do not have the appropriate security access level to edit points.

      1. Click Edit button (Edit) then click on the Value or Priority you want to edit.
      2. Enter a new value or use the spin control to increase or decrease the value.
      3. Click Edit button (Save) to write the new value back to the point configuration on the CygNet host server.
      4. Or click Cancel edit (Cancel) to abort and return to the read-only mode.
    4. Chart — Click the toggle switch to view a quick Chart for a selected point. The series shows the last eight hours of value history and will update with each new point value received. Hover over any point in the series to reveal a small popup showing the UDC, point value, and timestamp. From here you can add the currently viewed point to a new or existing ad hoc chart which will display in a new browser tab. Note that an ad hoc chart is not a template. Any saved chart is hard-coded with specific point tags.
      1. Click Add to new chart to add the selected point to a new ad hoc chart. A new chart titled NewChart<n> will open in a new browser tab, where you can rename, duplicate, or delete the chart. You can also view the chart data in a grid and export data to an Excel file.
      2. Click Existing chart(s) to open a drop-down list of previously saved ad hoc charts.
      3. Click the + <chart name> to add the selected point to that chart. The selected chart will open in a new browser tab.  Note: If you add a point to an existing chart that is already opened in another tab, then the point is added to that open chart but TWC does not shift focus to that tab. You will remain on the current tab.
      4. Click Existing chart(s) again to close the drop-down list of existing charts.

      Once saved an ad hoc chart can be viewed from the main CygNet TWC web view via the Saved Charts (Saved Charts ) button. See Viewing Data in a TWC Ad Hoc Chart for more information about working with ad hoc charts.

  • Click Close the context menu (Close) to close the context menu and return to the TWC page that launched the menu.

See Using the Thin Web Client Context Menu for more information.

 

TWC Context Menu - Current Value Normal

TWC Context Menu:
Current Value Normal

TWC Context Menu - Current Value in Alarm

TWC Context Menu:
Current Value in Alarm

TWC Context Menu - Alarm Summary Edit

TWC Context Menu:
Alarm Summary in edit mode

TWC Context Menu - Chart

TWC Context Menu: Chart