ConsoleView¶
- template <uint16_t W, uint16_t H>
-
class
mono::ui::
ConsoleView
¶ Inherits from mono::ui::View
Public Functions
-
ConsoleView
(geo::Point pos)¶ Construct a new ConsoleView, for viewing console output on the screen.
-
void
WriteLine
(String txt)¶ Write a string to the console, and append a new line.
- Parameters
txt
-The string to write to the console
-
virtual void
repaint
()¶ Repaint the view content, using the View::painter.
Re-paint the view content. This method should be called when the view content has changed. You can call this method directly, but it might cause graphics artifacts because the display is not double buffered. Instead you should schedule a repaint by calling the scheduleRepaint() method. This method will schedule the repaint, right after the next display update.
The display system will not schedule any repaints automatically. The view does not contain any state information, so you or other classes utilizing view must schedule repaints.
In subclasses of View, this method must be overwritten.
-
int
lineLength
()¶ Get the width of a line in characters.
<# description #>
- Return
- Number of characters in one line
-
int
consoleLines
()¶ Get the number lines in the console.
<# description #>
- Return
- Numeber of text lines on the console view.
Protected Attributes
-
TextBuffer<(W-4)/5, (H-4)/9>
textBuffer
¶ Text buffer that hold the visible text in the console. When the console scrolls, the text in the buffer is overwritten.
-
bool
scrolls
¶ Becomes true when the console text has reached the bottom line of its view rectangle. And all text appending from now on, causes the console to scroll.
-