version 2.8
Label

Detailed Description

Simple label widget.

Setting the dimensions of the widget to 0 will automatically set the labels dimensions to fit the entire text. Note that the dimensions of the label will change every time the text is changed through gwinSetText().

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_LABEL 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 label widget.
 

Functions

GHandle gwinGLabelCreate (GDisplay *g, GLabelObject *widget, GWidgetInit *pInit)
 Create a label widget. More...
 
void gwinLabelSetBorder (GHandle gh, bool_t border)
 Border settings for the default rendering routine. More...
 
void gwinLabelSetAttribute (GHandle gh, coord_t tab, const char *attr)
 Add an text attribute in front of the normal label text. More...
 
#define GLABEL_FLG_WAUTO   0x01
 The internal label flags. More...
 

Function Documentation

GHandle gwinGLabelCreate ( GDisplay *  g,
GLabelObject *  widget,
GWidgetInit pInit 
)

Create a label widget.

A label widget is a simple window which has a static text.

Parameters
[in]gThe GDisplay to display this window on
[in]widgetThe label structure to initialise. If this is NULL, the structure is dynamically allocated.
[in]pInitThe initialisation parameters to use.
Returns
NULL if there is no resultat drawing area, otherwise the widget handle.
Function Class:
Normal API, this function can be invoked by regular system threads.
void gwinLabelSetAttribute ( GHandle  gh,
coord_t  tab,
const char *  attr 
)

Add an text attribute in front of the normal label text.

Often you want to display a text like this: Current IP: 192.168.1.42 In that case, the actual IP will be variable, the text in front of it always remains the same. The static text is called the attribute and can be set using this function. Furthermore, the tab can be set in order to vertically align multiple labels. Please check out the website for further explanation, illustraions and usage examples.

Note
The attribute text is not copied into private memory and so it must be a constant string, not one allocated in a stack buffer.
Use of this construct is discouraged. The appropriate way is to create two labels - one for the static text and one for the dynamic text.
Parameters
[in]ghThe widget handle (must be a label handle)
[in]tabThe distance of the label text from the left widget edge
[in]attrThe attribute to be displayed
Function Class:
Normal API, this function can be invoked by regular system threads.
void gwinLabelSetBorder ( GHandle  gh,
bool_t  border 
)

Border settings for the default rendering routine.

Parameters
[in]ghThe widget handle (must be a label handle)
[in]borderShall a border be rendered?
Function Class:
Normal API, this function can be invoked by regular system threads.

Macro Definition Documentation

#define GLABEL_FLG_WAUTO   0x01

The internal label flags.

Note
Used only for writing a custom draw routine.

Definition at line 41 of file gwin_label.h.