Pick

(Engine-Level Function)

Description: Returns an indication of whether the locator (e.g. mouse) has had a specified change in its button status.
Returns: Numeric
Usage: Steady State only.
Function Groups: Graphics,  Locator
Related to: Click | LocSwitch | SetXLoc | SetYLoc | Target | WinLocSwitch | WinXLoc | WinYLoc | XLoc| YLoc | GUITransform
Format: Pick(X1, Y1, X2, Y2, Button)
Parameters:  
X1
Required. Any numeric expression giving the X coordinate on the screen of one side of the screen area ("target").
Y1
Required. Any numeric expression giving the Y coordinate on the screen of either the top or bottom of the screen area ("target").
X2
Required. Any numeric expression giving the X coordinate on the screen of the side of the "target" opposite to X1.
Y2
Required. Any numeric expression giving the Y coordinate on the screen of either the top or bottom of the target, whichever is the opposite of Y1.
Button
Required. Any numeric expression giving the button combination that activates this graphic when the locator cursor is within the "target" screen area.

Button

Button Locator

0

No buttons

1

Right button

2

Middle button

3

Right and middle buttons

4

Left button

5

Left and right buttons

6

Left and middle buttons

7

All three buttons

  

If the value is:

- multiplied by 8 the meaning for multiple buttons pressed becomes "OR" rather than "AND." For example, to accept any button on a 2 or 3 button mouse, use 56 (8 * 7). To accept the left mouse button regardless of whether the right button is pressed, use 32 (8 * 4)

- increased by 64, the function will become true when the mouse buttons are released rather than when they are pressed

- increased by 128, the button(s) must be double-clicked

- increased by 256, forces the control with the input focus (in the same window as the Pick) to simulate the Enter key being pressed prior to the Pick function returning a value of true. In other words, with code similar to:

   If Pick(X1, Y1, X2, Y2, 0X104);
   [
    …script statements…
   ]

any value affected by the control with input focus will be set to the current value of the control prior to the script statements being run.

- increased by 512, horizontal panning is disabled over the region.

- increased by 1024, vertical panning is disabled over the region.

These last two options, 512 and 1024, allow Pick, WinLocSwitch and other events to be handled by a region within the window - for example a map within a Sites page when viewed using the VTScada Anywhere Client. These should be used only by advanced users.

Comments:

This function returns true if the locator button combination changes as specified by the Button parameter while the locator position is within the boundaries of the "target" ((X1,Y1) - (X2,Y2)). This function is "edge triggered" which means that it only acts upon the changes in locator button status. Making the button combination specified by the Button parameter outside the target area and then sliding the cursor into the target will not cause the function to return true. If the locator is not installed, the function will return false (0).
This function is very useful for capturing fast mouse button presses by the operator. VTScada remembers the locations where the mouse buttons were pressed and released. The actual buttons do not have to be pressed when the Pick is actually executed since it will examine the list of all button changes since the last time it was executed.
This function is latched on after it becomes true. Use Click() for steady state feedback rather than Pick().

Note: This function is disabled when using a GUITransform as a GUIStrectch.

Example:

If Pick(300, 500, 600, 700, 56) MixerScreen;

This action will switch to the MixerScreen state when the mouse is inside the target box and any mouse button is pressed.

Latching and Resetting Functions