UiUiUi
A user interface library for micro controller sketches based on U8g2
UIRows.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 "UIArea.h"
10#include "UIWidget.h"
11#include "UIWidgetGroup.h"
12
13
28class UIRows: public UIWidgetGroup {
29
30 public:
31
34
36 void layout(U8G2* display,UIArea* dim);
37
38 protected:
39
41 void computePreferredSize(U8G2 *display,UISize *preferredSize);
42
43 private:
44
46 uint8_t extendingChildrenCount;
47
49 uint16_t fixedHeight;
50
51};
52
53// end of file
Area consisting of left, top, right, and bottom value.
Definition: UIArea.h:20
Widget group for widgets organized in rows one below the other.
Definition: UIRows.h:28
void computePreferredSize(U8G2 *display, UISize *preferredSize)
Preferred size of a rows group is computed by stacking the sub-widgets appropriately.
Definition: UIRows.cpp:37
void layout(U8G2 *display, UIArea *dim)
Layout all the sub-widgets one below the other.
Definition: UIRows.cpp:18
UIRows(UIWidget *firstChild, UIWidget *next=nullptr)
Create a group of row-wise arranged sub-widgets.
Definition: UIRows.cpp:14
Representation of a size, i.e.
Definition: UISize.h:9
Main abstraction of a group of interface widgets.
Definition: UIWidgetGroup.h:29
UIWidget * firstChild
The first of the widgets grouped by this widget group.
Definition: UIWidgetGroup.h:45
Basic widget class, ancestor of all UI widgets.
Definition: UIWidget.h:36
UIArea dim
Actual area of this widget, set in layout().
Definition: UIWidget.h:80
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