EasyGUI  Version v1.0
Text view

Text view widget. More...

Data Structures

struct  gui_textview_t
 Textview object structure. More...
 

Enumerations

enum  gui_textview_color_t { GUI_TEXTVIEW_COLOR_BG = 0x00, GUI_TEXTVIEW_COLOR_TEXT }
 List of text view colors. More...
 
enum  gui_textalign_valign_t { GUI_TEXTVIEW_VALIGN_TOP = GUI_VALIGN_TOP, GUI_TEXTVIEW_VALIGN_CENTER = GUI_VALIGN_CENTER, GUI_TEXTVIEW_VALIGN_BOTTOM = GUI_VALIGN_BOTTOM }
 Vertical align for text view inside box. More...
 
enum  gui_textalign_halign_t { GUI_TEXTVIEW_HALIGN_LEFT = GUI_HALIGN_LEFT, GUI_TEXTVIEW_HALIGN_CENTER = GUI_HALIGN_CENTER, GUI_TEXTVIEW_HALIGN_RIGHT = GUI_HALIGN_RIGHT }
 Horizontal align for text view inside box. More...
 

Functions

gui_handle_p gui_textview_create (gui_id_t id, float x, float y, float width, float height, gui_handle_p parent, gui_widget_evt_fn evt_fn, uint16_t flags)
 Create new text view widget. More...
 
uint8_t gui_textview_setcolor (gui_handle_p h, gui_textview_color_t index, gui_color_t color)
 Set color to specific part of widget. More...
 
uint8_t gui_textview_setvalign (gui_handle_p h, gui_textalign_valign_t align)
 Set vertical align for text inside text box. More...
 
uint8_t gui_textview_sethalign (gui_handle_p h, gui_textalign_halign_t align)
 Set horizontal align for text inside text box. More...
 

Detailed Description

Text view widget.

Text view widget can only display text assigned to its memory

image_widget_textview.png
Text view widget in different alignments

Example code of image above:

Enumeration Type Documentation

◆ gui_textalign_halign_t

Horizontal align for text view inside box.

Enumerator
GUI_TEXTVIEW_HALIGN_LEFT 

Horizontal align left, default value

GUI_TEXTVIEW_HALIGN_CENTER 

Horizontal align center

GUI_TEXTVIEW_HALIGN_RIGHT 

Horizontal align right

◆ gui_textalign_valign_t

Vertical align for text view inside box.

Enumerator
GUI_TEXTVIEW_VALIGN_TOP 

Vertical align top, default value

GUI_TEXTVIEW_VALIGN_CENTER 

Vertical align center

GUI_TEXTVIEW_VALIGN_BOTTOM 

Vertical align bottom

◆ gui_textview_color_t

List of text view colors.

Enumerator
GUI_TEXTVIEW_COLOR_BG 

Background color

GUI_TEXTVIEW_COLOR_TEXT 

Default text color

Function Documentation

◆ gui_textview_create()

gui_handle_p gui_textview_create ( gui_id_t  id,
float  x,
float  y,
float  width,
float  height,
gui_handle_p  parent,
gui_widget_evt_fn  evt_fn,
uint16_t  flags 
)

Create new text view widget.

Parameters
[in]idWidget unique ID to use for identity for callback processing
[in]xWidget X position relative to parent widget
[in]yWidget Y position relative to parent widget
[in]widthWidget width in units of pixels
[in]heightWidget height in units of pixels
[in]parentParent widget handle. Set to NULL to use current active parent widget
[in]evt_fnCustom widget callback function. Set to NULL to use default callback
[in]flagsflags for widget creation
Returns
Widget handle on success, NULL otherwise

◆ gui_textview_setcolor()

uint8_t gui_textview_setcolor ( gui_handle_p  h,
gui_textview_color_t  index,
gui_color_t  color 
)

Set color to specific part of widget.

Parameters
[in]hWidget handle
[in]indexColor index
[in]colorColor value
Returns
1 on success, 0 otherwise

◆ gui_textview_sethalign()

uint8_t gui_textview_sethalign ( gui_handle_p  h,
gui_textalign_halign_t  align 
)

Set horizontal align for text inside text box.

Parameters
[in]hWidget handle
[in]alignHorizontal align
Returns
1 on success, 0 otherwise

◆ gui_textview_setvalign()

uint8_t gui_textview_setvalign ( gui_handle_p  h,
gui_textalign_valign_t  align 
)

Set vertical align for text inside text box.

Parameters
[in]hWidget handle
[in]alignVertical align
Returns
1 on success, 0 otherwise