UiUiUi
A user interface library for micro controller sketches based on U8g2
|
Widget group for widgets organized in columns one next to the other. More...
#include <UIColumns.h>
Public Member Functions | |
UIColumns (UIWidget *firstChild, UIWidget *next=nullptr) | |
Create a group of column-wise arranged sub-widgets. | |
void | layout (U8G2 *display, UIArea *dim) |
Layout all the sub-widgets one next to the other. More... | |
![]() | |
UIWidgetGroup (UIWidget *firstChild, UIWidget *next=nullptr) | |
Create a widget group with a linked list of sub-widgets and a potential successor. | |
UIArea * | render (U8G2 *display, bool force) |
Default implementation of rendering a widget group is to render all of its sub-widgets. More... | |
virtual void | childNeedsRendering (UIWidget *child) |
Called by any child of this group to indicate that it wants to be rendered. 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... | |
virtual void | childNeedsRendering (UIWidget *child)=0 |
Called by any child of this group to indicate that it wants to be rendered. More... | |
Protected Member Functions | |
void | computePreferredSize (U8G2 *display, UISize *preferredSize) |
Preferred size of a columns group is computed by attaching the sub-widgets appropriately. 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. | |
![]() | |
UIWidget * | firstChild |
The first of the widgets grouped by this widget group. | |
bool | renderChildren |
Flag whether any child of this group needs to be rendered. | |
![]() | |
UIArea | dim |
Actual area of this widget, set in layout(). | |
UIParent * | parent |
Reference to the group this widget is connected to. | |
Widget group for widgets organized in columns one next to the other.
The sub-widgets are layouted one next to the other from left to right in the area the UIColumns widgets group gets from the higher layout level.
The preferred size is the sum of the preferred widths of all sub-widgets and the maximum of the heights of the sub-widgets.
Sub-widgets can request either a fixed width or "as wide as possible" by returning UISize::MAX_LEN as preferred width. In this case in the layout step the remainder of the assigned widget widths and all fixed widths of subwidgets is split evenly between all "as large as possible" widths.
|
protectedvirtual |
Preferred size of a columns group is computed by attaching the sub-widgets appropriately.
Implements UIWidget.
|
virtual |
Layout all the sub-widgets one next to the other.
Reimplemented from UIWidget.