|
Snoke
|
#include <widget.h>


Public Member Functions | |
| virtual void | draw () |
| void | _parent (Widget *parentWidget) |
| Widget * | firstChild () |
| Widget * | lastChild () |
| Widget * | parent () |
| void | _next (Widget *nextWidget) |
| Widget * | next () |
| void | _previous (Widget *previousWidget) |
| Widget * | previous () |
| void | add (Widget *child) |
| unsigned short | childLength () |
| std::vector< Widget * > | children () |
| bool | event (unsigned char name) |
| void | listener (unsigned char name, Listener function) |
| void | dispatch (unsigned char name) |
| Widget () | |
Public Attributes | |
| Widget * | parentWidget |
| Widget * | start |
| Widget * | ending |
| Widget * | nextWidget |
| Widget * | previousWidget |
| unsigned short | length |
| unsigned char | events |
| std::map< unsigned char, std::list< Listener > > | listeners |
Basic class of the console widget (to store different widgets in one list) Contains widgets tree for parsing events by Console class
| {Widget*} | parentWidget - parent widget |
| {Widget*} | start - pointer to the first child of current widget |
| {Widget*} | ending - pointer to the last child of current widget |
| {Widget*} | nextWidget - pointer to the next sibling |
| {Widget*} | previousWidget - pointer to the previous sibling |
| {unsigned | short} length - amount of children |
| {unsigned | char} events - binary store for events could be dispatched at current widget |
| {std::map<unsigned | char, std::list<Listener>>} listeners - store for event listeners |
| Widget::Widget | ( | ) |
Definition at line 172 of file widget.cpp.
| void Widget::_next | ( | Widget * | nextWidget | ) |
Sets next widget
| {Widget*} | nextWidget - new next widget |
Definition at line 50 of file widget.cpp.

| void Widget::_parent | ( | Widget * | parentWidget | ) |
Setter for parent property
| {Widget*} | parentWidget - new parent widget |
Definition at line 14 of file widget.cpp.

| void Widget::_previous | ( | Widget * | previousWidget | ) |
Sets previous widget
| {Widget*} | previousWidget - new previous widget |
Definition at line 68 of file widget.cpp.

| void Widget::add | ( | Widget * | child | ) |
Adds a new child to the current widget
| {Widget*} | child - new child widget |
Definition at line 86 of file widget.cpp.


| unsigned short Widget::childLength | ( | ) |
Returns amount of children
Definition at line 112 of file widget.cpp.

| std::vector< Widget * > Widget::children | ( | ) |
Returns array of child widgets
Definition at line 121 of file widget.cpp.

| void Widget::dispatch | ( | unsigned char | name | ) |
Dispatches event on widget Calls all event listeners binded on given event to the widget
| {unsigned | char} name - name of the event |
Definition at line 161 of file widget.cpp.

|
virtual |
Drawing widget method
Reimplemented in Menu, and MenuItem.
Definition at line 7 of file widget.cpp.

| bool Widget::event | ( | unsigned char | name | ) |
Checks if event is dispatchable
| {unsigned | char} name - name of the event |
Definition at line 140 of file widget.cpp.

| Widget * Widget::firstChild | ( | ) |
Returns first child of widget
Definition at line 32 of file widget.cpp.

| Widget * Widget::lastChild | ( | ) |
Returns last child of widget
Definition at line 41 of file widget.cpp.

| void Widget::listener | ( | unsigned char | name, |
| Listener | function | ||
| ) |
Sets listener to the event
| {unsigned | char} name - name of the event |
| {Listener} | function - event listener function |
Definition at line 150 of file widget.cpp.

| Widget * Widget::next | ( | ) |
Getter for next widget
Definition at line 59 of file widget.cpp.

| Widget * Widget::parent | ( | ) |
Getter for parent property
Definition at line 23 of file widget.cpp.

| Widget * Widget::previous | ( | ) |
Getter for previous widget
Definition at line 77 of file widget.cpp.

| std::map<unsigned char, std::list<Listener> > Widget::listeners |