L_ContainerSetObjectCursor

#include "LtCon.h"

L_LTCON_API L_INT L_ContainerSetObjectCursor (pContainer, nObjectType, hCursor)

pCONTAINERHANDLE pContainer;

/* pointer to a container handle */

CONTAINEROBJECTTYPE nObjectType;

/* container object type */

L_HCURSOR hCursor;

/* handle to a windows cursor */

Sets the container object cursor.

Parameter

Description

pContainer

Pointer to a container handle.

nObjectType

An integer that represents the object type for which to set the cursor. Possible values are:

 

Value

Meaning

 

CONTAINER_OBJECT_TYPE_POINT

Point object

 

CONTAINER_OBJECT_TYPE_LINE

Line object

 

CONTAINER_OBJECT_TYPE_SQUARE.

Square object

 

CONTAINER_OBJECT_TYPE_RECT

Rectangular object

 

CONTAINER_OBJECT_TYPE_ELLIPSE

Elliptical object

 

CONTAINER_OBJECT_TYPE_CIRCLE

Circular object

 

CONTAINER_OBJECT_TYPE_POLYLINE

Polyline object

 

CONTAINER_OBJECT_TYPE_BEZIER

Bezier curve object

 

CONTAINER_OBJECT_TYPE_ARC

Arc object

 

CONTAINER_OBJECT_TYPE_TEXT

Text object

hCursor

The new object cursor.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The cursor set by this function will be shown every time that specific object type is drawn in the container. For example, if a rectangle is being drawn in the container, the cursor set for object type CONTAINER_OBJECT_TYPE_RECT will be displayed. The container makes a copy of the cursor. Therefore, the user can delete a specific cursor.

Required DLLs and Libraries

LTCON

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:

L_ContainerGetObjectCursor.

Topics:

Using Container Objects

Example

This example shows how to set some container object cursor.

 L_INT ContainerSetObjectCursorExample(HWND hWnd, pCONTAINERHANDLE * ppContainer)
{
   L_INT nRet;
   CONTAINERMETRICS Metrics ;

   /* Initiate the container handle */
   nRet = L_ContainerInit ( ppContainer ) ;
   if(nRet != SUCCESS)
      return nRet;

   /* Create the container and attach it to its owner window */
   nRet = L_ContainerCreate ( *ppContainer, hWnd ) ;
   if(nRet != SUCCESS)
      return nRet;
   nRet = L_ContainerIsValid ( *ppContainer );
   if (SUCCESS == nRet ) /* check the validity of the container handle */
   {
      HCURSOR hRectCursor ;

      /* Load some cursor */
      hRectCursor = LoadCursor ( NULL, IDC_CROSS ) ;

      /* Set the rectangle object cursor */
      nRet = L_ContainerSetObjectCursor ( *ppContainer, CONTAINER_OBJECT_TYPE_RECT, hRectCursor ) ;
      if(nRet != SUCCESS)
         return nRet;

      /* Destroy the cursor, because its not needed any more */
      DestroyCursor ( hRectCursor ) ;

      /* Set the container object type to rectangle */
      nRet = L_ContainerSetObjectType ( *ppContainer, CONTAINER_OBJECT_TYPE_RECT ) ;
      if(nRet != SUCCESS)
         return nRet;

      /* Initiate the container metrics */
      Metrics.nSize   = sizeof ( CONTAINERMETRICS ) ;
      Metrics.dwMask = CMF_LIMITS ;

      /* Set the container limits to some value */
      SetRect ( &Metrics.rcLimits, 0, 0, 500, 500 ) ;

      /* Set the container metrics */
      nRet = L_ContainerSetMetrics ( *ppContainer, &Metrics ) ;
   }
   return nRet;
}