LContainer::SetObjectCursor

Summary

Sets the container object cursor.

Syntax

#include "Ltwrappr.h"

L_INT LContainer::SetObjectCursor (nObjectType, hCursor)

Parameters

CONTAINEROBJECTTYPE 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 hCursor

The new object cursor.

Returns

Value Meaning
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

See Also

Functions

Topics

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 ; 
 
} 

Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Container and Automation C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.