Functions | |
void | Get_Location (float *x, float *y) |
void Get_Location | ( | float * | x, | |
float * | y | |||
) |
Performs all the work needed to have the user indicate a raw 2-D position. Returns the position to your program.
x | - The 2-D location indicated by the user. The lower-left extreme of the locater device returned as (-1.0, -1.0); the upper-right as (+1.0, +1.0). Passed by reference always. Returned to caller. | |
y | - |
Use Get_Location() when you're only interested in raw position information. Use Get_Selection() when you're interested in that raw position as it relates to your picture.
In pseudo-C, Get_Location() corresponds to the following:
Enable_Location_Events("?locater", "?Picture","v*^") do Await_Event (&type) until (strcmp (type, "location") == 0) Disable_Location_Events("?locater", "?Picture","v*^") Show_Location (&x, &y)
The "x" and "y" are returned to the original caller. Show_Location_Source() can then be called to gain extra information about the location event.
Get_Location() does not verify that the location event received matches the type of location event enabled.
Get_Location() and Show_Location() both return the same information to your program. Get_Location() is a high-level routine that does a variety of work. Show_Location() is a low-level routine whose only function is to extract one existing piece of information from the database.
The "Disable Event" at the end of Get_Location() gets propagated out the device at the next call to Await_Event() or Check_For_Events() .