C
DIGITALMETER * DmCreate( WORD ID, SHORT left, SHORT top, SHORT right, SHORT bottom, WORD state, DWORD Value, BYTE NoOfDigits, BYTE DotPos, GOL_SCHEME * pScheme );
Overview
This function creates a DIGITALMETER object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
Input Parameters
Input Parameters |
Description |
WORD ID |
Unique user defined ID for the object instance. |
SHORT left |
Left most position of the object. |
SHORT top |
Top most position of the object. |
SHORT right |
Right most position of the object. |
SHORT bottom |
Bottom most position of the object. |
WORD state |
Sets the initial state of the object. |
DWORD Value |
Sets the initial value to be displayed |
BYTE NoOfDigits |
Sets the number of digits to be displayed |
BYTE DotPos |
Sets the position of decimal point in the display |
GOL_SCHEME * pScheme |
Pointer to the style scheme. Set to NULL if default style scheme is used. |
Returns
Returns the pointer to the object created.
Preconditions
none
Side Effects
none
Example
GOL_SCHEME *pScheme; DIGITALMETER *pDm; pScheme = GOLCreateScheme(); state = DM_DRAW | DM_FRAME | DM_CENTER_ALIGN; DmCreate(ID_DIGITALMETER1, // ID 30,80,235,160, // dimension state, // has frame and center aligned 789,4,1, // to display 078.9 pScheme); // use given scheme while(!DmDraw(pDm)); // draw the object