FLTK 1.3.2
Fl_Timer.H
00001 //
00002 // "$Id$"
00003 //
00004 // Timer header file for the Fast Light Tool Kit (FLTK).
00005 //
00006 // Copyright 1998-2010 by Bill Spitzak and others.
00007 //
00008 // This library is free software. Distribution and use rights are outlined in
00009 // the file "COPYING" which should have been included with this file.  If this
00010 // file is missing or damaged, see the license at:
00011 //
00012 //     http://www.fltk.org/COPYING.php
00013 //
00014 // Please report all bugs and problems on the following page:
00015 //
00016 //     http://www.fltk.org/str.php
00017 //
00018 
00019 /* \file
00020    Fl_Timer widget . */
00021 
00022 #ifndef Fl_Timer_H
00023 #define Fl_Timer_H
00024 
00025 #ifndef Fl_Widget_H
00026 #include "Fl_Widget.H"
00027 #endif
00028 
00029 // values for type():
00030 #define FL_NORMAL_TIMER         0
00031 #define FL_VALUE_TIMER          1
00032 #define FL_HIDDEN_TIMER         2
00033 
00041 class FL_EXPORT Fl_Timer : public Fl_Widget {
00042   static void stepcb(void *);
00043   void step();
00044   char on, direction_;
00045   double delay, total;
00046   long lastsec,lastusec;
00047 protected:
00048   void draw();
00049 public:
00050   int handle(int);
00051   Fl_Timer(uchar t,int x,int y,int w,int h, const char *l);
00052   ~Fl_Timer();
00053   void value(double);
00055   double value() const {return delay>0.0?delay:0.0;}
00061   char direction() const {return direction_;}
00067   void direction(char d) {direction_ = d;}
00069   char suspended() const {return !on;}
00070   void suspended(char d);
00071 };
00072 
00073 #endif
00074 
00075 //
00076 // End of "$Id$".
00077 //
00078