C
RADIOBUTTON * RbCreate( WORD ID, SHORT left, SHORT top, SHORT right, SHORT bottom, WORD state, XCHAR * pText, GOL_SCHEME * pScheme );
Overview
This function creates a RADIOBUTTON 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 pText – The pointer to the text used for the Radio Button. |
|
GOL_SCHEME * pScheme |
Pointer to the style scheme used. |
Returns
Returns the pointer to the object created
Preconditions
none
Side Effects
none
Example
GOL_SCHEME *pScheme;
RADIOBUTTON *pRb[3];
pScheme = GOLCreateScheme();
pRb[0] = RbCreate(ID_RADIOBUTTON1, // ID
255,40,310,80, // dimension
RB_DRAW|RB_GROUP|RB_CHECKED, // will be dislayed and
// focused after creation
// first button in the group
"RB1", // text
pScheme); // scheme used
pRb[1] = RbCreate(ID_RADIOBUTTON2, // ID
255,85,310,125, // dimension
RB_DRAW, // will be dislayed and
// checked after creation
"RB2", // text
pScheme); // scheme used
pRb[2] = RbCreate(ID_RADIOBUTTON3, // ID
255,130,310,170, // dimension
RB_DRAW, // will be dislayed and
// disabled after creation
"RB3", // text
pScheme); // scheme used
while(!RbDraw(pRb[0])); // draw the objects
while(!RbDraw(pRb[1]));
while(!RbDraw(pRb[2]));