L_AnnSetAutoCursor

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnSetAutoCursor(hAutomation, uItem, hCursor)

HANNOBJECT hAutomation;

/* handle to an automation object */

L_UINT uItem;

/* value that specifies the cursor to be displayed */

HCURSOR hCursor;

/* handle to a windows cursor */

Sets one of the cursors associated with automated annotations.

This function is available in the Document and Medical Imaging toolkits.

Parameter

Description

hAutomation

Handle to the annotation automation object.

uItem

Value that specifies the cursor to be displayed on various actions. Possible values are:

 

Value

Meaning

 

ANNAUTOCURSOR_DEFAULT

[0] Displayed when cursor is over the annotation container, and other action is occuring. The default is the windows predefined cursor IDC_ARROW.

 

ANNAUTOCURSOR_DRAWNEW

[1] Displayed when drawing a new annotation (design mode). This is displayed on all tools except for ANNTOOL_SELECT.

 

ANNAUTOCURSOR_HANDLE

[2] Displayed in design mode, when cursor is over an annotation handle.

 

ANNAUTOCURSOR_HOTSPOT

[3] Displayed in run mode, when cursor over one of the following objects:

 

 

ANNOBJECT_BUTTON

 

 

ANNOBJECT_HOTSPOT

 

 

ANNOBJECT_FREEHANDHOTSPOT

 

 

ANNOBJECT_AUDIO

 

 

ANNOBJECT_VIDEO

 

 

ANNOBJECT_PUSHPIN

 

ANNAUTOCURSOR_MOVE

[4] Displayed in design mode, when an annotation is selected and the cursor is over the selected annotation (but not over the annotation handle).

 

ANNAUTOCURSOR_SELECT

[5] Displayed in design mode, when hovering over an unselected annotation. The default is the windows predefined cursor IDC_IBEAM.

 

ANNAUTOCURSOR_TEXT

[6] Displayed in design mode, when entering text into one of the following text annotations:

 

 

ANNOBJECT_TEXT

 

 

ANNOBJECT_TEXTPOINTER

 

 

ANNOBJECT_RTF

 

 

ANNOBJECT_NOTE

 

The default is the windows predefined cursor IDC_IBEAM.

 

ANNAUTOCURSOR_WAIT

[7] Displayed during the wait operation. The default is the hourglass.

 

ANNAUTOCURSOR_ROTATE_GRIPPER

[8] Displayed when hovering over a gripper rotate handle. The rotate handles are displayed only after calling L_AnnSetOptions.

 

ANNAUTOCURSOR_ROTATE_CENTER

[9] Displayed when hovering over rotate center handle. The rotate handles are displayed only after calling L_AnnSetOptions (hAutomation, OPTIONS_NEW_ROTATE).

 

The following cursors are displayed only after calling L_AnnSetOptions (hAutomation, OPTIONS_NEW_CURSORS).

 

ANNAUTOCURSOR_SIZENS

[10] Displayed when hovering over the north most or south most side select handles in a rectangular object. Note that the side select handles are only displayed after calling L_AnnSetOptions(hAutomation, OPTIONS_NEW_SIDE_HANDLES).

 

ANNAUTOCURSOR_SIZENESW

[11] Displayed when hovering over the North-east or South-west select handles in a rectangular object.

 

ANNAUTOCURSOR_SIZEWE

[12] Displayed when hovering over the west most or east most side select handles in a rectangular object. Note that the side select handles are only displayed after calling L_AnnSetOptions (hAutomation, OPTIONS_NEW_SIDE_HANDLES).

 

ANNAUTOCURSOR_SIZENWSE

[13] Displayed when hovering over the North-west or South-east select handles in a rectangular object.

 

ANNAUTOCURSOR_SELECT_OUTLINE

[14] Displayed when doing a drag type select in automation mode.

 

 

The following cursors are displayed when the corresponding tool is active. For example, when the PolyLine tool is active in automation mode, the ANNAUTOCURSOR_TOOL_POLYLINE_CURSOR will be shown.

 

ANNAUTOCURSOR_TOOL_LINE_CURSOR

