FLTK: Fl_Timer.H Source File

FLTK

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