diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2003-10-17 15:35:43 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2003-10-17 15:35:43 +0000 |
| commit | fc2f5b2cd655f1391f2abda1b39e37cdec98a951 (patch) | |
| tree | 312efcea86a319de407a7c314fb981fb1c71019a /lib/gui/multipage.cpp | |
| download | enigma2-fc2f5b2cd655f1391f2abda1b39e37cdec98a951.tar.gz enigma2-fc2f5b2cd655f1391f2abda1b39e37cdec98a951.zip | |
Initial revision
Diffstat (limited to 'lib/gui/multipage.cpp')
| -rw-r--r-- | lib/gui/multipage.cpp | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/lib/gui/multipage.cpp b/lib/gui/multipage.cpp new file mode 100644 index 00000000..e494078d --- /dev/null +++ b/lib/gui/multipage.cpp @@ -0,0 +1,64 @@ +#include <errno.h> +#include <lib/gui/multipage.h> +#include <lib/gui/ewidget.h> + +eMultipage::eMultipage() +{ +} + +int eMultipage::prev() +{ + if (list.current() == list.begin()) + return -ENOENT; + if (list.current() != list.end()) + list.current()->hide(); + list.prev(); + list.current()->show(); + return 0; +} + +int eMultipage::next() +{ + if (list.current() == *--list.end()) + return -ENOENT; + list.current()->hide(); + list.next(); + if (list.current() == list.end()) + return 0; + list.current()->show(); + return 0; +} + +void eMultipage::set(eWidget *widget) +{ + if (list.current() == widget) + return; + if (list.current() != list.end()) + list.current()->hide(); + list.setCurrent(widget); + if (list.current() != list.end()) + list.current()->show(); +} + +void eMultipage::first() +{ + if (list.current() == list.begin()) + return; + if (list.current() != list.end()) + list.current()->hide(); + list.first(); + if (list.current() != list.end()) + list.current()->show(); +} + +int eMultipage::at() +{ + int num=0; + for (ePtrList<eWidget>::iterator i(list.begin()); (i != list.end()) && (i != list.current()); ++i, ++num) ; + return num; +} + +void eMultipage::addPage(eWidget *page) +{ + list.push_back(page); +} |
