Class Display. API for working with text on display. More...
#include <ev3cxx_display.h>
Public Member Functions | |
Display (lcdfont_t font=EV3_FONT_MEDIUM) | |
Constructor of class Display. More... | |
~Display () | |
Destructor of class Display. | |
detail::format_impl< Display, detail::string_literal_range > | format (char const *pattern) |
Write formated text to LCD. More... | |
detail::format_impl< Display, detail::string_literal_range > | format (int8_t line, char const *pattern) |
Write formated text to LCD. More... | |
virtual void | write (char ch) |
Write one character on screen of class Display. More... | |
void | write_raw (char ch, bool clear=false) |
Write one character on screen of class Display. | |
int32_t | getTextLine () const |
Get actual text line index. More... | |
void | setTextLine (uint8_t line, int32_t x_offset=0, bool clear=true) |
Set actual text line index of cursor for next write. More... | |
void | clearTextLine (uint8_t line, bool_t color=white, int32_t x_offset=0, int32_t line_length=0) |
Clear a line. More... | |
void | resetScreen (bool_t color=white) |
Clear whole LCD. More... | |
void | setFont (lcdfont_t font) |
Set font type. More... | |
lcdfont_t | getFont () const |
Get actual font type. | |
int32_t | getFontWidth () const |
Get actual font width. | |
int32_t | getFontHeight () const |
Get actual font height. | |
int32_t | getX () const |
Get actual X coordinates. | |
int32_t | getY () const |
Get actual Y coordinates. | |
Static Public Attributes | |
static const uint8_t | width = EV3_LCD_WIDTH |
Width of LCD in pixels. | |
static const uint8_t | height = EV3_LCD_HEIGHT |
Height of LCD in pixels. | |
static const bool_t | white = EV3_LCD_WHITE |
White color of write to LCD. | |
static const bool_t | black = EV3_LCD_BLACK |
Black color of write to LCD. | |
Private Attributes | |
lcdfont_t | m_font |
actual font | |
int32_t | m_font_width |
width of actual font | |
int32_t | m_font_height |
height of actual font | |
int32_t | m_max_char_on_line |
max number of character on one line | |
int32_t | m_max_line_on_height |
max number of line on screen | |
int32_t | m_x |
actual horizontal coordinate from upper left corner | |
int32_t | m_y |
actual vertical coordinate from upper left corner | |
Class Display. API for working with text on display.
Definition at line 20 of file ev3cxx_display.h.
|
inline |
Constructor of class Display.
font | Type of font lcdfont_t (EV3_FONT_SMALL / EV3_FONT_MEDIUM). Default is EV3_FONT_MEDIUM. |
Definition at line 34 of file ev3cxx_display.h.
References Display::setFont().
|
inline |
Clear a line.
line | Line index. Range depend on actual font type (EV3_FONT_MEDIUM => 0 - 7). If out of range, then result is "line % m_max_line_on_height". |
color | Color the cleared with. You can set white or black. |
x_offset | Offset for clearing the line in x coordinate. When you want clear just part of display, then you set this offset. If you want to set offset depend on character, use function getFontWidth() and multiple by require number of char. |
Definition at line 140 of file ev3cxx_display.h.
References Display::getFontHeight(), and Display::getFontWidth().
Referenced by Display::setTextLine(), and Display::write_raw().
|
inline |
Write formated text to LCD.
pattern | String with pattern for final output text. |
Definition at line 51 of file ev3cxx_display.h.
|
inline |
Write formated text to LCD.
line | Line index to write text on LCD. |
pattern | String with pattern for final output text. |
Definition at line 62 of file ev3cxx_display.h.
References Display::setTextLine().
|
inline |
Get actual text line index.
Range depend on actual font type (EV3_FONT_MEDIUM => 0 - 7).
Definition at line 112 of file ev3cxx_display.h.
References Display::getFontHeight(), and Display::m_y.
Referenced by Display::write(), and Display::write_raw().
|
inline |
Clear whole LCD.
color | Color of screen after reset. You can set white or black. |
Definition at line 157 of file ev3cxx_display.h.
References Display::setTextLine().
|
inline |
Set font type.
After changing font set variables m_font_width => getFontWidth() and m_font_height -> getFontHeight().
font | Type of font lcdfont_t (EV3_FONT_SMALL / EV3_FONT_MEDIUM). |
Definition at line 168 of file ev3cxx_display.h.
References Display::m_font, Display::m_font_height, Display::m_font_width, Display::m_max_char_on_line, and Display::m_max_line_on_height.
Referenced by Display::Display().
|
inline |
Set actual text line index of cursor for next write.
Also clear all line (clearTextLine()).
line | Line index. Range depend on actual font type (EV3_FONT_MEDIUM => 0 - 7). If out of range, then result is "line % m_max_line_on_height". |
x_offset | Offset for clearing the line in x coordinate. When you want clear just part of display, then you set this offset. If you want to set offset depend on character, use function getFontWidth() and multiple by require number of char. |
Definition at line 123 of file ev3cxx_display.h.
References Display::clearTextLine(), Display::getFontHeight(), Display::m_x, and Display::m_y.
Referenced by Display::format(), Display::resetScreen(), and Display::write().
|
inlinevirtual |
Write one character on screen of class Display.
Char "\n" set next text line.
Definition at line 74 of file ev3cxx_display.h.
References Display::getTextLine(), Display::setTextLine(), and Display::write_raw().