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

CListBox Class Reference

Listbox widget. More...

#include <CUI.h>

Inheritance diagram for CListBox::

CWidget CScrollable List of all members.

Public Methods

 CListBox (int x, int y, int cols, int rows, Callback callback)
 Constructor. More...

 ~CListBox ()
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 insertItem (string caption)
string getItem (int pos)
string getCurItem ()
void clear ()
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

list< string > m_list
Callback m_callback
int m_liststart
int m_curpos

Detailed Description

Listbox widget.

Listbox widget for displaying a bunch of items


Constructor & Destructor Documentation

CListBox::CListBox int    x,
int    y,
int    cols,
int    rows,
Callback    callback
 

Constructor.

Parameters:
x  X position on panel
y  Y position on panel
cols  Number of columns to display
rows  Number of rows to display
callback  Callback function to call when an item is selected

CListBox::~CListBox  
 


Member Function Documentation

void CListBox::clear  
 

void CListBox::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.

string CListBox::getCurItem  
 

string CListBox::getItem int    pos
 

int CListBox::getMax   [virtual]
 

Returns maximum value of the scroll region.

Reimplemented from CScrollable.

int CListBox::getMin   [virtual]
 

Returns minimum value of the scroll region.

Reimplemented from CScrollable.

int CListBox::getPos   [virtual]
 

Returns current position in the scroll region.

Reimplemented from CScrollable.

void CListBox::insertItem string    caption
 

void CListBox::scrollDown   [virtual]
 

Scrolls down one.

Reimplemented from CScrollable.

void CListBox::scrollUp   [virtual]
 

Scrolls up one.

Reimplemented from CScrollable.

void CListBox::setPos int    pos [virtual]
 

Sets the current item/line to be selected.

Reimplemented from CScrollable.

int CListBox::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

Callback CListBox::m_callback
 

int CListBox::m_curpos
 

list<string> CListBox::m_list
 

int CListBox::m_liststart
 


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