UiUiUi
A user interface library for micro controller sketches based on U8g2
UIColumns.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 
28 class UIColumns: 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 fixedWidth;
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 columns one next to the other.
Definition: UIColumns.h:28
UIColumns(UIWidget *firstChild, UIWidget *next=nullptr)
Create a group of column-wise arranged sub-widgets.
Definition: UIColumns.cpp:16
void layout(U8G2 *display, UIArea *dim)
Layout all the sub-widgets one next to the other.
Definition: UIColumns.cpp:20
void computePreferredSize(U8G2 *display, UISize *preferredSize)
Preferred size of a columns group is computed by attaching the sub-widgets appropriately.
Definition: UIColumns.cpp:36
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