Conversion Methods

The following methods are used to convert and map coordinates of a dialog or dialog control.

LogRect2AbsRect

>>-aDialogControl~LogRect2AbsRect(--left--,--top--,--right--,--bottom--)-><


The LogRect2AbsRect method converts the coordinates from dialog units to screen pixels.

Arguments:

The arguments are:

left,top

The position of the upper left corner, in dialog units.

right,bottom

The position of the lower right corner, in dialog units.

Return value:

A compound variable that stores the four screen pixel coordinates. The position of the upper left corner is stored in RetStem.left and RetStem.top. The position of the lower right corner is stored in RetStem.right and RetStem.bottom. The tails left, top, right, and bottom must be uninitialized symbols.

Example:

absrect. = MyDialog~LogRect2AbsRect(5, 5, 10, 10)
say "Screen pixel rectangle=" absrect.left "," absrect.top ",",
absrect.right "," absrect.bottom

AbsRect2LogRect

>>-aDialogControl~AbsRect2LogRect(--left--,--top--,--right--,--bottom--)-><


The AbsRect2LogRect method converts the coordinates from screen pixels to dialog units.

Arguments:

The arguments are:

left,top

The position of the upper left corner, in screen pixels.

right,bottom

The position of the lower right corner, in screen pixels.

Return value:

A compound variable that stores the four screen dialog units. The position of the upper left corner is stored in RetStem.left and RetStem.top. The position of the lower right corner is stored in RetStem.right and RetStem.bottom. The tails left, top, right, and bottom must be uninitialized symbols.

Example:

rectdunit. = MyDialog~AbsRect2LogRect(20, 20, 40, 40)
say "Dialog unit rectangle=" rectdunit.left "," rectdunit.top ",",
rectdunit.right "," rectdunit.bottom

ScreenToClient

>>-aDialogControl~ScreenToClient(--x--,y--)--------------------><


The ScreenToClient method maps the coordinates relative to the upper left corner of the screen, to a location within the client area relative to the upper left corner of the dialog's client area.

Arguments:

The arguments are:

x

The horizontal position, in screen pixels.

y

The vertical position, in screen pixels.

Return value:

The horizontal and vertical positions of the specified location relative to the upper left corner of the client area, separated by a blank.

ClientToScreen

>>-aDialogControl~ClientToScreen(--x--,y--)--------------------><


The ClientToScreen method maps the coordinates relative to the dialog's client area to the coordinates relative to the upper left corner of the screen.

Arguments:

The arguments are:

x

The horizontal position in screen pixels.

y

The vertical position in screen pixels.

Return value:

The horizontal and vertical positions of the specified location relative to the location (0,0) of the screen, separated by a blank.