[TabAlarm.Custom]Function.Row.ShowContextMenu
- Last UpdatedJul 19, 2023
- 1 minute read
Sets your own function to show the context menu to response to the right-clicking of an alarm on the tab style alarm templates.
Note: This parameter is available only to projects based on the Tab_Style templates.
Allowable Values:
Name of user defined function which conforms to the following specification:
Syntax
<function>(INT listID, INT rowID)
listID: ID of the alarm list
rowID: Row number (starting from 0) of the clicked alarm
Default Value:
None
Return Value:
0 if run successfully or error code otherwise
Example
[TabAlarm.Custom]
Function.Row.ShowContextMenu = MyAlarmContextMenu
.
INT FUNCTION MyAlarmContextMenu(INT listID, INT rowID)
// Get AN of the alarm list
INT listAN = TabAlarm_GetAN(listID);
INT selection;
// Show menu
DspPopupMenu(0, "Show Details");
DspPopupMenu(0, "Acknowledge");
selection = DspPopupMenu();
// Run selected command
SELECT CASE selection
CASE 1
RETURN TabAlarm_Row_ShowInfo(listID, rowID);
CASE 2
IF TabAlarm_GetAckPriv() THEN
RETURN AlarmAckRec(AlarmGetDsp(listAN + rowID, "RecNo"));
ELSE
Message("Error", ErrMsg(276), 16);
RETURN 276; // no privilege for operation
END
END SELECT
RETURN 0;
END