reposition

Moves a component to an absolute position, defined as an X - Y pixel position.

Alternatively, you can specify a component’s position by percentage of the container’s width and height. For more information, see repositionByPercent on page 174.

Syntax

ogscript.reposition (ID, x position, y position);

Parameters

Parameter

Type

Required

Description

ID

String

Yes

ID of the component you want to reposition

x position

Integer

Yes

Number of pixels from the left

y position

Integer

Yes

Number of pixels from the right

Returns

N/A

Example

In this example, the task associated with the “Top Left” button uses the ogscript.reposition function to reposition a label.

<labelheight="40" id="myLabel" left="160" name="myLabel" style="txt-align:center" top="100" width="160"/>

<buttonbuttontype="push" height="40" left="160" name="Top Left"top="200" width="160">

<task tasktype="ogscript">ogscript.reposition('myLabel', 0, 0);

</task>

</button>