GetModuleRefBox

Description:              Get Module Reference Box

Returns:                    Numeric

Usage:                       Script or Steady State

Purpose:                    This function returns the outer reference box for any selectable (GUI) graphics in a module.

Format:                      GetModuleRefBox(Module, Option)

Parameters:             Module     { Code value }  { required }  { no default }

                                              Any expression for the code value of the module.

                                    Option     { numeric }  { required }  { no default }

                                              Any expression that defines the return value as indicated by the following:

Option

Return Value

0

left side

1

bottom side

2

right side

3

top side

4

width

5

height

 

Comments:               A module's reference box defines an area that will exactly enclose all layered (GUI) graphics in the module regardless of state before any rotations and trajectories have been applied. A module reference box, or MRB as it is sometimes called, is not a clipping region and objects can and often will extend outside of their MRB as a result of applied rotations or trajectories.

                             When a module is transformed, the transform is based on the size of the module as determined by its reference box; the module's reference box will always exactly fill the reference box of the transform. In the case of graphics that have had a rotation or trajectory applied to them, the graphics will be transformed correctly, but the MRB may no longer contain the objects in their modified positions.

                             If a SetModuleRefBox has been done within the module in question, or its module reference box has been defined by following the module name with the four boundaries enclosed in parentheses, the return value will be based on these explicitly defined boundaries. Otherwise the return value will define the minimum reference box that will exactly enclose all (GUI) graphics in the module. This does not include any child graphics (i.e. graphics created by child modules of Module).

                             Module does not need to be running at the time that this statement is called in order to retrieve valid data.

Example:

If ! Valid(rightSide);

[

  rightSide = GetModuleRefBox(Self(), 2); 

]

Variable rightSide will contain the X-coordinate for the graphic object drawn by this module that is the furthest right in the window.

See Also:

GetXformRefBox | SetModuleRefBox