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

Widget group for widgets organized in columns one next to the other. More...

#include <UIColumns.h>

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

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...
 
- 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 columns group is computed by attaching 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 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.

Member Function Documentation

◆ computePreferredSize()

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

Preferred size of a columns group is computed by attaching the sub-widgets appropriately.

Implements UIWidget.

◆ layout()

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

Layout all the sub-widgets one next to the other.

Reimplemented from UIWidget.


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