#include <CUI.h>
Inheritance diagram for CWidget::
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... |
Base class for widgets. All widgets need to inherit from this and impliment the draw and update methods
|
Widget constructor.
|
|
Widget destructor.
|
|
Disable widget (dont draw, dont update).
|
|
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. |
|
Enable widget.
|
|
Returns the x position of the widget.
|
|
Returns the y position of the widget.
|
|
Return true if widget is enabled.
|
|
Enable/disable widget.
|
|
Sets the x position of the widget.
|
|
Sets the y position of the widget.
Reimplemented in CScrollBar. |
|
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. |
|
enabled flag .. false, widget will effectivly not be on the panel.
|
|
Widget ID (set by CPanel->add_widget).
|
|
pointer to next widget - handled by panel so widgets should _never_ touch this.
|
|
x coord of upper-left corner of widget.
|
|
x size of widget. for internal widget use.
|
|
y coord of upper-left corner of widget.
|
|
y size of widget. for internal widget use.
|