LAnnAutomation::SetAutoCursor
#include "ltwrappr.h"
virtual L_INT LAnnAutomation::SetAutoCursor(uItem, hCursor)
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/Medical Toolkits.
Parameter |
Description |
|
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 gripper rotate handle. |
|
ANNAUTOCURSOR_ROTATE_CENTER |
[9] Displayed when hovering over rotate center handle. |
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 the used object is not Created, 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 the used object is Created, 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 LAnnAutomation::SetAutoCursor 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 LAnnAutomation::GetAutoCursor.
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. |
See Also
Example
// This sample changes the annotation cursors for the automation object hAutomation
L_VOID SampleAnnSetCursors(LAnnAutomation *plAutomation)
{
HCURSOR hCursorDefault;
HCURSOR hCursorDrawNew;
HCURSOR hCursorHandle;
HCURSOR hCursorHotspot;
HCURSOR hCursorMove;
HCURSOR hCursorSelect;
HCURSOR hCursorText;
// Load cursors
hCursorDefault = LoadCursorFromFile( TEXT("E:\\Images\\cursors\\MyArrow.cur"));
hCursorDrawNew = LoadCursorFromFile(TEXT("E:\\Images\\cursors\\MyCross.cur"));
hCursorHandle = LoadCursorFromFile(TEXT("E:\\Images\\cursors\\MyHandle.cur"));
hCursorHotspot = LoadCursorFromFile(TEXT("E:\\Images\\cursors\\MyHotspot.cur"));
hCursorMove = LoadCursorFromFile(TEXT("E:\\Images\\cursors\\MyMove.cur"));
hCursorSelect = LoadCursorFromFile(TEXT("E:\\Images\\cursors\\MySelect.cur"));
hCursorText = LoadCursorFromFile(TEXT("E:\\Images\\cursors\\MyIBeam.cur"));
plAutomation->SetAutoCursor(ANNAUTOCURSOR_DEFAULT, hCursorDefault);
plAutomation->SetAutoCursor(ANNAUTOCURSOR_DRAWNEW, hCursorDrawNew);
plAutomation->SetAutoCursor(ANNAUTOCURSOR_HANDLE, hCursorHandle);
plAutomation->SetAutoCursor(ANNAUTOCURSOR_HOTSPOT, hCursorHotspot);
plAutomation->SetAutoCursor(ANNAUTOCURSOR_MOVE, hCursorMove);
plAutomation->SetAutoCursor(ANNAUTOCURSOR_SELECT, hCursorSelect);
plAutomation->SetAutoCursor(ANNAUTOCURSOR_TEXT, hCursorText);
}