UiUiUi
A user interface library for micro controller sketches based on U8g2
UIVerticalLine.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 "UIArea.h"
10 #include "UIWidget.h"
11 
13 class UIVerticalLine : public UIWidget {
14 
15  public:
16 
21  UIVerticalLine(uint16_t border=0,uint16_t lineWidth=1,UIWidget* next=nullptr);
22 
25 
27  UIArea* render(U8G2 *display,bool force);
28 
29  protected:
30 
32  void computePreferredSize(U8G2 *display,UISize *preferredSize);
33 
34  private:
35 
37  uint16_t border;
38 
40  uint16_t lineWidth;
41 
42 };
43 
44 // end of file
Area consisting of left, top, right, and bottom value.
Definition: UIArea.h:20
Representation of a size, i.e.
Definition: UISize.h:9
Vertical line with optional empty border left and right, always spreads as wide as possible to top an...
Definition: UIVerticalLine.h:13
UIVerticalLine(uint16_t border=0, uint16_t lineWidth=1, UIWidget *next=nullptr)
Create a vertical line.
Definition: UIVerticalLine.cpp:13
void computePreferredSize(U8G2 *display, UISize *preferredSize)
The preferred size of a line is 1+2*border in width and "as high as possible".
Definition: UIVerticalLine.cpp:34
UIArea * render(U8G2 *display, bool force)
A line is only rendered if rendering is forced, otherwise it never changes.
Definition: UIVerticalLine.cpp:20
Basic widget class, ancestor of all UI widgets.
Definition: UIWidget.h:36
UISize preferredSize(U8G2 *display)
Return the preferred size of this widget, will be called before a call to layout().
Definition: UIWidget.cpp:16
UIWidget * next
Pointer to the next widget on the same level.
Definition: UIWidget.h:65