UiUiUi
A user interface library for micro controller sketches based on U8g2
Public Member Functions | Protected Member Functions | List of all members
UITextIcon Class Reference

Widget which shows an icon by some normal text operation, usually with a font with icons. More...

#include <UITextIcon.h>

Inheritance diagram for UITextIcon:
Inheritance graph
[legend]
Collaboration diagram for UITextIcon:
Collaboration graph
[legend]

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.
 
- Public Member Functions inherited from UITextLine
 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...
 
UIArearender (U8G2 *display, bool force)
 Render the text line. More...
 
- Public Member Functions inherited from UIWidget
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 UIArearender (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...
 
- Protected Member Functions inherited from UITextLine
void computePreferredSize (U8G2 *display, UISize *preferredSize)
 Generate the preferred size from the font size. More...
 
- Protected Member Functions inherited from UIWidget
 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

- Public Attributes inherited from UIWidget
UIWidgetnext
 Pointer to the next widget on the same level.
 
- Protected Attributes inherited from UITextLine
const uint8_t * font
 The font of this text line.
 
- Protected Attributes inherited from UIWidget
UIArea dim
 Actual area of this widget, set in layout().
 
UIParentparent
 Reference to the group this widget is connected to.
 

Detailed Description

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.

Member Function Documentation

◆ computePreferredSize()

void UITextIcon::computePreferredSize ( U8G2 *  display,
UISize preferredSize 
)
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.


The documentation for this class was generated from the following files: