A segment of the terminal screen (2D char matrix).
More...
#include <Window.hpp>
|
enum | BorderType { BORDER_NONE
, BORDER_REGULAR
, BORDER_FANCY
} |
|
enum | WindowTitlePosition { TOP_LEFT
, TOP_RIGHT
, BOTTOM_LEFT
, BOTTOM_RIGHT
} |
|
|
| Window (int x, int y, int w, int h) |
|
| Window (Window *parent, int x, int y, int width, int height) |
|
virtual void | resize (int w, int h) |
|
bool | isValid () |
|
void | print (std::string str, int x, int y, ColorPair pair=0) |
| Shows text #str at #x #y on the window with color #pair. More...
|
|
void | print (std::vector< std::string > lines, int x, int y, ColorPair pair=0) |
| Shows multiple text lines #lines at #x #y on the window with color #pair. More...
|
|
void | printChar (int c, int x, int y, ColorPair pair=0) |
| Shows #c at #x #y with color #pair. More...
|
|
void | setBackground (chtype ch, ColorPair pair) |
|
void | refresh () |
|
void | clear () |
|
int | getW () const |
|
int | getH () const |
|
int | getX () const |
|
int | getY () const |
|
void | borders (BorderType type) |
|
void | horizontalLine (int x, int y, int c, int width, ColorPair pair) |
|
void | setTitle (std::string title, WindowTitlePosition position=Window::TOP_LEFT) |
| Sets a text that will appear at the top of the Window. More...
|
|
A segment of the terminal screen (2D char matrix).
Definition at line 16 of file Window.hpp.
◆ BorderType
◆ WindowTitlePosition
enum Window::WindowTitlePosition |
◆ Window() [1/2]
Window::Window |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
◆ Window() [2/2]
Window::Window |
( |
Window * |
parent, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
◆ ~Window()
◆ borders()
void Window::borders |
( |
BorderType |
type | ) |
|
◆ clear()
◆ getH()
int Window::getH |
( |
| ) |
const |
◆ getW()
int Window::getW |
( |
| ) |
const |
◆ getX()
int Window::getX |
( |
| ) |
const |
◆ getY()
int Window::getY |
( |
| ) |
const |
◆ horizontalLine()
void Window::horizontalLine |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
c, |
|
|
int |
width, |
|
|
ColorPair |
pair |
|
) |
| |
◆ isValid()
◆ print() [1/2]
void Window::print |
( |
std::string |
str, |
|
|
int |
x, |
|
|
int |
y, |
|
|
ColorPair |
pair = 0 |
|
) |
| |
Shows text #str at #x #y on the window with color #pair.
- Note
- It defaults to white text on black background.
Definition at line 94 of file Window.cpp.
◆ print() [2/2]
void Window::print |
( |
std::vector< std::string > |
lines, |
|
|
int |
x, |
|
|
int |
y, |
|
|
ColorPair |
pair = 0 |
|
) |
| |
Shows multiple text lines #lines at #x #y on the window with color #pair.
- Note
- It also defaults to white text on black background.
-
Use it together with
Utils::String::split
: window.print(Utils::String::split("multiple\nlines", '\n'),
x, y, color_pair);
Definition at line 100 of file Window.cpp.
◆ printChar()
void Window::printChar |
( |
int |
c, |
|
|
int |
x, |
|
|
int |
y, |
|
|
ColorPair |
pair = 0 |
|
) |
| |
Shows #c at #x #y with color #pair.
- Note
- It also defaults to white text on black background.
Definition at line 105 of file Window.cpp.
◆ refresh()
◆ resize()
void Window::resize |
( |
int |
w, |
|
|
int |
h |
|
) |
| |
|
virtual |
◆ setBackground()
void Window::setBackground |
( |
chtype |
ch, |
|
|
ColorPair |
pair |
|
) |
| |
◆ setTitle()
void Window::setTitle |
( |
std::string |
title, |
|
|
WindowTitlePosition |
position = Window::TOP_LEFT |
|
) |
| |
Sets a text that will appear at the top of the Window.
By default it's shown on top of the borders, with a highlighted color tone.
Definition at line 214 of file Window.cpp.
◆ borderType
BorderType Window::borderType |
|
protected |
◆ bottomLeftTitle
std::string Window::bottomLeftTitle |
|
protected |
◆ bottomRightTitle
std::string Window::bottomRightTitle |
|
protected |
◆ error
Tells if we've got some initialization error.
Definition at line 89 of file Window.hpp.
◆ height
◆ topLeftTitle
std::string Window::topLeftTitle |
|
protected |
◆ topRightTitle
std::string Window::topRightTitle |
|
protected |
◆ width
◆ win
Ncurses' internal data structure.
IT'S PUBLIC BECAUSE SOMETIMES I NEED TO CALL DIRECT NCURSES CALLS - FIX THIS
Definition at line 85 of file Window.hpp.
The documentation for this class was generated from the following files: