Fl_Clock.H
//
// "$Id: Fl_Clock.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
//
// Clock header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2010 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
// file is missing or damaged, see the license at:
//
// http://www.fltk.org/COPYING.php
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
/* \file
Fl_Clock, Fl_Clock_Output widgets . */
#ifndef Fl_Clock_H
#define Fl_Clock_H
#ifndef Fl_Widget_H
#include "Fl_Widget.H"
#endif
// values for type:
#define FL_SQUARE_CLOCK 0
#define FL_ROUND_CLOCK 1
#define FL_ANALOG_CLOCK FL_SQUARE_CLOCK
#define FL_DIGITAL_CLOCK FL_SQUARE_CLOCK
// fabien: Please keep the horizontal formatting of both images in class desc,
// don't lose vert. space for nothing!
class FL_EXPORT Fl_Clock_Output : public Fl_Widget {
int hour_, minute_, second_;
ulong value_;
void drawhands(Fl_Color,Fl_Color); // part of draw
protected:
void draw();
void draw(int X, int Y, int W, int H);
public:
Fl_Clock_Output(int X, int Y, int W, int H, const char *L = 0);
void value(ulong v); // set to this Unix time
void value(int H, int m, int s);
ulong value() const {return value_;}
int hour() const {return hour_;}
int minute() const {return minute_;}
int second() const {return second_;}
};
// a Fl_Clock displays the current time always by using a timeout:
class FL_EXPORT Fl_Clock : public Fl_Clock_Output {
public:
int handle(int);
Fl_Clock(int X, int Y, int W, int H, const char *L = 0);
Fl_Clock(uchar t, int X, int Y, int W, int H, const char *L);
~Fl_Clock();
};
#endif
//
// End of "$Id: Fl_Clock.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
//
- © 1998-2012 by Bill Spitzak and others.