FLTK 1.4.4

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
39 class 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;
45 protected:
46 void draw() FL_OVERRIDE;
47 public:
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.H
Fl_Widget and Fl_Label classes.
Fl_Timer::suspended
char suspended() const
Gets or sets whether the timer is suspended.
Definition Fl_Timer.H:67
Fl_Timer::value
void value(double)
Sets the current timer value.
Definition forms_timer.cxx:127
Fl_Timer::value
double value() const
See void Fl_Timer::value(double)
Definition Fl_Timer.H:53
Fl_Timer::Fl_Timer
Fl_Timer(uchar t, int x, int y, int w, int h, const char *l)
Creates a new Fl_Timer widget using the given type, position, size, and label string.
Definition forms_timer.cxx:114
Fl_Timer::direction
void direction(char d)
Gets or sets the direction of the timer.
Definition Fl_Timer.H:65
Fl_Timer::direction
char direction() const
Gets or sets the direction of the timer.
Definition Fl_Timer.H:59
Fl_Widget::draw
virtual void draw()=0
Draws the widget.
Fl_Widget::handle
virtual int handle(int event)
Handles the specified event.
Definition Fl_Widget.cxx:102
Fl_Widget::x
void x(int v)
Internal use only.
Definition Fl_Widget.H:150
Fl_Widget::w
void w(int v)
Internal use only.
Definition Fl_Widget.H:154
Fl_Widget::y
void y(int v)
Internal use only.
Definition Fl_Widget.H:152
Fl_Widget::h
void h(int v)
Internal use only.
Definition Fl_Widget.H:156
FL_OVERRIDE
#define FL_OVERRIDE
This macro makes it safe to use the C++11 keyword override with older compilers.
Definition fl_attr.h:46
uchar
unsigned char uchar
unsigned char
Definition fl_types.h:30