• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • File List
  • File Members

Fl_Clock.H

00001 //
00002 // "$Id$"
00003 //
00004 // Clock 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_Clock, Fl_Clock_Output widgets . */
00021 
00022 #ifndef Fl_Clock_H
00023 #define Fl_Clock_H
00024 
00025 #ifndef Fl_Widget_H
00026 #include "Fl_Widget.H"
00027 #endif
00028 
00029 // values for type:
00030 #define FL_SQUARE_CLOCK         0       
00031 #define FL_ROUND_CLOCK          1       
00032 #define FL_ANALOG_CLOCK FL_SQUARE_CLOCK 
00033 #define FL_DIGITAL_CLOCK FL_SQUARE_CLOCK 
00035 // fabien: Please keep the horizontal formatting of both images in class desc, 
00036 // don't lose vert. space for nothing!
00037 
00054 class FL_EXPORT Fl_Clock_Output : public Fl_Widget {
00055   int hour_, minute_, second_;
00056   ulong value_;
00057   void drawhands(Fl_Color,Fl_Color); // part of draw
00058 protected:
00059   void draw();
00060   void draw(int X, int Y, int W, int H);
00061 public:
00062 
00063   Fl_Clock_Output(int X, int Y, int W, int H, const char *L = 0);
00064 
00065   void value(ulong v);  // set to this Unix time
00066   
00067   void value(int H, int m, int s);
00068 
00074   ulong value() const {return value_;}
00075 
00080   int hour() const {return hour_;}
00081 
00086   int minute() const {return minute_;}
00087 
00092   int second() const {return second_;}
00093 };
00094 
00095 // a Fl_Clock displays the current time always by using a timeout:
00096 
00113 class FL_EXPORT Fl_Clock : public Fl_Clock_Output {
00114 public:
00115   int handle(int);
00116 
00117   Fl_Clock(int X, int Y, int W, int H,  const char *L = 0);
00118   
00119   Fl_Clock(uchar t, int X, int Y, int W, int H, const char *L);
00120   
00121   ~Fl_Clock();
00122 };
00123 
00124 #endif
00125 
00126 //
00127 // End of "$Id$".
00128 //
  • © 1998-2016 by Bill Spitzak and others.     FLTK

  • © 1998-2016 by Bill Spitzak and others.     FLTK

    Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.