LContainer::SetObjectCursor

#include "Ltwrappr.h"

L_INT LContainer::SetObjectCursor (nObjectType, hCursor)

CONTAINEROBJECTTYPE nObjectType;

/* container object type */

HCURSOR hCursor;

/* handle to a windows cursor */

Sets the container object cursor.

Parameter

Description

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:

LContainer::GetObjectCursor.

Topics:

Using Container Objects

Example

This example shows how to set some container object cursor.

L_INT LContainer_SetObjectCursorExample( HWND hWnd, LContainer & lcont)
{
   L_INT nRet;
   CONTAINERMETRICS Metrics ;
   /* Initiate the container handle */
   nRet = lcont.Initialize () ;
   if(nRet != SUCCESS)
      return nRet;
   /* Create the container and attach it to its owner window */
   nRet = lcont.Create (hWnd ) ;
   if(nRet != SUCCESS)
      return nRet;
   nRet = lcont.IsValid ( );
   if ( nRet == SUCCESS ) /* check the validity of the container handle */
   {
      HCURSOR hRectCursor ; 
      /* Load some cursor */
      hRectCursor = LoadCursor ( NULL, IDC_CROSS ) ;
      /* Set the rectangle object cursor */
      nRet = lcont.SetObjectCursor (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 = lcont.SetObjectType (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 = lcont.SetMetrics (&Metrics ) ;
      if(nRet != SUCCESS)
         return nRet;
   }
   else
   {
      return nRet ;
   }
   return SUCCESS ;
}