[15] Displayed when the line tool is active.

 

ANNAUTOCURSOR_TOOL_RECT_CURSOR

[16] Displayed when the rectangle tool is active.

 

ANNAUTOCURSOR_TOOL_ELLIPSE_CURSOR

[17] Displayed when the ellipse tool is active.

 

ANNAUTOCURSOR_TOOL_POLYLINE_CURSOR

[18] Displayed when the polyline tool is active.

 

ANNAUTOCURSOR_TOOL_POLYGON_CURSOR

[19] Displayed when the polygon tool is active.

 

ANNAUTOCURSOR_TOOL_POINTER_CURSOR

[20] Displayed when the pointer is active.

 

ANNAUTOCURSOR_TOOL_FREEHAND_CURSOR

[21] Displayed when the free hand is active.

 

ANNAUTOCURSOR_TOOL_HILITE_CURSOR

[22] Displayed when the highlight is active.

 

ANNAUTOCURSOR_TOOL_REDACT_CURSOR

[23] Displayed when the redact tool is active.

 

ANNAUTOCURSOR_TOOL_TEXT_CURSOR

[24] Displayed when the text tool is active.

 

ANNAUTOCURSOR_TOOL_NOTE_CURSOR

[25] Displayed when the note tool is active.

 

ANNAUTOCURSOR_TOOL_STAMP_CURSOR

[26] Displayed when the stamp tool is active.

 

ANNAUTOCURSOR_TOOL_BUTTON_CURSOR

[27] Displayed when the button tool is active.

 

ANNAUTOCURSOR_TOOL_HOTSPOT_CURSOR

[28] Displayed when the hotspot tool is active.

 

ANNAUTOCURSOR_TOOL_AUDIO_CURSOR

[29] Displayed when the audio tool is active.

 

ANNAUTOCURSOR_TOOL_RULER_CURSOR

[30] Displayed when the ruler tool is active.

 

ANNAUTOCURSOR_TOOL_CROSSPRODUCT_CURSOR

[31] Displayed when the cross product tool is active.

 

ANNAUTOCURSOR_TOOL_POINT_CURSOR

[32] Displayed when the point tool is active.

 

ANNAUTOCURSOR_TOOL_PROTRACTOR_CURSOR

[33] Displayed when the protractor tool is active.

 

ANNAUTOCURSOR_TOOL_VIDEO_CURSOR

[34] Displayed when the video tool is active.

 

ANNAUTOCURSOR_TOOL_PUSHPIN_CURSOR

[35] Displayed when the pushpin tool is active.

 

ANNAUTOCURSOR_TOOL_FREEHANDHOTSPOT_CURSOR

[36] Displayed when the freehand hotspot tool is active.

 

ANNAUTOCURSOR_TOOL_CURVE_CURSOR

[37] Displayed when the curve tool is active.

 

ANNAUTOCURSOR_TOOL_CURVECLOSED_CURSOR

[38] Displayed when the closed curve tool is active.

 

ANNAUTOCURSOR_TOOL_ENCRYPT_CURSOR

[39] Displayed when the encrypt tool is active.

 

ANNAUTOCURSOR_TOOL_TEXTPOINTER_CURSOR

[40] Displayed when the text pointer tool is active.

 

ANNAUTOCURSOR_TOOL_POLYRULER_CURSOR

[41] Displayed when the polyruler tool is active.

 

ANNAUTOCURSOR_TOOL_RTF_CURSOR

[42] Displayed when the RTF tool is active.

 

ANNAUTOCURSOR_TOOL_RUBBERSTAMP_CURSOR

[43] Displayed when the rubber stamp tool is active.

hCursor

Handle to the cursor that will be displayed.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

If hAutomation is NULL, the annotation cursors are changed for all the automation objects that will be created from this point on. It also changes the cursors for the automation objects that have not had their cursors changed (still using defaults).

If hAutomation is not NULL, the hCursor is changed only for the specified automation object. Some programs create a new automation object each time a file is opened. This is especially true for MDI applications. In this case, the hCursor is set only for the current file. If you want this hCursor to be set for all files, you must set the hCursor each time you create a new automation object, or call L_AnnSetAutoCursor with hObject set to NULL.

