hook_<libraryPrefix>_projectFillPopUpMenu()
This function configures the context menu of a symbol and elementary symbols of a faceplate.
Synopsis
void hook_<libraryPrefix>_
projectFillPopUpMenu(string sDp,
dyn_string &dsMenueEntry, dyn_string &dsFunction);
Parameters
Parameters
Parameter | Description |
---|---|
sDp | Data point name |
dsMenueEntry | Entry in the context menu |
dsFunction | Function of the entry |
Return Value
-
Description
This function configures the context menu of a symbol and the elementary symbols of a faceplate. By default, the following entries in the context menu are provided: DP Monitor, Para, Help, Alarm Screen, Even Screen and Trend.
You can find the function in the stdlib_hook_project.ctl under wincc_oa_path/Stdlib_3.20/scripts/libs/
hook_projectFillPopUpMenu(string sDp, dyn_string &dsMenueEntry, dyn_string &dsFunction)
{
string sDpMonitor, sPara, sHelp, sAlarm, sEvents, sTrend;
sDpMonitor = getCatStr("stdlib","DpMonitor");
sPara = getCatStr("stdlib","Para" );
sHelp = getCatStr("stdlib","Help" );
sAlarm = getCatStr("stdlib","Alarm" );
sEvents = getCatStr("stdlib","Events" );
sTrend = getCatStr("stdlib","Trend" );
dsMenueEntry= makeDynString("PUSH_BUTTON", sPara + ", "+PARA+" , " + ((isModeExtended() && getUserPermission(32))?"1":"0"),
"PUSH_BUTTON", sAlarm + ", "+ALARMS+" , " + TRUE,
"PUSH_BUTTON", sEvents + ", "+EVENTS+ " , " + TRUE,
"PUSH_BUTTON", sDpMonitor + ", "+DPMONITOR+", " + TRUE,
"PUSH_BUTTON", sTrend + ", "+TREND+" , " + TRUE,
"PUSH_BUTTON", sHelp + ", "+HELP+" , " + TRUE
);
dsFunction=makeDynString("OpenDpMonitor(\""+sDp+"\");","OpenPara(\""+sDp+"\");","OpenHelp(\""+sDp+"\");","OpenAlerts(\""+sDp+"\");","OpenEvents(\""+sDp+"\");","OpenTrend(\""+sDp+"\");");
}
/*
@author Markus Trummer
function for adding and removing faceplate tabs before opening the faceplate
@param sDp ... datapoint for which the faceplate will be opened
@param &ds_panels ... panels which will be opend
@param &ds_pfad ... paths of the panels
*/