startSymbol()

Starts a panel reference in a panel after creating a reference via createSymbol(). The function is identical to the function addSymbol() but does not execute the initialize script.

Synopsis

int startSymbol(shape panel | (string moduleName, string panelName), string refName);

Parameter

Parameter Description
moduleName, panelName

Module and panel name of the target.

In order to add an object to a tab, the 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 a panel.

fileName File name under which the reference was saved.
refName Name of the reference. The name is unique in the system and can be used to address the reference, for example from a Control script.

Return value

Returns 0, in the event of a failure returns -1.

Errors

Missing arguments in the function.

Description

Starts a panel reference in a panel after a reference was added via createSymbol(). Starting means that the initialize script of the added reference is executed. The function createSymbol() adds a reference but does not show it. By using the function startSymbol(), you can display the reference and execute the init script.

The function startSymbol() is useful when the reference should be changed after it was loaded via createSymbol() before the init script is started. After the reference was loaded, object-oriented panels can be used to set parameters for the reference or a connection can be established to the user defined event of the reference from outside. Then the init script of the reference is started via startSymbol().

Example

Adds a reference including two graphics objects to a panel. The colors of the graphics objects are set in the reference via dollar parameters.

main()
{
  string col1 = "green";
  string col2 = "yellow";
  createSymbol(myModuleName(), myPanelName(), "Referenz1.pnl", "Ref1", makeDynString("$p1:"+col1, "$p2:"+col2), 445, 199, 0, 1, 1);
}

The function starts a reference and shows it.

main()
{
  startSymbol(myModuleName(), myPanelName(), "Ref1");
}

Sets the background colors of the graphics objects in the reference via dollar parameters.

main()
{
  ELLIPSE1.backCol($p1);
  ELLIPSE2.backCol($p2);
}

Assignment

Graphics function

Availability

UI