UiUiUi
A user interface library for micro controller sketches based on U8g2
UITextIcon.h
1// SPDX-License-Identifier: BSD-2-Clause
2// (C) 2022 Dirk Hillbrecht
3
4#pragma once
5
6#include "Arduino.h"
7#include <U8g2lib.h>
8
9#include "UIEnums.h"
10#include "UISize.h"
11#include "UIWidget.h"
12#include "UITextLine.h"
13
23class UITextIcon : public UITextLine {
24
25 public:
26
28 UITextIcon(const uint8_t* font,UISize preferredSize,UIWidget* next=nullptr);
29
30 protected:
31
37 void computePreferredSize(U8G2 *display,UISize *preferredSize);
38
39 private:
40
42 UISize myPreferredSize;
43
44};
45
46// end of file
Representation of a size, i.e.
Definition: UISize.h:9
Widget which shows an icon by some normal text operation, usually with a font with icons.
Definition: UITextIcon.h:23
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.
Definition: UITextIcon.cpp:15
void computePreferredSize(U8G2 *display, UISize *preferredSize)
The preferred size is completely determined by the size given at construction time.
Definition: UITextIcon.cpp:18
A widget containing a line of text which is set dynamically during runtime using setText().
Definition: UITextLine.h:25
const uint8_t * font
The font of this text line.
Definition: UITextLine.h:72
Basic widget class, ancestor of all UI widgets.
Definition: UIWidget.h:36
UISize preferredSize(U8G2 *display)
Return the preferred size of this widget, will be called before a call to layout().
Definition: UIWidget.cpp:16
UIWidget * next
Pointer to the next widget on the same level.
Definition: UIWidget.h:65