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

CWidget Class Reference

Abstract class all widgets need to inherit from. More...

#include <CUI.h>

Inheritance diagram for CWidget::

CButton CCalendarWidget CGfxWidget CKbd CLabel CListBox CScrollBar CSketchView CTabView CTextArea List of all members.

Public Methods

 CWidget ()
 Widget constructor. More...

 ~CWidget ()
 Widget destructor. More...

virtual int getX ()
 Returns the x position of the widget. More...

virtual int getY ()
 Returns the y position of the widget. More...

virtual void setX (int x)
 Sets the x position of the widget. More...

virtual void setY (int y)
 Sets the y position of the widget. More...

virtual int update (CInputEvent *e)=0
 Update method - Recieves a CInputEvent, returns 1 if redraw is needed, 0 if not. More...

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

void enable ()
 Enable widget. More...

void disable ()
 Disable widget (dont draw, dont update). More...

void setEnabled (bool enabled)
 Enable/disable widget. More...

bool isEnabled ()
 Return true if widget is enabled. More...


Public Attributes

int m_ID
 Widget ID (set by CPanel->add_widget). More...

CWidget * m_next
 pointer to next widget - handled by panel so widgets should _never_ touch this. More...


Protected Attributes

int m_xsize
 x size of widget. for internal widget use. More...

int m_ysize
 y size of widget. for internal widget use. More...

int m_x
 x coord of upper-left corner of widget. More...

int m_y
 y coord of upper-left corner of widget. More...

bool m_enabled
 enabled flag .. false, widget will effectivly not be on the panel. More...


Detailed Description

Abstract class all widgets need to inherit from.

Base class for widgets. All widgets need to inherit from this and impliment the draw and update methods


Constructor & Destructor Documentation

CWidget::CWidget  
 

Widget constructor.

CWidget::~CWidget  
 

Widget destructor.


Member Function Documentation

void CWidget::disable  
 

Disable widget (dont draw, dont update).

virtual void CWidget::draw CGfxScreen   s [pure 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 in CPersonView, CPersonEdit, CDateView, CEventView, CSketchView, CGfxWidget, CButton, CLabel, CKbd, CTabView, CListBox, CTextArea, CScrollBar, CCalendarWidget, and CNiceBars.

void CWidget::enable  
 

Enable widget.

int CWidget::getX   [virtual]
 

Returns the x position of the widget.

int CWidget::getY   [virtual]
 

Returns the y position of the widget.

bool CWidget::isEnabled  
 

Return true if widget is enabled.

void CWidget::setEnabled bool    enabled
 

Enable/disable widget.

void CWidget::setX int    x [virtual]
 

Sets the x position of the widget.

void CWidget::setY int    y [virtual]
 

Sets the y position of the widget.

Reimplemented in CScrollBar.

virtual int CWidget::update CInputEvent   e [pure 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 in CSketchView, CGfxWidget, CButton, CLabel, CKbd, CTabView, CListBox, CTextArea, CScrollBar, and CCalendarWidget.


Member Data Documentation

bool CWidget::m_enabled [protected]
 

enabled flag .. false, widget will effectivly not be on the panel.

int CWidget::m_ID
 

Widget ID (set by CPanel->add_widget).

CWidget* CWidget::m_next
 

pointer to next widget - handled by panel so widgets should _never_ touch this.

int CWidget::m_x [protected]
 

x coord of upper-left corner of widget.

int CWidget::m_xsize [protected]
 

x size of widget. for internal widget use.

int CWidget::m_y [protected]
 

y coord of upper-left corner of widget.

int CWidget::m_ysize [protected]
 

y size of widget. for internal widget use.


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