CursorFn Script Function Library

Posted on 524 views

The CursorFn Script Function Library contains a set of functions that allow the user to:

Hide the cursor
Show the cursor
Set the cursor position
Get cursor position
Clip cursor to some rectangular area on screen
Restore the cursor from rectangular Clip area

Note— The CursorFn Script Function Library is supported for InTouch 7.1 or later.

Installing the CursorFn Script Function Library

 Download the CursorFn.zip file .

Unzip the file that you downloaded and move the files CursorFn.dll, CursorFN.wdf and CursorFn.hlp to your InTouch directory.  When you restart your application, the script functions should be listed alongside of the other InTouch script functions.

The individual script functions are described below.

Descriptions

Hide_Cursor

Hide_Cursor( );

Hides the cursor in WindowViewer.

Return value: This is of integer type and returns -1 when cursor is not visible (hidden).

Input / Output Parameters: None.

Example:

Intval=Hide_Cursor():

Where Intval is of Integer type.

Show_Cursor

Show_Cursor( );

Shows the cursor in WindowViewer.

Return value: This is of integer type and returns 0 when cursor is shown.

Input / Output Parameters: None.

Example:

Intval=Show_Cursor();

Where Intval is of Integer type.

SetCursorPosition

SetCursorPosition(XPosition, YPosition, UseDesktop);

SetCursorPosition allows the cursor position to be changed at runtime.

Return value: If the script function is successful, a zero will be returned.  Otherwise a -1 will be returned.  See WWLogger for more information if a -1 is returned.

Input / Output Parameters:

XPosition: Input Parameter. Set to desired X coordinate on desktop screen (or WindowViewer client screen, see UseDesktop). This can be Integer Tag or an integer value.

YPosition: Input Parameter. Set to desired Y coordinate on desktop screen (or WindowViewer client screen, see UseDesktop). This can be Integer Tag or an integer value.

UseDesktop: Input Parameter. An Integer value of one (1) to use the windows desktop upper left hand corner as the reference for the X and Y coordinates. An integer value of (0) can be used to use the upper left hand corner of the WindowViewer client area as the reference for the coordinates.

Example:

1. Intval=SetCursorPosition(XPos,YPos,0);

2. Intval=SetCursorPosition(100,150,0);

Where Intval is of Integer type. XPos and YPos are Tags of Integer type.

GetCursorPosition

GetCursorPosition(“Xtag”, “Ytag”, UseDesktop);

GetCursorPosition allows the user to get current cursor position.  The X-coordinate is stored in XTag and Y-coordinate in the Ytag.

Return value: If the script function is successful, a zero will be returned.  Otherwise a -1 will be returned.  See WWLogger for more information if a -1 is returned.

Input / Output Parameters:

XTag: Input Parameter.  A string which contains the name of an INTEGER tag to receive the value of X-coordinate on desktop screen (or WindowViewer client screen, see UseDesktop).

YTag: Input Parameter. A string which contains the name of an INTEGER tag to receive the value of Y-coordinate on desktop screen (or WindowViewer client screen, see UseDesktop).

UseDesktop: Input Parameter. An Integer value of one (1) to use the windows desktop upper left hand corner as the reference for the X and Y coordinates. An integer value of (0) can be used to use the upper left hand corner of the WindowViewer client area as the reference for the coordinates.

Example:

1. Intval=GetCursorPosition(“Xtag”,”Ytag”,0);

Where Intval is of Integer type.

Clip_Cursor

Clip_Cursor (Left, Top, Right, Bottom, UseDesktop);

Clips the cursor to the given Window Coordinates on desktop screen (or WindowViewer client screen).

Return value: If the script function is successful, a zero will be returned.  Otherwise a -1 will be returned.  See WWLogger for more information if a -1 is returned.

Input / Output Parameters:

Left – Set to desired X coordinate on desktop screen (or WindowViewer client screen, see UseDesktop). This can be Integer Tag or an integer value.

Top – Set to desired Y coordinate on desktop screen (or WindowViewer client screen, see UseDesktop). This can be Integer Tag or an integer value.

Right – Set to desired X coordinate on desktop screen (or WindowViewer client screen, see UseDesktop). This can be Integer Tag or an integer value.

Bottom – Set to desired Y coordinate on desktop screen (or WindowViewer client screen, see UseDesktop). This can be Integer Tag or an integer value.

UseDesktop – An Integer value of one (1) to use the windows desktop upper left hand corner as the reference for the coordinates returned. An integer value of (0) can be used to use the upper left hand corner of the WindowViewer client area as the reference for the coordinates returned.

Example:

1. Intval=Clip_cursor(210,240,540,470,0);

2. Intval=Clip_cursor(LeftTag, TopTag, RightTag, BottomTag, 0);

Where Intval is of Integer type.  LeftTag, TopTag, RightTag and BottomTag are InTouch tags of Integer type.

Restore_Clip

Restore_clip();

Restores the cursor from clip.

Return value: If the script function is successful, a zero will be returned.  Otherwise a -1 will be returned.  See WWLogger for more information if a -1 is returned.

Input / Output Parameters: None.

Example:

1. Intval=Restore_clip();

Where Intval is of Integer type.

Leave a Reply

Your email address will not be published. Required fields are marked *

7 + 2 =