UiUiUi
A user interface library for micro controller sketches based on U8g2
|
Envelope widget which contains exactly one other widget and changes its representation. More...
#include <UIEnvelope.h>
Public Member Functions | |
UIEnvelope (UIExpansion expansion, UIAlignment alignment, UISize borderSize=UISize(), UIWidget *content=nullptr, UIWidget *next=nullptr) | |
Create an envelope widget. More... | |
UIEnvelope (UIExpansion expansion, UIAlignment alignment, UIWidget *content, UIWidget *next=nullptr) | |
Create an envelope widget without border. More... | |
void | layout (U8G2 *display, UIArea *dim) |
Layout the envelope. More... | |
UIArea * | render (U8G2 *display, bool force) |
Render the envelope - which also renders the content if it exists. More... | |
void | childNeedsRendering (UIWidget *child) |
Called by the child of this envelope 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) |
Compute the preferred size which is determined by the content by may be changed by the envelope. 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. | |
![]() | |
UIArea | dim |
Actual area of this widget, set in layout(). | |
UIParent * | parent |
Reference to the group this widget is connected to. | |
Envelope widget which contains exactly one other widget and changes its representation.
The envelope can do the following things:
UIEnvelope::UIEnvelope | ( | UIExpansion | expansion, |
UIAlignment | alignment, | ||
UISize | borderSize = UISize() , |
||
UIWidget * | content = nullptr , |
||
UIWidget * | next = nullptr |
||
) |
Create an envelope widget.
expansion | Report an enlarged preferred size to the caller for the axes given by this parameter. |
alignment | Align the content widget this way if it is smaller than the area of the envelope. |
borderSize | Generate an empty border of this size around the content widget |
content | The content of the envelope. If empty, the envelope renders an empty area. |
next | Next widget on the same level as the envelope. |
UIEnvelope::UIEnvelope | ( | UIExpansion | expansion, |
UIAlignment | alignment, | ||
UIWidget * | content, | ||
UIWidget * | next = nullptr |
||
) |
Create an envelope widget without border.
expansion | Report an enlarged preferred size to the caller for the axes given by this parameter. |
alignment | Align the content widget this way if it is smaller than the area of the envelope. |
content | The content of the envelope. If empty, the envelope renders an empty area. |
next | Next widget on the same level as the envelope. |
|
virtual |
Called by the child of this envelope to indicate that it wants to be rendered.
Implements UIParent.
|
protectedvirtual |
Compute the preferred size which is determined by the content by may be changed by the envelope.
Implements UIWidget.
|
virtual |
Layout the envelope.
This includes shaping the content according to all the constraints.
Reimplemented from UIWidget.
|
virtual |
Render the envelope - which also renders the content if it exists.
Implements UIWidget.