Wt examples  4.2.2
CountDownWidget.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008 Emweb bv, Herent, Belgium.
3  *
4  * See the LICENSE file for terms of use.
5  */
6 // This may look like C code, but it's really -*- C++ -*-
7 #ifndef WCOUNTDOWNWIDGET_H_
8 #define WCOUNTDOWNWIDGET_H_
9 
10 #include <Wt/WText.h>
11 #include <Wt/WTimer.h>
12 
13 namespace Wt {
14  class WTimer;
15 }
16 
17 using namespace Wt;
18 
23 
26 class CountDownWidget : public WText
27 {
28 public:
34  CountDownWidget(int start, int stop, std::chrono::milliseconds msec);
35 
38  Signal<>& done() { return done_; }
39 
42  void cancel();
43 
44 private:
46  int start_;
47  int stop_;
48 
49  int current_;
50 
51  std::unique_ptr<WTimer> timer_;
52 
55  void timerTick();
56 };
57 
60 #endif // WCOUNTDOWNWIDGET_H_
Wt::WTimer
Wt
CountDownWidget::stop_
int stop_
Definition: CountDownWidget.h:47
CountDownWidget
A widget which displays a decrementing number.
Definition: CountDownWidget.h:26
Wt::Signal
CountDownWidget::done_
Signal done_
Definition: CountDownWidget.h:45
CountDownWidget::start_
int start_
Definition: CountDownWidget.h:46
CountDownWidget::timer_
std::unique_ptr< WTimer > timer_
Definition: CountDownWidget.h:51
CountDownWidget::current_
int current_
Definition: CountDownWidget.h:49
CountDownWidget::done
Signal & done()
Signal emitted when the countdown reached stop.
Definition: CountDownWidget.h:38
Wt::WText

Generated on Fri Mar 20 2020 for the C++ Web Toolkit (Wt) by doxygen 1.8.17