Skip to main content
Version: 9.0.2

gre.move_control

gre.move_control(
control_name,
dx,
dy,
x,
y,
[ah],
[av]
)

Move a controls to a new position.  The control_name is the name of the control or a variable.  Setting dx and or dy will move the layer by the specified delta from its current position.  The  dx and dy values can be 0 to set an absolute position using the x and y values only.

Optional anchors allow for automatic adjustment of x and y values:

Horizontal:

  • gre.LEFT anchor will not adjust the input. This is the default behavior.

  • gre.CENTER anchor will adjust the x input by half the control width.

  • gre.RIGHT anchor will adjust the x input by the full control width.

Vertical:

  • gre.TOP anchor will not adjust the input. This is the default behavior.

  • gre.CENTER anchor will adjust the y input by half the control height.

  • gre.BOTTOM anchor will adjust the y input by the full control height.

Parameters

ParameterTypeDescription
control_name#stringThe model full path of the control to move
dx#numberA delta from the current x position or 0 to move using x
dy#numberA delta from the current y position or 0 to move using y
x#numberThe x position to move to in absolute co-ordinates (omit to use dx)
y#numberThe y position to move to in absolute co-ordinates (omit to use dy)
ah#numberThe horizontal anchor, gre.LEFT, gre.CENTER , or gre.RIGHT [Optional, default: gre.LEFT]
vh#numberThe vertical anchor, gre.TOP, gre.CENTER , or gre.BOTTOM [Optional, default: gre.TOP]