SetPointer

Description

Sets the mouse pointer to the specified shape.

NoteWindows CE platforms The pointer is an arrow by default. If you set the pointer to an hourglass in a desktop application, the pointer reverts to an arrow after the script is run. On a Windows CE device, you must explicitly call SetPointer a second time to reset the pointer.

Syntax

SetPointer ( type )

Argument

Description

type

A value of the Pointer enumerated datatype indicating the type of pointer you want. Values are:

  • Arrow!

  • Cross!

  • Beam!

  • HourGlass!

  • SizeNS!

  • SizeNESW!

  • SizeWE!

  • SizeNWSE!

  • UpArrow!

Returns

Pointer. Returns the enumerated type of the pointer it replaced so the script can restore it, if necessary. If type is null, SetPointer returns null.

Usage

Use SetPointer to display an hourglass at the beginning of a script when the script will take a long time to execute. The pointer remains set until you change it again in the script or the script terminates.

NoteRestoring the arrow pointer The pointer automatically changes back to an arrow when the script finishes executing. You do not have to change it back to an arrow.

In PocketBuilder’s painters, you can specify the pointer shape that PocketBuilder displays when the user moves the pointer over a window, a control, or specific parts of a DataWindow object. The available shapes include the stock pointers listed above, as well as any custom cursor files you have.

Examples

Example 1

This statement sets the pointer to the hourglass shape:

SetPointer(HourGlass!)

Example 2

This example saves the old pointer and restores it when a long activity is completed:

pointer oldpointer // Declares a pointer variable

oldpointer = SetPointer(HourGlass!)

... // Performs some long activity

SetPointer(oldpointer)