LAnnotation::SetAutoSnapCursor

#include "ltwrappr.h"

L_INT LAnnotation::SetAutoSnapCursor(bSnap)

L_BOOL bSnap;

/* value that indicates whether to restrict cursor location */

Sets the behavior of the cursor location when creating annotations using automation in design mode.

Parameter

Description

bSnap

Boolean value that indicates whether to restrict the cursor location during annotation creation in design mode. Possible values are:

 

Value

Meaning

 

TRUE

The cursor location will snap to on or within the annotation container.

 

FALSE

The cursor location is not restricted.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function sets the automation cursor behavior when clicking outside the container. It has no effect on the behavior of the cursor when clicking inside the container. When creating annotations using automation in design mode, the user first chooses an annotation tool. Next the user clicks the mouse in the window containing the image, either on or outside the container (annotation image).

If cursor snapping is enabled and the user clicks outside the container the cursor will "snap" to the container border as shown in this figure.

If cursor snapping is disabled and the user clicks outside the container but in the window, drawing of the annotation object begins with the annotation object outside of the container.

The default for behavior is to have cursor snapping enabled.

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

Win32, x64.

See Also

Functions:

LAnnotation::GetAutoSnapCursor, LAnnAutomation::GetAutoCursor, LAnnotation::SetUserData, LAnnotation::GetUserData, LAnnAutomation::SetAutoCursor, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::GetAutoBackColor, LAnnAutomation::GetAutoContainer, LAnnAutomation::GetAutoDialogFontSize, LAnnAutomation::IsAutoDrawEnabled, LAnnAutomation::IsAutoMenuEnabled, LAnnotation::GetAutoMenuItemEnable, LAnnotation::GetAutoMenuState, LAnnAutomation::GetAutoOptions, LAnnAutomation::GetAutoText, LAnnAutomation::GetAutoTextLen, LAnnAutomation::GetAutoUndoEnable, LAnnotation::SetAutoBackColor, LAnnAutomation::SetAutoContainer, LAnnotation::SetAutoDefaults, LAnnAutomation::SetAutoDialogFontSize, LAnnAutomation::SetAutoDrawEnabled, LAnnAutomation::SetAutoMenuEnabled, LAnnotation::SetAutoMenuItemEnable, LAnnotation::SetAutoMenuState, LAnnAutomation::SetAutoOptions, LAnnAutomation::SetAutoText, LAnnAutomation::SetAutoUndoEnable, LAnnotation::GetOptions, LAnnotation::SetOptions

Topics:

Displaying and Manipulating Annotation Objects

 

Annotation Functions: Getting and Setting Cursor Properties

 

Altering Annotation Object Settings

 

Key Annotation Features

Example

// The following example toggles the automation cursor snap state.

// The cursor snap state affects whether the cursor snaps to a container border

// when creating annotations by clicking outside the annotation container.

L_INT LAnnotation_SetAutoSnapCursorExample(LAnnAutomation& automate)
{
   L_INT nRet = FAILURE;
   L_BOOL bSnap = FALSE;
   L_TCHAR szMsg[200];
   nRet = automate.GetAutoSnapCursor(&bSnap);
   if (nRet != SUCCESS)
      return nRet;
   bSnap = !bSnap;
   nRet = automate.SetAutoSnapCursor(bSnap);
   if (nRet != SUCCESS)
      return nRet;
   wsprintf(szMsg, TEXT("Automation Snap Cursor State changed from %s to %s"),!bSnap ? TEXT("TRUE") : TEXT("FALSE"),
				bSnap ? TEXT("TRUE") : TEXT("FALSE"));
				MessageBox(NULL, szMsg, TEXT("Notice"), MB_OK);
   return SUCCESS;
}