00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _FL_CLOCK_H_
00023 #define _FL_CLOCK_H_
00024
00025 #include "Fl_Widget.h"
00026
00030 class FL_API Fl_Clock_Output : public Fl_Widget {
00031 public:
00032 enum { SQUARE = 0, ANALOG = 0, ROUND, DIGITAL };
00033 Fl_Clock_Output(int x,int y,int w,int h, const char *l = 0);
00034 Fl_Clock_Output(const char* l = 0,int layout_size=30,Fl_Align layout_al=FL_ALIGN_TOP,int label_w=-1);
00035
00036 void value(ulong v);
00037 void value(int,int,int);
00038
00039 ulong value() const {return value_;}
00040 int hour() const {return hour_;}
00041 int minute() const {return minute_;}
00042 int second() const {return second_;}
00043
00044 virtual void draw();
00045 private:
00046 void draw(int, int, int, int);
00047 void drawhands(Fl_Color,Fl_Color);
00048
00049 void ctor_init();
00050
00051 int hour_, minute_, second_;
00052 ulong value_;
00053 };
00054
00058 class FL_API Fl_Clock : public Fl_Clock_Output {
00059 public:
00060 static Fl_Named_Style* default_style;
00061
00063 Fl_Clock(int x,int y,int w,int h, const char *l = 0)
00064 : Fl_Clock_Output(x, y, w, h, l) {}
00065
00067 Fl_Clock(const char* l = 0,int layout_size=100,Fl_Align layout_al=FL_ALIGN_TOP,int label_w=-1)
00068 : Fl_Clock_Output(l,layout_size,layout_al,label_w) {}
00069
00070 virtual ~Fl_Clock();
00071
00072 void update();
00073 virtual int handle(int);
00074 };
00075
00076 #endif