createSymbol()
Adds a panel references in a panel or layout at a later time during run time. The function is identical to addSymbol() but prevents the triggering of the added objects initialize scripts.
Synopsis
int createSymbol(shape panel | (string moduleName, string panelName), string
fileName, string refName, dyn_string subst, int x, int y, float angle, float
scx, float scy[, string ewoName]);
Vertikales oder Horizontales Layout
int createSymbol(shape panel | (string moduleName, string panelName), string
fileName, string refName, int index, string layout, dyn_string subst =
makeDynString());
Grid Layout
int createSymbol(shape panel | (string moduleName, string panelName), string
fileName, string refName, int row, int column, string layout, int rowspan = 1,
int columnspan = 1, dyn_string subst = makeDynString());
Parameter
Parameter | Description |
---|---|
panel | A shape variable pointing to a panel. Either this parameter or the combination of moduleName and panelName can be used to define the target. |
moduleName, panelName |
Module and panel name of the target as string. In order to add an object in a tab, both parameters have to be replaced by the functions myModuleName() and myPanelName(). If an empty string "" is used instead of myPanelName(), the tab is used as this panel. |
fileName | File name under which the reference is stored. |
refName | Name of the reference that is unique in the system with which the reference can be addressed, for example from a Control script. |
Subst | Definition of $ parameters (similar to opening a panel). |
x, y | Are the coordinates at which the reference refName is displayed in the panel panelName. |
angle | Relative rotation around the reference point of the panel reference to be displayed. |
scx, scy | Scaling with center in the reference point of the panel reference to be displayed. |
ewoName | Name of the EWO to which shapes should be added. Currently this is supported by the GisViewer.ewo only. |
index | The position inside of the layout in which the symbol should be added. The index count is started at 0. |
layout | Name of the layout object in which the object should be placed. |
row | The horizontal position inside of the grid in which the symbol should be added. The row index count is started at 0. |
column | The vertical position inside of the grid in which the symbol should be added. The column index count is started at 0. |
rowspan | The number of horizontal grid areas the symbol should use. (optional) |
columnspan | The number of vertical grid areas the symbol should use. (optional) |
Return Value
Returns 0, in the event of a failure returns -1.
Errors
Missing arguments in the function.
Description
This function can be used to insert panel references in a panel or objects into a layout at a later date during run time. All symbols that are loaded later are removed when the panel is closed or with the function removeSymbol().
The function will also not trigger the initialize scripts of the added symbol. To trigger the script please use the function addSymbol() instead.
When using the function createSymbol(), the active element which is starting the createSymbol() command, looses the focus. The focus switches to the last inserted element.
For example: a cursor moves up or down in a combo box, and each entry inserts an element using createSymbol(). This works only once, because the cursor switches to the inserted element.
For keeping the focus on the object, you have to set the focus with setInputFocus() back to the object:
setInputFocus (myModuleName(), myPanelName(), this.name);
If an object is loaded into a reference via the createSymbol() function and an acknowledgement was configured for this object, the acknowledgement data point is not loaded into the panel when configuring sum alerts via the +panel button. The acknowledgement data point is not loaded because the createSymbol() is called first at runtime and the data point is not available yet.
When adding a reference into a horizontal or vertical layout the reference is appended after the stated position whereas for a grid layout the reference is added to the stated position. In either case the layout is extended with the stated position if the stated position did not exist before.
The function only suppresses the Initialize scripts of the panel that is loaded. Any Initialize scripts of the objects inside of the panels are still triggered!
Inserts "pump" later in the top left corner (0,0) of the "overview" panel in the "gedi" module.
main()
{
createSymbol("gedi","overview","pump","p1","",0,0,0,1,1);
}
Adds the reference "Reference1" containing two graphics elements to the panel "Ellipse" and passes the colors for the objects as dollar parameters "$p1:"+"blue","$p2:"+"green". In the first example the panel "Ellipse.pnl" is opened in the module "Ellipse". In the second example the reference is added to the panel "Ellipse.pnl" using createSymbol().
In the reference "Reference1", set the colors of the graphics objects using the dollar parameters <ShapeName>.backCol($p1); , for example, ELLIPSE1.backCol($p1);
main()
{
ModuleOnWithPanel("Ellipse",50,50,70,70,2,2,"None","Ellipse.pnl","Ellipse",makeDynString());
}
main()
{
createSymbol("Ellipse", "Ellipse", "Referenz1.pnl", "Ref1",
makeDynString("$p1:"+"blue","$p2:"+"green"), 50, 50, 0, 1,
1);
}
Assignment
Graphics function
Availability
UI