The default action when an object is selected for placement on your system page is to draw an image of the object that tracks the mouse and is located on the system page where the first mouse click is made. In some instances, this is not the best way to draw an object on a page. For example, a pipe drawing object might require several mouse clicks to locate the pipe on the screen. To accommodate this requirement, you can specify a module called "PlaceObject" in the root of the tag template module. If this module is present, and a variable called "PlaceObject" is defined within the drawing module, it is called in lieu of the default object placement function. Its parameters are:
SelDAG – The state where the object is to be placed. This value is a pointer to the value that must be set by "PlaceObject". "PlaceObject" typically determines the destination of the graphic item by calling \FindEditModule(CurrentWindow()) in a script whenever the CurrentWindow changes. This subroutine searches the scope of the current window (the VTS window on which the mouse is located), and returns the topmost module in that window that can be edited. To be eligible for editing, the module must have a .VTS file that is not out of sync with the currently loaded module, and the .VTS file must not have the read-only attribute set.
X1 – Any numeric expression giving the X coordinate of one side of the object on the screen (either left or right).
Y1 – Any numeric expression giving the Y coordinate of either the top or bottom of the object on the screen.
X2 – Any numeric expression giving the X coordinate of the side of the bar opposite to X1 on the screen (either left or right).
Y2 – Any numeric expression giving the Y coordinate of either the top or bottom of the object on the screen, whichever is the opposite to Y1.
Parms – A returned array of text parameters from Configure.
There is occasionally a need to place an object on the page without requiring any placement. This could be true for a full screen background bitmap, or a status bar that is always located on the bottom of the page. to do this, create a variable called, "NoPlace" in the root of the drawing module, and give it a default value of "1". In this situation, you must also define variable with the names, "Top", "Left", "Right", and "Bottom" that have the location of the object on the screen as their default values.
The VTS\AddObj.VTS file contains the default "PlaceObject" module, and is instructive to examine if you intend to write your own placement code.
Additional References
Additional information on related subjects is available in this guide. Please see:
• RPC Manager (see RPC Manager ").
• Adapting a Driver for VTS (see Communication Drivers).
• Alarm Manager (see Alarm Manager Service: ").