EbCreate Function

Microchip Graphics Library

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

This function creates a EDITBOX object with the parameters given and initializes the default settings. 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 to be used. 
WORD charMax 
Defines the maximum number of characters in the edit box. 
GOL_SCHEME * pScheme 
Pointer to the style scheme. 
Returns

Returns the pointer to the object created.

Preconditions

none

Side Effects

none

Example
#define ID_MYEDITBOX    101
EDITBOX *pEb;

pEb = EbCreate(ID_MYEDITBOX,    // ID
             10,                // left
             10,                // top
             100,               // right
             30,                // bottom
             EB_DRAW,           // redraw after creation                    
             NULL,              // no text yet
             4,                 // display only four characters
             pScheme);          // pointer to the style scheme         

if( pEb == NULL )
{
    // MEMORY ERROR. Object was not created.
}
    
Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved