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

Widget group for widgets organized in rows one below the other. More...

#include <UIRows.h>

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

Public Member Functions

 UIRows (UIWidget *firstChild, UIWidget *next=nullptr)
 Create a group of row-wise arranged sub-widgets.
 
void layout (U8G2 *display, UIArea *dim)
 Layout all the sub-widgets one below the other. More...
 
- Public Member Functions inherited from UIWidgetGroup
 UIWidgetGroup (UIWidget *firstChild, UIWidget *next=nullptr)
 Create a widget group with a linked list of sub-widgets and a potential successor.
 
UIArearender (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...
 
- 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...
 
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 rows group is computed by stacking the sub-widgets appropriately. 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 UIWidgetGroup
UIWidgetfirstChild
 The first of the widgets grouped by this widget group.
 
bool renderChildren
 Flag whether any child of this group needs to be rendered.
 
- 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 group for widgets organized in rows one below the other.

The sub-widgets are layouted one below the other from top to bottom in the area the UIRows widgets group gets from the higher layout level.

The preferred size is the sum of the preferred heights of all sub-widgets and the maximum of the widths of the sub-widgets.

Sub-widgets can request either a fixed height or "as high as possible" by returning UISize::MAX_LEN as preferred height. In this case in the layout step the remainder of the assigned widget height and all fixed heights of subwidgets is split evenly between all "as large as possible" heights.

Member Function Documentation

◆ computePreferredSize()

void UIRows::computePreferredSize ( U8G2 *  display,
UISize preferredSize 
)
protectedvirtual

Preferred size of a rows group is computed by stacking the sub-widgets appropriately.

Implements UIWidget.

◆ layout()

void UIRows::layout ( U8G2 *  display,
UIArea dim 
)
virtual

Layout all the sub-widgets one below the other.

Reimplemented from UIWidget.


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