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

A widget containing a bitmap (XBMP) which is set statically during compile time. More...

#include <UIBitmap.h>

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

Public Member Functions

 UIBitmap (uint16_t width, uint16_t height, const uint8_t *bitmap, UIAlignment alignment, UIWidget *next=nullptr)
 Create a bitmap with supplied alignment and potential successor. More...
 
 UIBitmap (uint16_t width, uint16_t height, const uint8_t *bitmap, UIWidget *next=nullptr)
 Create a bitmap with default centered alignment and potential successor. More...
 
UIArearender (U8G2 *display, bool force)
 A bitmap is only rendered if the 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)
 Generate the preferred size from the bitmap size. 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

A widget containing a bitmap (XBMP) which is set statically during compile time.

Height and width must be supplied to match the XBMP data. Alignment can be specified for cases where the bitmap is rendered in a larger area.

Constructor & Destructor Documentation

◆ UIBitmap() [1/2]

UIBitmap::UIBitmap ( uint16_t  width,
uint16_t  height,
const uint8_t *  bitmap,
UIAlignment  alignment,
UIWidget next = nullptr 
)

Create a bitmap with supplied alignment and potential successor.

The supplied width and height must match the bitmap data. The bitmap data must be XBMP formated, and compiled into PROGMEM.

◆ UIBitmap() [2/2]

UIBitmap::UIBitmap ( uint16_t  width,
uint16_t  height,
const uint8_t *  bitmap,
UIWidget next = nullptr 
)

Create a bitmap with default centered alignment and potential successor.

The supplied width and height must match the bitmap data. The bitmap data must be XBMP formated, and compiled into PROGMEM.

Member Function Documentation

◆ computePreferredSize()

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

Generate the preferred size from the bitmap size.

Implements UIWidget.

◆ render()

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

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

Implements UIWidget.


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