Please enable JavaScript to view this site.

ESL Documentation

You can change the position of a key or the position of the viewport of a graphical, image, or textual region by specifying a change position by statement or a change position to statement. You can also specify these statements to change the position of all of the objects in a class.

 

Remember that the position of each of these objects is specified in the coordinate system of its parent, which may be the screen itself.

 

The change position by statement describes the offsets from the object's current position to its new position. For example, if you have defined the following objects:

 

graphical region Figure size 400 300 at position 0 0

 

key Square at position 100 100 in Figure

    box 50 50

 

and then change Square's position as follows:

 

change Square position by 50 100

 

Square's new position will be coordinate position 150 200 in Figure.

 

The change position to statement describes the absolute position of the object, in its current parent or in a new parent, regardless of the object's current position. In the following example, Square is moved to position 110 120 in Figure.

 

change Square position to 110 120

 

If you have defined the following objects:

 

graphical region Menu1 size 100 100 at position 20 40

 

key Button1 at position 70 20 in Menu1

    text "Button #1"

 

and then specify:

 

change Button1 in Menu1 position by -50 0

 

Button1, a key in Menu1, is located at position 70 20 within Menu1's viewport. When you change the location of Button1 by -50 0, Button1 is moved to the left by 50 positions and remains stationary in the Y direction. After the change position by statement has been executed, Button1 will be located at position 20 20 within Menu1's viewport.