Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members  

crs::cursive Class Reference

#include <cursive.h>

List of all members.

Public Methods

 cursive ()
 ~cursive ()
int mainloop ()
screen_ctrlgetScreen ()
 get a pointer to the screen_ctrl structure.

void setFocus (focused_ctrl *ctrl)
 set the focus to the given control

base_controlgetFocused ()

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_ctrlfocused
 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_ctrlmScreen
 this is the only screen_ctrl instance in cursive


Friends

class base_control
class focused_ctrl


Detailed Description

The main cursive class - handles the screen, keyboard input and the "mainloop".

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.


Constructor & Destructor Documentation

crs::cursive::cursive  
 

Definition at line 54 of file cursive.cpp.

References focused, and mScreen.

crs::cursive::~cursive  
 

Definition at line 72 of file cursive.cpp.

References mScreen.


Member Function Documentation

void crs::cursive::deregisterFocusable focused_ctrl::focuslist::iterator &    i [private]
 

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().

base_control* crs::cursive::getFocused   [inline]
 

Definition at line 142 of file cursive.h.

Referenced by crs::cursive::screen_ctrl::finalflush().

screen_ctrl* crs::cursive::getScreen   [inline]
 

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 138 of file cursive.h.

int crs::cursive::mainloop  
 

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().

focused_ctrl::focuslist::iterator crs::cursive::registerFocusable focused_ctrl   control [private]
 

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().

void crs::cursive::setFocus focused_ctrl   ctrl [inline]
 

set the focus to the given control

Definition at line 140 of file cursive.h.

References focusable, and focused_it.

Referenced by mainloop().


Friends And Related Function Documentation

friend class base_control [friend]
 

Definition at line 97 of file cursive.h.

friend class focused_ctrl [friend]
 

Definition at line 98 of file cursive.h.


Member Data Documentation

focused_ctrl::focuslist crs::cursive::focusable [private]
 

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().

focused_ctrl* crs::cursive::focused [private]
 

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().

focused_ctrl::focuslist::iterator crs::cursive::focused_it [private]
 

iterator to the focused control in the focusable list

Definition at line 94 of file cursive.h.

Referenced by mainloop(), registerFocusable(), and setFocus().

screen_ctrl* crs::cursive::mScreen [private]
 

this is the only screen_ctrl instance in cursive

Definition at line 122 of file cursive.h.

Referenced by cursive(), mainloop(), and ~cursive().


The documentation for this class was generated from the following files:
Generated on Mon May 19 20:36:04 2003 for cursive by doxygen1.2.18