C
CHECKBOX * CbCreate( WORD ID, SHORT left, SHORT top, SHORT right, SHORT bottom, WORD state, XCHAR * pText, GOL_SCHEME * pScheme );
Overview
This function creates a CHECKBOX 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 |
XCHAR * pText |
Pointer to the text of the check box. |
GOL_SCHEME * pScheme |
Pointer to the style scheme |
Returns
Returns the pointer to the object created
Preconditions
none
Side Effects
none
Example
GOL_SCHEME *pScheme; CHECKBOX *pCb[2]; pScheme = GOLCreateScheme(); pCb = CbCreate(ID_CHECKBOX1, // ID 20,135,150,175, // dimension CB_DRAW, // Draw the object "Scale", // text pScheme); // use this scheme pCb = CbCreate(ID_CHECKBOX2, // ID 170,135,300,175, // dimension CB_DRAW, // Draw the object "Animate", // text pScheme); // use this scheme while(!CbDraw(pCb[0])); // draw the objects while(!CbDraw(pCb[1]));