Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Fl_Clock.h

00001 /*
00002  * $Id: Fl_Clock.h,v 1.4 2003/03/29 17:39:13 parshin Exp $
00003  *
00004  * Extended Fast Light Toolkit (EFLTK)
00005  * Copyright (C) 2002-2003 by EDE-Team
00006  * WWW: http://www.sourceforge.net/projects/ede
00007  *
00008  * Fast Light Toolkit (FLTK)
00009  * Copyright (C) 1998-2003 by Bill Spitzak and others.
00010  * WWW: http://www.fltk.org
00011  *
00012  * This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00013  * version 2. See COPYING for details.
00014  *
00015  * Author : Mikko Lahteenmaki
00016  * Email  : mikko@fltk.net
00017  *
00018  * Please report all bugs and problems to "efltk-bugs@fltk.net"
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);    // set to this Unix time
00037     void value(int,int,int);    // set hour, minute, second
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); // part of draw
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

Generated on Thu Jul 31 15:33:43 2003 for eFLTK by doxygen1.2.15