GbCreate Function

Microchip Graphics Library

Microchip Graphics Library
GbCreate Function
C
GROUPBOX * GbCreate(
    WORD ID, 
    SHORT left, 
    SHORT top, 
    SHORT right, 
    SHORT bottom, 
    WORD state, 
    XCHAR * pText, 
    GOL_SCHEME * pScheme
);
Overview

This function creates a GROUPBOX 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 
The pointer to the text used for the group box. Length of string must be checked not to exceed the object’s width. Clipping is not supported for the text of this object. 
GOL_SCHEME * pScheme 
Pointer to the style scheme used for the object. 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;
GROUPBOX *groupbox[2];
WORD state;

pScheme = GOLCreateScheme();
state = GB_DRAW | GB_RIGHT_ALIGN;
groupbox[0] = GbCreate( 10, 14,48,152,122,
                        state, "Power", scheme);
if (groupbox[0] == NULL)
    return 0;
state = GB_DRAW;
groupbox[1] = GbCreate( 11, 160,48,298,122,
                        state, "Pressure", scheme);
if (groupbox[1] == NULL)
    return 0;

while(!GbDraw(groupbox[0]));
while(!GbDraw(groupbox[1]));
return 1;
Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved