terminalgui
0.1.0
Widgets for your terminal, powered by Qt! Create textual GUI (TUI) in your console easily.
|
Screen is the "canvas" on which widgets (subclasses of Widget) are drawn. More...
#include <tgscreen.h>
Public Slots | |
void | scheduleRedraw (const RedrawType type, const Widget *widget) |
Schedules a redraw of widget using type. More... | |
void | moveFocusToPreviousWidget () |
Finds next Widget ready to accept keyboard focus and moves the focus to it. More... | |
void | moveFocusToNextWidget () |
Finds previous Widget ready to accept keyboard focus and moves the focus to it. More... | |
void | setCanDragWidgets (const bool canDragWidgets) |
Signals | |
void | sizeChanged (const QSize &size) const |
Emitted when Screen's size is modified. | |
void | canDragWidgetsChanged (const bool canDragWidgets) const |
Public Member Functions | |
Screen (QObject *parent=nullptr, const StylePointer &style=nullptr) | |
Constructs a Screen. More... | |
QSize | size () const |
Returns the size of this Screen. More... | |
StylePointer | style () const |
Returns the default style, shared with all Widget instances. | |
bool | canDragWidgets () const |
Properties | |
QSize | size |
Size of the Screen. More... | |
bool | canDragWidgets |
When true , widgets can be dragged around on the Screen using a mouse. More... | |
Friends | |
class | Widget |
Screen is the "canvas" on which widgets (subclasses of Widget) are drawn.
Every top-level Widget needs to be a child of Screen. This is done using Widget constructor, which internally calls registerWidget(). When a Widget is deleted, deregisterWidget() is called to notify the Screen.
Internally, Screen uses Terminal to know available space, and to interact with the console.
Tg::Screen::Screen | ( | QObject * | parent = nullptr , |
const StylePointer & | style = nullptr |
||
) |
|
slot |
Finds previous Widget ready to accept keyboard focus and moves the focus to it.
|
slot |
Finds next Widget ready to accept keyboard focus and moves the focus to it.
|
slot |
Schedules a redraw of widget using type.
Draw operations are not performed immediately, but rather use compressRedraws() to only draw Screen changes once in a while.
To force an immedate redraw, call draw().
QSize Tg::Screen::size | ( | ) | const |
|
readwrite |
|
read |