Access shapes in other panels and modules

Graphics objects can be accessed not only in the local panel but also in other modules or panels from the same UI manager.

Example

In the following example, the panel "PanelEllipse.pnl" opens in the module "ModuleEllipse" and the color of the shape "MyEllipse" will be set using another panel (see the second example).

main()
{
  ModuleOnWithPanel("ModuleEllipse", 50, 50, 70, 70, 2, 2, "None",
  "PanelEllipse","PanelEllipse", makeDynString());
}

The following setValue() functions set the background and foreground colors for the graphics object "MyEllipse"in a panel called "PanelEllipse" (the name of the panel in the property sheet is "Ellipse" and the file name of the panel is also "PanelEllipse").

The syntax of the setValue() function is:

setValue("moduleName.panelName:shapeName","property","value");

The first parameter of the function setValue() is the name of the shape. The second the graphic's attribute (property) and the third parameter is a valid value.

If you want to access shapes in other panels and modules, do not use points or colons in the panel names.

main()
{
  setValue("ModuleEllipse.PanelEllipse:MyEllipse","foreCol","Red");
  setValue("ModuleEllipse.PanelEllipse:MyEllipse","backCol","Black");
}

The following example shows how to acces panels inside the actual panel without the need of manually stating the name of the panel inside the function call. The usage of myModulName() as well as myPanelName() is the best way to reference to already initialized objects.

main()
{
  setValue( myModuleName() + "." + myPanelName() +
  ":PANEL_REF1.DPname", "text", myDPE);
}