UiUiUi
A user interface library for micro controller sketches based on U8g2
UICheckerboard.h
1// SPDX-License-Identifier: BSD-2-Clause
2// (C) 2022 Dirk Hillbrecht
3
4#pragma once
5
6#include "Arduino.h"
7#include <U8g2lib.h>
8
9#include "UISize.h"
10#include "UIWidget.h"
11
12
14class UICheckerboard : public UIWidget {
15
16 public:
17
19 UICheckerboard(UISize preferredSize=UISize(),UIWidget* next=nullptr);
20
23
25 UIArea* render(U8G2* display,bool force);
26
27 protected:
28
30 void computePreferredSize(U8G2 *display,UISize *preferredSize);
31
32 private:
33
35 static unsigned char checkerboard_bits[];
36
38 UISize preferredSize;
39
40};
41
42// end of file
Area consisting of left, top, right, and bottom value.
Definition: UIArea.h:20
A widget drawing a checkerboard into its space.
Definition: UICheckerboard.h:14
void computePreferredSize(U8G2 *display, UISize *preferredSize)
Generate the preferred size from the font size.
Definition: UICheckerboard.cpp:36
UICheckerboard(UISize preferredSize=UISize(), UIWidget *next=nullptr)
Create a checkerboard widget with the given preferred size and a potential successor.
Definition: UICheckerboard.cpp:15
UIArea * render(U8G2 *display, bool force)
Render the checkerboard pattern.
Definition: UICheckerboard.cpp:22
Representation of a size, i.e.
Definition: UISize.h:9
Basic widget class, ancestor of all UI widgets.
Definition: UIWidget.h:36
UIWidget * next
Pointer to the next widget on the same level.
Definition: UIWidget.h:65