Skip to main content
Version: 9.0.2

gre.resize_control

gre.resize_control(
control_name,
dw,
dh,
w,
h,
[ah],
[av]
)

Resize a control. The control_name is the name of the control or a variable. Setting dw and or dh will resize the control by the specified delta from its current size. The dw and dh values can be 0 to set an absolute position using the w and h values only.

Optional anchors can allow for automatic adjustment of the control's x and y positions to keep the control anchored in the desired position as the control's size change:

Horizontal:

  • gre.LEFT anchor will not adjust the control's x position. This is the default behavior.

  • gre.CENTER anchor will adjust the control's x position by half the difference in control width.

  • gre.RIGHT anchor will adjust the control's x position by the difference in control width.

Vertical:

  • gre.TOP anchor will not adjust the control's y position. This is the default behavior.

  • gre.CENTER anchor will adjust the control's y position by half the difference in control height.

  • gre.BOTTOM anchor will adjust the control's y position the difference in 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 is gre.LEFT].
vh#numberThe vertical anchor, gre.TOP, gre.CENTER or gre.BOTTOM [Optional, default is gre.TOP].