UiUiUi
A user interface library for micro controller sketches based on U8g2
|
Widget which shows an icon by some normal text operation, usually with a font with icons. More...
#include <UITextIcon.h>
Public Member Functions | |
UITextIcon (const uint8_t *font, UISize preferredSize, UIWidget *next=nullptr) | |
Create a text icon with a specific font, a preferred size and a potential successor. | |
![]() | |
UITextLine (const uint8_t *font, UIAlignment alignment, bool useUTF8=false, UIWidget *next=nullptr) | |
Create a text line with the given font and alignment and a potential successor. | |
UITextLine (const uint8_t *font, UIAlignment alignment, UIWidget *next) | |
Create a text line with the given font and alignment, not using UTF8 and a potential successor. | |
UITextLine (const uint8_t *font, bool useUTF8, UIWidget *next=nullptr) | |
Create a text line with the given font, centered alignment, the given UTF8 flag and a potential successor. | |
UITextLine (const uint8_t *font, UIWidget *next) | |
Create a text line with the given font, centered alignment and a potential successor. | |
UITextLine (const uint8_t *font) | |
Create a text line with the given font and no successor. | |
void | setText (const char *text) |
Set the text of the text line. More... | |
void | clearText () |
Clear the text in this text line. | |
void | updateText () |
Insist that on the next render() call, the text line will update its content. More... | |
UIArea * | render (U8G2 *display, bool force) |
Render the text line. More... | |
![]() | |
UISize | preferredSize (U8G2 *display) |
Return the preferred size of this widget, will be called before a call to layout(). More... | |
virtual void | layout (U8G2 *display, UIArea *area) |
Layout widget in the given rectanglar area, will be called before first call to render(). More... | |
virtual UIArea * | render (U8G2 *display, bool force)=0 |
Render component in the space given in layout(). More... | |
virtual void | setParent (UIParent *parent) |
Set the parent widget group (if it exists). More... | |
Protected Member Functions | |
void | computePreferredSize (U8G2 *display, UISize *preferredSize) |
The preferred size is completely determined by the size given at construction time. More... | |
![]() | |
void | computePreferredSize (U8G2 *display, UISize *preferredSize) |
Generate the preferred size from the font size. More... | |
![]() | |
UIWidget (UIWidget *next=nullptr) | |
Initialize this widget and potentially set its successor. | |
void | clearBox (U8G2 *display, UIArea *dimm) |
Clear the given area. | |
void | clearFull (U8G2 *display) |
Clear the full area of this widget. | |
void | clip (U8G2 *display) |
Set U8g2's clip window to the area of this widget, should be called from render(). | |
virtual void | computePreferredSize (U8G2 *display, UISize *preferredSize)=0 |
Store preferred size of this widget into the preferredSize reference. More... | |
void | signalNeedsRendering () |
Called internally: Signals to parent that this widget needs to be rendered. | |
Additional Inherited Members | |
![]() | |
UIWidget * | next |
Pointer to the next widget on the same level. | |
![]() | |
const uint8_t * | font |
The font of this text line. | |
![]() | |
UIArea | dim |
Actual area of this widget, set in layout(). | |
UIParent * | parent |
Reference to the group this widget is connected to. | |
Widget which shows an icon by some normal text operation, usually with a font with icons.
This is a specialized text line widget. Its main difference is that its preferred size is not "as wide as possible", but explicitly given in width and height.
The actual icon to show is given via the inherited UITextLine::setText method. Of course, clearText() works also.
|
protectedvirtual |
The preferred size is completely determined by the size given at construction time.
The text line's preferred size computation is called nevertheless, so that the internal initialisation takes place.
Implements UIWidget.