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

Horizontal line with optional empty border on top and bottom, always spreads as wide as possible to the left and right. More...

#include <UIHorizontalLine.h>

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

Public Member Functions

 UIHorizontalLine (uint16_t border=0, uint16_t lineWidth=1, UIWidget *next=nullptr)
 Create a horizontal line. More...
 
 UIHorizontalLine (UIWidget *next)
 Create a horizontal line of width 1 with no border on top and bottom.
 
UIArearender (U8G2 *display, bool force)
 A line is only rendered if rendering is forced, otherwise it never changes. 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...
 

Protected Member Functions

void computePreferredSize (U8G2 *display, UISize *preferredSize)
 The preferred size of a line is 1+2*border in height and "as wide as possible". 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 UIWidget
UIArea dim
 Actual area of this widget, set in layout().
 
UIParentparent
 Reference to the group this widget is connected to.
 

Detailed Description

Horizontal line with optional empty border on top and bottom, always spreads as wide as possible to the left and right.

Constructor & Destructor Documentation

◆ UIHorizontalLine()

UIHorizontalLine::UIHorizontalLine ( uint16_t  border = 0,
uint16_t  lineWidth = 1,
UIWidget next = nullptr 
)

Create a horizontal line.

Defaults to an empty border on top and bottom (default 0), a tiny line width (defaults to 1) and an optional successor.

Member Function Documentation

◆ computePreferredSize()

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

The preferred size of a line is 1+2*border in height and "as wide as possible".

Implements UIWidget.

◆ render()

UIArea * UIHorizontalLine::render ( U8G2 *  display,
bool  force 
)
virtual

A line is only rendered if rendering is forced, otherwise it never changes.

Implements UIWidget.


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