Access Objects Properties Home

LiteCAD objects property can be one of the following types:
- Boolean (true or false),
- Integer (32 or 64 bit, depends on Windows bits),
- Float (64-bit double float),
- String (Unicode, 16 bit per character),
- Handle (32 or 64 bit pointer, depends on Windows bits)

There are a set of functions to read/write objects properties, depend on the type:

Function Meaning
lcPropGetBool Returns a property's value of boolean type
lcPropGetInt Returns a property's value of integer type
lcPropGetFloat Returns a property's value of floating type
lcPropGetStr Returns a property's value of string type
lcPropGetStrA Used to get a property's value of ANSI string type (for VB6)
lcPropGetHandle Returns a property's value of handle type (pointer)
lcPropPutBool Sets a property's value of boolean type
lcPropPutInt Sets a property's value of integer type
lcPropPutFloat Sets a property's value of floating type
lcPropPutStr Sets a property's value of string type
lcPropPutHandle Sets a property's value of handle type (pointer)

Each property has a symbolic name, written with template LC_PROP_object_propname, where object - object name, and the propname is a property name, for example:
LC_PROP_LAYER_NAME - layer name
it has type "String", therefore, in order to set layer name you have to call:
  lcPropPutStr (hLayer, LC_PROP_LAYER_NAME, szName);

Some properties have more then one type, for example, you can set active layer either by its name or by handle:
  lcPropPutStr (hDrw, LC_PROP_DRW_LAYER, L"Streets" );
  lcPropPutHandle (hDrw, LC_PROP_DRW_LAYER, hLayer);



Code sample:
bool bRulers;
int Size;
double X, Y;
WCHAR szFileName[256];
COLORREF Color;

// read properties
bRulers = lcPropGetBool( hLcWnd, LC_PROP_WND_RULERS );
wcscpy( szFileName, lcPropGetStr( hImage, LC_PROP_IMAGE_FILENAME ) );
Size = lcPropGetInt( 0, LC_PROP_G_GRIPSIZE );
Color = lcPropGetInt( 0, LC_PROP_G_GRIPCOLOR );
X = lcPropGetFloat( hLcWnd, LC_PROP_WND_CURSORX );
Y = lcPropGetFloat( hLcWnd, LC_PROP_WND_CURSORX );

// write properties
lcPropPutInt( hLcWnd, LC_PROP_WND_COLORBG, RGB(0,0,0) );
lcPropPutInt( hLcWnd, LC_PROP_WND_COLORCURSOR,  RGB(255,255,255) );
lcPropPutBool( 0, LC_PROP_G_SAVECFG, true );
lcPropPutInt( hLcWnd, LC_PROP_WND_LWMODE, LC_LW_PIXEL );
lcPropPutFloat( hLcWnd, LC_PROP_WND_LWSCALE, 0.2 );
lcPropPutStr( 0, LC_PROP_G_DLGVAL, szFileName );