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 GFXON in your gfxconf.h
-
GFX_USE_GWIN must be set to GFXON in your gfxconf.h
-
GDISP_NEED_TEXT must be set to GFXON in your gfxconf.h
-
GWIN_NEED_TEXTEDIT must be set to GFXON in your gfxconf.h
-
The fonts you want to use must be enabled in your gfxconf.h
|
| Renderings |
| Built-in rendering functions for the textedit widget.
|
|
◆ gwinGTexteditCreate()
GHandle gwinGTexteditCreate |
( |
GDisplay * |
g, |
|
|
GTexteditObject * |
wt, |
|
|
GWidgetInit * |
pInit, |
|
|
gMemSize |
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] | g | The GDisplay on which the textedit should be displayed |
[in] | wt | The TextEdit structure to initialise. If this is NULL, the structure is dynamically allocated. |
[in] | pInit | The initialisation parameters to use. |
[in] | maxSize | The 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.
◆ gwinTextEditSendKey()
void gwinTextEditSendKey |
( |
GHandle |
gh, |
|
|
char * |
pkey, |
|
|
unsigned |
len |
|
) |
| |
Send a normal utf8 character to the textedit.
- Parameters
-
[in] | gh | The window handle (must be a textedit window) |
[in] | pkey | The pointer to the utf8 character to send. |
[in] | len | The 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.
◆ gwinTextEditSendSpecialKey()
void gwinTextEditSendSpecialKey |
( |
GHandle |
gh, |
|
|
gU8 |
key |
|
) |
| |
Send a special key to the textedit such as GKEY_LEFT, GKEY_RIGHT, GKEY_HOME, GKEY_END.
- Parameters
-
[in] | gh | The window handle (must be a textedit window) |
[in] | key | The 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.