addShape()
Adds a new shape into a panel.
Synopsis
shape addShape(shape panel, int layer, string shapeType, string
shapeName);
shape addShape(string moduleName, string panelName, int layer, string
shapeType, string shapeName);
Parameter
| Parameter | Description |
|---|---|
| panel | Panel as shape object to which the shape should be added. |
| layer | Layer in which the shape should be added. |
| shapeType | Type of the shape, see "shapeType" |
| shapeName | Name of the shape. |
| moduleName | Name of the module in which the shape should be added. |
| panelName | Name of the panel in which the shape should be added. |
Return Value
The function returns a pointer to the newly created shape.
In case of an error a 0 shape is returned.
Errors
Missing arguments in the function, unknown module or panel, illegal layer, unknown shapeType.
Description
Adds a new shape instance into the given panel. The panel can either be addressed by a "shape" pointer, e.g.
shape panel = getShape("Module.Panel:");
or via moduleName/panelName as string.
The returned shape can be used to directly set additional values into the shape.
-
Active-X shapes on Windows can currently not be added via addShape()
-
The given shapeName is currently not checked for duplicate name entries in the addressed panel.
-
After adding the object it has no defined size. It is recommended to set it directly using the property "points". When dynamically creating shapes via addShape(), it is also recommended to explicitly set "refPoint", as it is not initialized automatically and may otherwise lead to invalid coordinates.
Assignment
Graphics function
Availability
UI, CTRL
