#include <CountDownWidget.h>

Public Slots | |
| void | cancel () |
| Cancel the count down. | |
Public Member Functions | |
| CountDownWidget (int start, int stop, unsigned msec, WContainerWidget *parent=0) | |
| Create a new CountDownWidget. | |
Public Attributes | |
| Wt::Signal< void > | done |
| Signal emitted when the countdown reached stop. | |
Private Slots | |
| void | timerTick () |
| Process one timer tick. | |
Private Attributes | |
| int | start_ |
| int | stop_ |
| unsigned | msec_ |
| int | current_ |
| WTimer * | timer_ |
Definition at line 25 of file CountDownWidget.h.
| CountDownWidget::CountDownWidget | ( | int | start, | |
| int | stop, | |||
| unsigned | msec, | |||
| WContainerWidget * | parent = 0 | |||
| ) |
Create a new CountDownWidget.
The widget will count down from start to stop, decrementing the number every msec milliseconds.
Definition at line 12 of file CountDownWidget.C.
00014 : WText(parent), 00015 start_(start), 00016 stop_(stop) 00017 { 00018 stop_ = std::min(start_ - 1, stop_); // stop must be smaller than start 00019 current_ = start_; 00020 00021 timer_ = new WTimer(this); 00022 timer_->setInterval(msec); 00023 timer_->timeout.connect(SLOT(this, CountDownWidget::timerTick)); 00024 timer_->start(); 00025 00026 setText(boost::lexical_cast<std::wstring>(current_)); 00027 }
| void CountDownWidget::cancel | ( | ) | [slot] |
| void CountDownWidget::timerTick | ( | ) | [private, slot] |
int CountDownWidget::start_ [private] |
Definition at line 51 of file CountDownWidget.h.
int CountDownWidget::stop_ [private] |
Definition at line 52 of file CountDownWidget.h.
unsigned CountDownWidget::msec_ [private] |
Definition at line 53 of file CountDownWidget.h.
int CountDownWidget::current_ [private] |
Definition at line 55 of file CountDownWidget.h.
WTimer* CountDownWidget::timer_ [private] |
Definition at line 57 of file CountDownWidget.h.
1.5.6