2.3 cursor

The graphic cursors you want to use have to be defined before. The keyword is cursor, followed by the cursor identifier and the cursor definition.

Definition

{ export | reexport } cursor <Identifier> <cursorSpec> | <variantDef>
cursorSpec ::= <cursorBitmap> | "<predefined cursor>" ;
cursorBitmap ::= <x>, <y>,
                 <cursorString>
             [ , <cursorString> ]
variantDef ::=
{
           0 : <cursorSpec>
  [ <number> : <cursorSpec> ]
}

Example

Non-variant

cursor MyCursor "XC_cross";

Variant

cursor MyCursor
{
  0: "XC_cross";
  1: "Cross";
}

2.3.1 Bitmap-Cursor

<x> and <y> identify – as in tiles – the corresponding extensions (in pixels) on the x- and y-axes.

The IDM allows any widths (<x>) and heights (<y>) for the cursors. Some graphics systems have a cursor size of 32 * 32 pixels (e.g. MS-Windows). Other graphics systems, however, limit the cursor size to 16 * 16 pixels (e.g. Motif).

<cursorString> identifies a character string which consists of exactly <x> characters. You should specify exactly <y> strings with <x> characters each.

Permitted characters in <cursorString> are point (.), space ( ), plus (+), hash (#), and the uppercase letter X. The individual characters mean the following:

.
  (space)

The cursor will adopt the background color, i.e. the cursor will be transparent at this point.

+

At this point the cursor will be displayed in the inverse background color. This is important if the cursor foreground color is identical with the background color.

#

At this point the cursor will be displayed in the foreground color which is defined by the window system.

X

This character marks the hotspot of the cursor. If you click on an object with the cursor, the hotspot has to touch the object, otherwise the clicking will not be registered. This character has to occur only once in the cursor definition.

Example

cursor Pointer 16, 16,
  "........+.......",
  ".......+++......",
  "......++X++.....",
  ".....++###++....",
  "....++#####++...",
  "...++#######++..",
  "..++#########++.",
  "..+++++###+++++.",
  ".....++###++....",
  ".....++###++....",
  ".....++###++....",
  ".....++###++....",
  ".....++###++....",
  ".....++###++....",
  ".....++###++....",
  ".....+++++++....";

Note for the IDM for Windows

Cursor means mouse pointer, regardless of the different meaning that cursor has in Microsoft Windows.

The cursor size in Microsoft Windows is 32 x 32 (with EGA or VGA resolution). No other size is allowed! If the cursor exceeds the permitted size, the DM converts the cursor by filling the cursor with transparents or by clipping the right and the bottom border.

2.3.2 Predefined Cursor

A list of the predefined cursors available on the respective system can be requested via the attribute .cursorname[integer] on the setup object.

2.3.2.1 Independent UI-Cursor

The UI cursor resources are WSI-independent predefined cursors that are available on all systems with similar characteristics or meaning. The default cursors used by the current desktop/window manager or theme are used for this purpose. The uniform CURSOR resources are defined as follows:

2.3.2.2 Motif

When the cursor is defined with a name, the corresponding X Cursor is loaded from the X Windows cursor fonts:

Example

cursor Clockcursor "XC_clock";

2.3.2.3 Qt

There are the following named cursors where the corresponding Qt CursorShape is loaded:

The appearance of the cursors may vary depending on the UI style.

2.3.2.4 Microsoft Windows

When the cursor is defined with a name, the corresponding cursor is taken from the Microsoft Windows objects.

The following cursors are predefined system cursors on Microsoft Windows:

Notes