#include <cursive.h>
Public Methods | |
cursive () | |
~cursive () | |
int | mainloop () |
screen_ctrl * | getScreen () |
get a pointer to the screen_ctrl structure. | |
void | setFocus (focused_ctrl *ctrl) |
set the focus to the given control | |
base_control * | getFocused () |
Private Methods | |
focused_ctrl::focuslist::iterator | registerFocusable (focused_ctrl *control) |
This function is called by every control that wants to gain the focus. | |
void | deregisterFocusable (focused_ctrl::focuslist::iterator &i) |
deregisterFocusable is called when a control in the focusable list is destroyed | |
Private Attributes | |
focused_ctrl * | focused |
Pointer to the currently focused control. | |
focused_ctrl::focuslist::iterator | focused_it |
iterator to the focused control in the focusable list | |
focused_ctrl::focuslist | focusable |
list of all focusable controls | |
screen_ctrl * | mScreen |
this is the only screen_ctrl instance in cursive | |
Friends | |
class | base_control |
class | focused_ctrl |
cursive is a singleton class - the only instance is crs::oocrs. You need oocrs to access the screen (ever top-level control should have oocrs->getScreen() set as parent) and to get into the mainloop() which handles keyboard input, draws the controls and takes care of the focus thingie (the control that owns the focus is painted bold). Actually, some of the mentioned thinks are done by the crs::cursive::screen_ctrl class.
Definition at line 89 of file cursive.h.
|
Definition at line 54 of file cursive.cpp. |
|
Definition at line 72 of file cursive.cpp. References mScreen. |
|
deregisterFocusable is called when a control in the focusable list is destroyed
Definition at line 149 of file cursive.cpp. References focusable. Referenced by crs::focused_ctrl::~focused_ctrl(). |
|
Definition at line 142 of file cursive.h. Referenced by crs::cursive::screen_ctrl::finalflush(). |
|
get a pointer to the screen_ctrl structure. this class represents the whole screen and does the drawing and focus handling. you need to set any top-level control's parent to that control, as it is the mother of all controls. When a control's parent is neither cursive::mScreen nor any other control which parent hierarchy ends in cursive::mScreen, the control is not drawn. |
|
Definition at line 77 of file cursive.cpp. References crs::cursive::screen_ctrl::finalflush(), focusable, focused, focused_it, crs::base_control::keyPress(), mScreen, and setFocus(). |
|
This function is called by every control that wants to gain the focus. It push_back's the control in the list and makes it available in focus-cylcing (the tab-key) Definition at line 139 of file cursive.cpp. References focusable, focused, and focused_it. Referenced by crs::focused_ctrl::focused_ctrl(). |
|
set the focus to the given control
Definition at line 140 of file cursive.h. References focusable, and focused_it. Referenced by mainloop(). |
|
|
|
|
|
list of all focusable controls
Definition at line 96 of file cursive.h. Referenced by crs::cursive::screen_ctrl::deregisterControl(), deregisterFocusable(), mainloop(), registerFocusable(), and setFocus(). |
|
Pointer to the currently focused control.
Definition at line 92 of file cursive.h. Referenced by cursive(), crs::cursive::screen_ctrl::deregisterControl(), crs::cursive::screen_ctrl::finalflush(), mainloop(), and registerFocusable(). |
|
iterator to the focused control in the focusable list
Definition at line 94 of file cursive.h. Referenced by mainloop(), registerFocusable(), and setFocus(). |
|
this is the only screen_ctrl instance in cursive
Definition at line 122 of file cursive.h. Referenced by cursive(), mainloop(), and ~cursive(). |