FLTK 1.4.0
Loading...
Searching...
No Matches
Fl_Timer.H
1//
2// Timer header file for the Fast Light Tool Kit (FLTK).
3//
4// Copyright 1998-2010 by Bill Spitzak and others.
5//
6// This library is free software. Distribution and use rights are outlined in
7// the file "COPYING" which should have been included with this file. If this
8// file is missing or damaged, see the license at:
9//
10// https://www.fltk.org/COPYING.php
11//
12// Please see the following page on how to report bugs and issues:
13//
14// https://www.fltk.org/bugs.php
15//
16
17/* \file
18 Fl_Timer widget . */
19
20#ifndef Fl_Timer_H
21#define Fl_Timer_H
22
23#ifndef Fl_Widget_H
24#include "Fl_Widget.H"
25#endif
26
27// values for type():
28#define FL_NORMAL_TIMER 0
29#define FL_VALUE_TIMER 1
30#define FL_HIDDEN_TIMER 2
31
39class FL_EXPORT Fl_Timer : public Fl_Widget {
40 static void stepcb(void *);
41 void step();
42 char on, direction_;
43 double delay, total;
44 long lastsec,lastusec;
45protected:
46 void draw() FL_OVERRIDE;
47public:
48 int handle(int) FL_OVERRIDE;
49 Fl_Timer(uchar t,int x,int y,int w,int h, const char *l);
50 ~Fl_Timer();
51 void value(double);
53 double value() const {return delay>0.0?delay:0.0;}
59 char direction() const {return direction_;}
65 void direction(char d) {direction_ = d;}
67 char suspended() const {return !on;}
68 void suspended(char d);
69};
70
71#endif
72
Fl_Widget and Fl_Label classes.
This is provided only to emulate the Forms Timer widget.
Definition Fl_Timer.H:39
char suspended() const
Gets or sets whether the timer is suspended.
Definition Fl_Timer.H:67
double value() const
See void Fl_Timer::value(double)
Definition Fl_Timer.H:53
void direction(char d)
Gets or sets the direction of the timer.
Definition Fl_Timer.H:65
char direction() const
Gets or sets the direction of the timer.
Definition Fl_Timer.H:59
Fl_Widget is the base class for all widgets in FLTK.
Definition Fl_Widget.H:104
virtual void draw()=0
Draws the widget.
virtual int handle(int event)
Handles the specified event.
Definition Fl_Widget.cxx:102
#define FL_OVERRIDE
This macro makes it safe to use the C++11 keyword override with older compilers.
Definition fl_attr.h:46
unsigned char uchar
unsigned char
Definition fl_types.h:30