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

CTextArea Class Reference

Textarea for editing/displaying text. More...

#include <CUI.h>

Inheritance diagram for CTextArea::

CWidget CScrollable List of all members.

Public Methods

 CTextArea (int x, int y, int cols, int rows, string text="", int flags=TA_NONE, int maxlength=-1)
 ~CTextArea ()
virtual int update (CInputEvent *e)
 Update method - Recieves a CInputEvent, returns 1 if redraw is needed, 0 if not. More...

virtual void draw (CGfxScreen *s)
 Draw method - The widget should draw itslelf to the passed CGfxScreen. More...

void setText (string text)
 Sets the text of the text area. More...

string getText ()
 Returns the text in the textarea. More...

void addChar (char c)
 Adds a character to the text in the textarea. More...

void addStr (string str)
 Adds a string to the text in the textarea. More...

void remChar (int num=1)
 Removes num characters in the textarea (defaults to one). More...

virtual int getMin ()
 Returns minimum value of the scroll region. More...

virtual int getMax ()
 Returns maximum value of the scroll region. More...

virtual int getPos ()
 Returns current position in the scroll region. More...

virtual void setPos (int pos)
 Sets the current item/line to be selected. More...

virtual void scrollUp ()
 Scrolls up one. More...

virtual void scrollDown ()
 Scrolls down one. More...


Public Attributes

int m_liststart
string m_text
list< string > m_displist
int m_maxlength

Detailed Description

Textarea for editing/displaying text.

Like the label class but much more advanced. Handles multiple lines of text, a cursor for editing, and impliments CScrollable so it can be scrolled by a scrollbar.


Constructor & Destructor Documentation

CTextArea::CTextArea int    x,
int    y,
int    cols,
int    rows,
string    text = "",
int    flags = TA_NONE,
int    maxlength = -1
 

CTextArea::~CTextArea  
 


Member Function Documentation

void CTextArea::addChar char    c
 

Adds a character to the text in the textarea.

void CTextArea::addStr string    str
 

Adds a string to the text in the textarea.

void CTextArea::draw CGfxScreen   s [virtual]
 

Draw method - The widget should draw itslelf to the passed CGfxScreen.

This will be called when the screen is being redrawn. The widget should draw itself using its m_x and m_y members as a starting co-ordinate. The drawing should be all on the passed CGfxScreen or the front lcd screen with libdj.TextScreen

Reimplemented from CWidget.

int CTextArea::getMax   [virtual]
 

Returns maximum value of the scroll region.

Reimplemented from CScrollable.

int CTextArea::getMin   [virtual]
 

Returns minimum value of the scroll region.

Reimplemented from CScrollable.

int CTextArea::getPos   [virtual]
 

Returns current position in the scroll region.

Reimplemented from CScrollable.

string CTextArea::getText  
 

Returns the text in the textarea.

void CTextArea::remChar int    num = 1
 

Removes num characters in the textarea (defaults to one).

void CTextArea::scrollDown   [virtual]
 

Scrolls down one.

Reimplemented from CScrollable.

void CTextArea::scrollUp   [virtual]
 

Scrolls up one.

Reimplemented from CScrollable.

void CTextArea::setPos int    pos [virtual]
 

Sets the current item/line to be selected.

Reimplemented from CScrollable.

void CTextArea::setText string    text
 

Sets the text of the text area.

int CTextArea::update CInputEvent   e [virtual]
 

Update method - Recieves a CInputEvent, returns 1 if redraw is needed, 0 if not.

All keyboard and mouse (stylus) events are sent to this function. If the widget wants to trap the events, it can, and must return 1 if the screen needs to be redrawn and 0 if it does not (ie nothing happened or the action did not change the screen)

Reimplemented from CWidget.


Member Data Documentation

list<string> CTextArea::m_displist
 

int CTextArea::m_liststart
 

int CTextArea::m_maxlength
 

string CTextArea::m_text
 


The documentation for this class was generated from the following files:
Generated on Thu Dec 6 00:14:58 2001 for Dijinni by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001