version 2.8
TextEdit

Detailed Description

Widget that accepts text input.

Note
Due to the modularity of the GINPUT module, the text input can either come from a real physical keyboard or from a vritual on-screen keyboard such as the KeyboardWidget.
Precondition
GFX_USE_GDISP must be set to TRUE in your gfxconf.h
GFX_USE_GWIN must be set to TRUE in your gfxconf.h
GDISP_NEED_TEXT must be set to TRUE in your gfxconf.h
GWIN_NEED_TEXTEDIT must be set to TRUE in your gfxconf.h
The fonts you want to use must be enabled in your gfxconf.h

Modules

 Renderings
 Built-in rendering functions for the textedit widget.
 

Functions

GHandle gwinGTexteditCreate (GDisplay *g, GTexteditObject *wt, GWidgetInit *pInit, size_t maxSize)
 Create a TextEdit widget. More...
 
void gwinTextEditSendSpecialKey (GHandle gh, uint8_t key)
 Send a special key to the textedit such as GKEY_LEFT, GKEY_RIGHT, GKEY_HOME, GKEY_END. More...
 
void gwinTextEditSendKey (GHandle gh, char *pkey, unsigned len)
 Send a normal utf8 character to the textedit. More...
 

Function Documentation

GHandle gwinGTexteditCreate ( GDisplay *  g,
GTexteditObject *  wt,
GWidgetInit pInit,
size_t  maxSize 
)

Create a TextEdit widget.

A TextEdit widget is a rectangular box which allows the user to input data through a keyboard. The keyboard can either be a physical one or a virtual on-screen keyboard as the keyboard driver is abstracted through the GINPUT module.

Parameters
[in]gThe GDisplay on which the textedit should be displayed
[in]wtThe TextEdit structure to initialise. If this is NULL, the structure is dynamically allocated.
[in]pInitThe initialisation parameters to use.
[in]maxSizeThe maximum number of characters the TextEdit widget can hold. (0 means unlimited).
Returns
NULL if there is no resultant drawing area, otherwise the widget handle.
Note
If the initial text set is larger than maxSize then the text is truncated at maxSize characters.
Function Class:
Normal API, this function can be invoked by regular system threads.
void gwinTextEditSendKey ( GHandle  gh,
char *  pkey,
unsigned  len 
)

Send a normal utf8 character to the textedit.

Parameters
[in]ghThe window handle (must be a textedit window)
[in]pkeyThe pointer to the utf8 character to send.
[in]lenThe length of the utf8 character in bytes.
Note
This must ONLY be called with a single utf8 character at a time. Don't attempt to send a string of characters in the one call.
Characters are interpreted as if they came directly from a keyboard ie a backspace character will perform the backspace operation, a tab will send the focus to the next control etc.
Precondition
Requires GINPUT_NEED_KEYBOARD or GWIN_NEED_KEYBOARD to be on
Function Class:
Normal API, this function can be invoked by regular system threads.
void gwinTextEditSendSpecialKey ( GHandle  gh,
uint8_t  key 
)

Send a special key to the textedit such as GKEY_LEFT, GKEY_RIGHT, GKEY_HOME, GKEY_END.

Parameters
[in]ghThe window handle (must be a textedit window)
[in]keyThe special key to send.
Precondition
Requires GINPUT_NEED_KEYBOARD or GWIN_NEED_KEYBOARD to be on
Function Class:
Normal API, this function can be invoked by regular system threads.