Text Entry

Microchip Graphics Library

Microchip Graphics Library
Text Entry

Text Entry supports only Touchscreen inputs, replying to their events with the following messages: 

1. TE_MSG_RELEASE – A key has been released. 

2. TE_MSG_PRESS – A key is pressed. 

3. TE_MSG_ADD_CHAR – A key was released with character assigned. 

4. TE_MSG_DELETE – A key was released with delete command assigned. 

5. TE_MSG_SPACE - A key was released with space command assigned. 

6. TE_MSG_ENTER - A key was released with enter command assigned. 

 

The Text Entry Object is rendered using the assigned style scheme. The following figure illustrates the color assignments. 

 

 

Functions
 
Name 
Description 
 
This function creates a TEXTENTRY 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. 
 
This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object.
This widget will draw the keys using the function GOLPanelDraw(). The number of keys will depend on the horizontal and vertical parameters given (horizontalKeys*verticakKeys). 
 
This function sets the buffer used to display text. If the buffer is initialized with a string, the string must be a null terminated string. If the string length is greater than MaxSize, string will be truncated to MaxSize. pText must point to a valid memory location with size equal to MaxSize+1. The +1 is used for the string terminator. 
 
This function will clear the data in the display. You must set the drawing state bit TE_UPDATE_TEXT to update the TEXTENTRY on the screen. 
 
This function will return the currently used command by a key with the given index. 
 
This function will assign a command (TE_DELETE_COM, TE_SPACE_COM or TE_ENTER_COM) to a key with the given index. 
 
This function will create the list of KEYMEMBERS that holds the information on each key. The number of keys is determined by the equation (verticalKeys*horizontalKeys). The object creates the information holder for each key automatically and assigns each entry in the *pText[] array with the first entry automatically assigned to the key with an index of 1. The number of entries to *pText[] must be equal or greater than (verticalKeys*horizontalKeys). The last key is assigned with an index of (verticalKeys*horizontalKeys)-1. No checking is performed on the length of *pText[] entries to match (verticalKeys*horizontalKeys). 
 
This function will insert a character to the end of the buffer. The character inserted is dependent on the currently pressed key. Drawing states TE_UPDATE_TEXT or TE_DRAW must be set to see the effect of this insertion. 
 
This function will test if a key given by its index in the TextEntry object has been pressed. 
 
This function will insert a space character to the end of the buffer. Drawing states TE_UPDATE_TEXT or TE_DRAW must be set to see the effect of this insertion. 
 
This function will delete the KEYMEMBER list assigned to the object from memory. Pointer to the KEYMEMBER list is then initialized to NULL. 
 
This function will set the test assigned to a key with the given index. 
 
This function performs the actual state change based on the translated message given. The following state changes are supported:  
 
This function evaluates the message from a user if the message will affect the object or not. If the message is valid, the keys in the Text Entry object will be scanned to detect which key was pressed. If True, the corresponding text will be displayed, the ‘text’ will also be stored in the TeOutput parameter of the object.
 
Macros
Name 
Description 
This macro will return the currently used buffer in the TextEntry object. 
Structures
Name 
Description 
Defines the parameters required for a TextEntry Object. 
Defines the parameters and the strings assigned for each key. 
Topics
Name 
Description 
List of Text Entry bit states. 
List of available Key command types. 
Links
Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved