Specifying Coordinates of Controls 

Default Coordinates are Relative to the Parent Control

The coordinates of controls on the screen are specified as their zero-based location in terms of row and column numbers. For example, the coordinates of a control at the leftmost column and first row of the screen is 0,0.

By default, the coordinates of a control on the screen are relative to the coordinates of the parent of the control, if the control has a parent.

For example, if the control is a label (static) inside a frame, the frame control is the parent of the static control. Its coordinates are expressed relative to the frame, regardless of where the frame is on the screen. The top-left corner of the frame is considered 0,0. If the static control is the first top-most and left-most control within the frame its coordinates are probably not 0,0, but rather, 1,1, because there is probably some space between the frame and the label.

If a control does not have parents, its coordinates are relative to the screen.

Note, however that some controls are invisible on the screen, yet they can act as parents to other controls. For example, a tab strip control is an invisible control that acts as the parent of the tabs and the page area. Since it is invisible, the tabs can start at the 0,0 coordinates relative to the tab strip control.

See the topic Control Hierarchy for an example arrangement of controls on the screen and their parent-child relationship. Also see the discussion of the control hierarchies within a tab strip control and within a table control.

Changing to Absolute Coordinates

You can use the SAPGUI_ABSOLUTE_COORD flag of the connection functions to specify that the coordinates should be expressed in absolute terms during the connection. This means that coordinates are always specified relative to the screen.

You can also use the SAPGUI_45A_COORD flag of the connection functions to specify that the coordinates should be expressed as a mixture of absolute and relative location, keeping the behavior of 4.5A GUI Library in this respect intact.

If you use these flags, they apply to all coordinate specifications during the connection.