Internally, a copy is made of hCursor, so the hCursor can be destroyed after calling this fuction.

To retrieve a copy of an annotation cursor, call L_AnnGetAutoCursor.

Required DLLs and Libraries

LTANN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 2000 / XP/Vista.

See Also

Functions:

L_AnnGetAutoCursor, L_AnnSetUserData, L_AnnGetUserData, L_AnnSetAutoHilightPen, L_AnnSetOptions, L_AnnGetOptions, L_AnnSetAutoSnapCursor, L_AnnGetAutoSnapCursor

Topics:

Annotation Objects - Automated Features

 

Implementing an Automated Annotation Program

 

Altering Annotation Object Settings

 

Annotation Functions: Implementing Annotations

 

Annotation Functions: Displaying and Manipulating Annotation Objects

 

Color Halftone and Halftone Images

 

Annotation Features

Example

This sample changes the annotation cursors for the automation object hAutomation.

 L_INT AnnSetAutoCursorExample(HANNOBJECT hAutomation)
{
   L_INT nRet;
   HCURSOR hCursorDefault;
   HCURSOR hCursorDrawNew;
   HCURSOR hCursorHandle;
   HCURSOR hCursorHotspot;
   HCURSOR hCursorMove;
   HCURSOR hCursorSelect;
   HCURSOR hCursorText;

   // Load cursors
   hCursorDefault = LoadCursorFromFile(TEXT("%UserProfile%\\My Documents\\LEADTOOLS Images\\cursors\\MyArrow.cur"));
   hCursorDrawNew = LoadCursorFromFile(TEXT("%UserProfile%\\My Documents\\LEADTOOLS Images\\cursors\\MyCross.cur"));
   hCursorHandle  = LoadCursorFromFile(TEXT("%UserProfile%\\My Documents\\LEADTOOLS Images\\cursors\\MyHandle.cur"));
   hCursorHotspot = LoadCursorFromFile(TEXT("%UserProfile%\\My Documents\\LEADTOOLS Images\\cursors\\MyHotspot.cur"));
   hCursorMove    = LoadCursorFromFile(TEXT("%UserProfile%\\My Documents\\LEADTOOLS Images\\cursors\\MyMove.cur"));
   hCursorSelect  = LoadCursorFromFile(TEXT("%UserProfile%\\My Documents\\LEADTOOLS Images\\cursors\\MySelect.cur"));
   hCursorText    = LoadCursorFromFile(TEXT("%UserProfile%\\My Documents\\LEADTOOLS Images\\cursors\\MyIBeam.cur"));

   nRet = L_AnnSetAutoCursor(hAutomation, ANNAUTOCURSOR_DEFAULT, hCursorDefault);
   if(nRet != SUCCESS)
      return nRet;
   nRet = L_AnnSetAutoCursor(hAutomation, ANNAUTOCURSOR_DRAWNEW, hCursorDrawNew);
   if(nRet != SUCCESS)
      return nRet;
   nRet = L_AnnSetAutoCursor(hAutomation, ANNAUTOCURSOR_HANDLE , hCursorHandle);
   if(nRet != SUCCESS)
      return nRet;
   nRet = L_AnnSetAutoCursor(hAutomation, ANNAUTOCURSOR_HOTSPOT, hCursorHotspot);
   if(nRet != SUCCESS)
      return nRet;

   nRet = L_AnnSetAutoCursor(hAutomation, ANNAUTOCURSOR_MOVE  , hCursorMove);
   if(nRet != SUCCESS)
      return nRet;
   nRet = L_AnnSetAutoCursor(hAutomation, ANNAUTOCURSOR_SELECT, hCursorSelect);
   if(nRet != SUCCESS)
      return nRet;
   nRet = L_AnnSetAutoCursor(hAutomation, ANNAUTOCURSOR_TEXT  , hCursorText);
   if(nRet != SUCCESS)
      return nRet;
   return SUCCESS;
}