<< Click to Display Table of Contents >>
InsertScreenTab |
InsertScreenTab(TabName, TabTitle, ScreenPath, [Arg])
Inserts a tab on the window of a WaterExplorer object, with the name indicated by the TabName parameter, containing a Screen indicated by the ScreenPath parameter. The title of this tab is indicated by the TabTitle parameter. If this parameter is empty, the value of the TabName parameter is then displayed. If that tab does not exist, it is created and, if it already exists, changes the Screen. In case of overwriting the Screen, if the title is informed, this title is replaced. If the value passed in this parameter is an empty String, remains the already configured value. In case users inform only the title and the tab already exists, only the tab's title is changed.
This method returns True if a new tab is created, or False if an existing tab is overwritten. This method returns a script error if the tab's name is an empty String or a default name, "Analogs" (Analog tab), "Discretes" (Discrete tab), or "Commands" (Commands tab).
The tab is always inserted at the last position, and it is not activated during the insertion. When clicking this tab to activate it, the Screen's OnPreShow event is executed, thus receiving the value passed in the Arg parameter. If this parameter is omitted, no value is passed to the Screen. The next script contains an example of using this method.
Sub CommandButton_Click()
Set WE = Application.GetWaterExplorer("System1.Station1")
WE.InsertScreenTab "ChartTab", "Chart", "ChartScreen", 0
WE.Show()
End Sub