This function is used to address graphics objects and set attributes. It is similar to getShape(), but uses a different search method.


shape getShapeStrict(string objectName);

shape getShapeStrict(string moduleName, string panelName, string objectName);

shape getShapeStrict(shape panel, string objectName);


Parameters Description
shape Graphics object
objectName Name of the graphics object
moduleName Name of the module
panelName Name of the panel

Return value

The function returns the graphics object or shape. If no object or shape is found, a "0"-shape is returned. This behavior differs from getShape(), which would return an error.


Missing arguments, incorrect function name


Using this function, graphics objects can be called in accordance with the dot convention. This defines a shape variable.

  • An objectName has the same addressing convention as before:

    Module.Panel: to addresses the panel itself

    [Module.Panel:]Object to address an object in the panel

    [Module.Panel:]Ref.Ref.Object to address an object in a reference

  • The ":"-character is only allowed to separate the "Module.Panel:" from the rest.

  • The "Module.Panel:" part must contain a ".",meaning that both parts, Module and Panel, must be given.

    E.g. "Something:" is not allowed, also not as an object name alone.

  • Module/Panel/Object names themselves must not contain the "." character, this is only allowed to separate the references and the object.

  • Should the objectName argument contain the "Module.Panel:" part, this takes precedence over the given "(moduleName, panelName)" or "(panel)" arguments within the last 2 function interfaces.

  • If an explicit panel was given, the meaning is to start from the root of this panel (using absolute addressing). Therefore not looking into my own or other PanelRefs.

    If no explicit panel was given and the current context is inside a PanelRef, start searching inside this PanelRef (relative addressing)

  • The search is done only inside the given panel (or if no panel is given, then the panel from the context of the current script), e.g. specifically NOT inside panels of Tab widgets inside this panel. Searching for objects inside such panels is done by first getting a pointer to the panel e.g.:

  • Addressing of objects inside Panels or PanelRefs which are OO-oriented (meaning they have one of: public functions, events, user-defined properties) is NOT allowed from outside. This would circumvent the object oriented approach since objects inside these are private. Use public functions instead.

  • Addressing of Shapes inside ShapeGroups or LayoutGroups (explicity not Refs) is not allowed. ShapeGroups are mainly a graphical grouping and the shapes inside can still be addressed separately.

  • ShapeGroups alone can be addressed, e.g. ref1.SHAPE_GROUP1 (only if ref1 is not an OO-ref). This is to allow the use of the attributes a ShapeGroup provides.

  • Looking for "object" in a panel will no longer find the "object" if it is inside a PanelRef or in a Tab widget's panel.

  • The strict algorithm will only search downwards in a hierarchy (e.g. the legacy search could find a shape on the root panel when the search started from a script inside a PanelRef)

  • With the legacy behavior, searching from the init script of a PanelRef could not find a shape inside the ref when there was no single shape in this ref (but only a subref). Instead a shape in the root panel or in a tab widget panel could be found.

  • Absolute addressing via Module.Panel: was not always used correctly and could still find a shape inside a ref (when started from a ref shape), and was inconsitent with when looking for a group

  • Addressing ShapeGroups did not work correctly - e.g. found groups in panel from tab shape instead of the context PanelRef.

The new "strict mode" used with this function necessitates some rules for addressing shapes.

shape panel = tabShape.panelAt(tabNumber);
shape object = getShapeStrict(panel, shapeName);

Differences between the new "strict mode" and the legacy behavior:




See also

getShape(), shapeExists(), setValue(), getValue(), getShapes()