"Fossies" - the Fresh Open Source Software archive

Member "fltk-1.3.2/documentation/html/Fl__Clock_8H_source.html" of archive fltk-1.3.2-docs-html.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. Alternatively you can here view or download the uninterpreted source code. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.

FLTK 1.3.2
Fl_Clock.H
00001 //
00002 // "$Id: Fl_Clock.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
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: Fl_Clock.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
00128 //