FabGL2 2.0.0
Graphics, audio, GUI and retro-computing library for the ESP32 (ESP-IDF)
Loading...
Searching...
No Matches
uiSegmentDisplay Class Reference

A seven segment led display, like the ones of the vintage instruments. More...

#include <fabui.h>

Inheritance diagram for uiSegmentDisplay:

Public Member Functions

 uiSegmentDisplay (uiWindow *parent, const Point &pos, const Size &size, int digits, bool visible=true, uint32_t styleClassID=0)
 Creates an instance of the object.
uiAnchors & anchors ()
 Allows to switch on or off anchors.
uiApp * app ()
 Determines the app that owns this object.
void bringAfter (uiWindow *insertionPoint)
 Brings this window after another one.
void bringOnTop ()
 Brings this window on top.
Point clientPos ()
 Determines position of the client area.
virtual Rect clientRect (uiOrigin origin)
 Determines the client area bounding box.
Size clientSize ()
 Determines the client area size.
int digits ()
 Gets the number of digits.
void exitModal (int modalResult)
 Exits from a modal window.
uiWindow * firstChild ()
 Gets first child.
int focusIndex ()
 Determines the focus index (aka tab-index).
bool hasChildren ()
 Determines whether this window has children.
bool hasFocus ()
 Determines whether this window or control has focus.
bool isActiveWindow ()
 Determines whether this window is the active one.
bool isMouseOver ()
 Determines whether the mouse is over this window.
uiWindow * lastChild ()
 Gets last child.
uiWindow * next ()
 Gets next sibling.
uiObjectType & objectType ()
 Determines the object type.
uiWindow * parent ()
 Determines the parent window.
RGB888 parentBackgroundColor ()
 Determines the background color behind this window.
uiWindow * parentFrame ()
 Determines the parent frame.
Point pos ()
 Determines the window position relative to parent window.
uiWindow * prev ()
 Gets previous sibling.
Rect rect (uiOrigin origin)
 Determines the window bounding box.
void repaint ()
 Repaints this window.
void repaint (Rect const &rect)
 Repaints a rectangle of this window.
uiSegmentDisplayProps & segmentDisplayProps ()
 Sets or gets display properties.
uiSegmentDisplayStyle & segmentDisplayStyle ()
 Sets or gets display style.
void setFocusIndex (int value)
 Sets the focus index (aka tab-index).
void setNumber (int value, bool leadingZeros=false)
 Shows a number.
void setParentProcessKbdEvents (bool value)
 Enables a child window to send keyboard events to its parent.
void setStyleClassID (uint16_t value)
 Sets style class for this UI element.
void setText (char const *value)
 Sets the text. The display is repainted only when the content changes.
void setTextFmt (const char *format,...)
 Sets the text, using printf like formatting.
Size size ()
 Determines the window size.
uiWindowState state ()
 Determines the window state.
uint16_t styleClassID ()
 Determines current style class for this UI element.
Rect transformRect (Rect const &rect, uiWindow *baseWindow)
 Transforms rectangle origins from current window to another one.
uiWindowProps & windowProps ()
 Sets or gets window properties.
uiWindowStyle & windowStyle ()
 Sets or gets window style.

Static Public Member Functions

static uint8_t charSegments (char c)
 Gets the segments of a character.

Detailed Description

A seven segment led display, like the ones of the vintage instruments.

It shows digits, some letters (A b C c d E F G H h I J L n o P r S t U u y), minus, underscore, space and the decimal point (a "." lights the point of the previous digit). Texts are right aligned.

Example:

auto display = new uiSegmentDisplay(frame, Point(10, 10), Size(60, 30), 3);
display->setNumber(120);

Definition at line 4570 of file fabui.h.


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