Sets the container object cursor.
#include "Ltwrappr.h"
L_INT LContainer::SetObjectCursor (nObjectType, hCursor)
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 |
The new object cursor.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
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.
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 ;
}