hook_<libraryPrefix>_namingFaceplateTabs()
This function determines the titles for the tabs in a faceplate.
Synopsis
void hook_<libraryPrefix>_namingFaceplateTabs(string sDp,
dyn_langString &name, dyn_string panels);
Parameters
Parameter | Description |
---|---|
sDp | Name of the datapoint. |
name | Name of the faceplate. |
panels | Name of the tab panel. |
Return Value
-
Description
This function determines the titles for the tabs in a faceplate.
By default, a tab title is determined from the text catalog of the library by defining the name of the tab panel as keyword and by assigning the titles in the adjacent columns depending on the language.
If no title was specified in the text catalog of the library for the tab, the name of the tab panel is used as tab title in all project languages.
You can find the function in the stdlib_hook_project.ctl under wincc_oa_path/Stdlib_3.19/scripts/libs/
hook_namingFaceplateTabs(string dp, dyn_langString &name, dyn_string panels)
{
dyn_string dsTmp;
langString entry;
string text;
int nrOfLangs = getNoOfLangs();
if (DebugInfos) DebugN("nrOfLangs",nrOfLangs, dynlen(panels));
//read out the Faceplatetabnames from the messagecatalog
for (int i=1; i<=dynlen(panels); i++)
{
text = panels[i];
strreplace(text, ".pnl", "");
strreplace(text, ".xml", "");
dsTmp = makeDynString();
for (int j=1; j<=nrOfLangs; j++)
{
dsTmp[j] = getCatStr(getLibNameFromDP(dp),text,getGlobalLangId(j-1));
dyn_errClass de;
de=getLastError();
if(dynlen(de)!=0)
{
dsTmp[j] = getCatStr("stdlib",text,getGlobalLangId(j-1));
de=getLastError();
if(dynlen(de)!=0)
{
dsTmp[j]=text;
DebugN("error!, faceplate-tabname not found for",text, dp);
}
}
}
entry = dsTmp;
name[i] = entry;
}
}