LAnnPoint::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPoint::AddUserHandle(pAnnHandle)

pANNHANDLE pAnnHandle;

/* pointer to a structure that defines the user handle */

Adds a user-defined handle to an annotation object, where pAnnHandle is a pointer to the structure defining an annotation handle. This function is available in the Document/Medical Toolkits.

Parameter

Description

pAnnHandle

Pointer to a structure that defines the user handle.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Before calling this function, you must create the LAnnPoint object.

Call this function one or more times to add user handles to an existing annotation object.

The user handle location can be defined using container coordinates or client coordinates.

Client coordinates factor in the current zoom factor, and the horizontal and vertical scrolling.

For more information on defining a user handle, see the documentation for the ANNHANDLE structure.

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

Functions:

Class Members, LAnnPoint::AddUserHandle, LAnnPoint::EnumerateHandles, LAnnPoint::EnumHandleCallBack, LAnnPoint::GetUserHandle, LAnnPoint::GetUserHandles, LAnnPoint::ChangeUserHandle, LAnnPoint::DeleteUserHandle

Topics:

Annotation Functions: Object Properties

 

Implementing Annotations

 

Automated User Interface for Annotations

 

Annotation Functions: Creating and Deleting Annotations

 

Annotation Functions: Implementing Custom Annotations

Example

// This example adds user handles to the center of the top and bottom of a Point object.
L_VOID ExampleAnnAddUserHandle(LAnnPoint *pLPoint) 
{
   ANNHANDLE AnnHandle; 
   L_UINT uType; 
   ANNRECT arc; 
   
   uType = pLPoint->GetType ();
   if (uType == ANNOBJECT_POINT) 
   {
      pLPoint->GetRect (&arc, NULL); 

      memset(&AnnHandle, 0, sizeof(ANNHANDLE)); 
      AnnHandle.uStructSize   = sizeof(ANNHANDLE);  
      AnnHandle.nID           = 100; 
      AnnHandle.bVisible      = TRUE; 
      AnnHandle.crPen         = RGB(0,0,0); 
      AnnHandle.crFill        = RGB(255,0,0); 
      AnnHandle.nShape        = ANNHANDLE_SHAPE_CIRCLE; 
      AnnHandle.hCursor       = NULL; 
      AnnHandle.uFlags        =  ANNHANDLE_ID | ANNHANDLE_LOCATION | 
                                 ANNHANDLE_CONTAINER_COORDINATES | ANNHANDLE_VISIBLE | 
                                 ANNHANDLE_PEN_COLOR | ANNHANDLE_FILL_COLOR | ANNHANDLE_SHAPE; 
      
      AnnHandle.aptContainer.x = (arc.left + arc.right)/2; 
      AnnHandle.aptContainer.y = arc.top; 
      pLPoint->AddUserHandle(&AnnHandle); 

      AnnHandle.aptContainer.x = (arc.left + arc.right)/2; 
      AnnHandle.aptContainer.y = arc.bottom; 
      pLPoint->AddUserHandle(&AnnHandle); 
   }
   else
      MessageBox(NULL, TEXT("Annotation object must be a Point object."), TEXT("Error"), MB_OK); 
}