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

Fl_Date_Time_Input.h

00001 /*
00002  * $Id: Fl_Date_Time_Input.h,v 1.11 2003/04/15 15:19:17 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 : Alexey Parshin
00016  * Email  : alexey@fltk.net
00017  *
00018  * Please report all bugs and problems to "efltk-bugs@fltk.net"
00019  *
00020  */
00021 
00022 #ifndef _FL_DATE_TIME_INPUT_H_
00023 #define _FL_DATE_TIME_INPUT_H_
00024 
00025 #include "Fl_Group.h"
00026 #include "Fl_Date_Time.h"
00027 
00028 class Fl_Masked_Input;
00029 class Fl_Calendar_Button;
00030 
00032 class FL_API Fl_Date_Input : public Fl_Group {
00033 public:
00034     static Fl_Named_Style* default_style;
00035 
00037     Fl_Date_Input(int,int,int,int,const char * = 0);
00038 
00040     Fl_Date_Input(const char* l = 0,int layout_size=30,Fl_Align layout_al=FL_ALIGN_TOP,int label_w=100);
00041 
00042     void value(const char *);
00043     const char *value();
00044 
00045     void date_value(Fl_Date_Time);
00046     Fl_Date_Time date_value() const;
00047 
00048     virtual void draw();
00049     virtual void preferred_size(int& w,int &h) const;
00050     virtual void reset() { value(""); }
00051 
00052     // Data source support
00053     virtual bool load_data(Fl_Data_Source *ds);
00054     virtual bool save_data(Fl_Data_Source *ds);
00055 
00056 protected:
00057     static void input_callback(Fl_Widget *,void *);
00058     static void button_callback(Fl_Widget *,void *);
00059 
00060     void ctor_init();
00061 
00062     Fl_Masked_Input     *m_input;
00063     Fl_Calendar_Button  *m_button;
00064 };
00065 
00066 class FL_API Fl_Date_Time_Input : public Fl_Date_Input {
00067 public:
00068     static Fl_Named_Style* default_style;
00069 
00071     Fl_Date_Time_Input(int,int,int,int,const char * = 0);
00072 
00074     Fl_Date_Time_Input(const char* l = 0,int layout_size=30,Fl_Align layout_al=FL_ALIGN_TOP,int label_w=100);
00075 
00076     void value(const char *);
00077     const char *value();
00078 
00079     void date_time_value(Fl_Date_Time);
00080     Fl_Date_Time date_time_value() const;
00081 
00082     virtual void reset() { value(""); }
00083     virtual void draw();
00084     virtual void preferred_size(int& w,int &h) const;
00085 
00087     virtual bool load_data(Fl_Data_Source *ds);
00088     virtual bool save_data(Fl_Data_Source *ds);
00089 
00090 protected:
00091     Fl_Masked_Input  *m_timeInput;
00092     char              m_buffer[20];
00093 
00094     void ctor_init();
00095 };
00096 
00097 class FL_API Fl_Date_Interval_Input : public Fl_Date_Input {
00098 public:
00099     static Fl_Named_Style* default_style;
00100 
00102     Fl_Date_Interval_Input(int,int,int,int,const char * = 0);
00103 
00105     Fl_Date_Interval_Input(const char* l = 0,int layout_size=30,Fl_Align layout_al=FL_ALIGN_TOP,int label_w=100);
00106 
00107     void value2(const char *);
00108     const char *value2();
00109 
00110     void field_name2(const char *f) { m_fieldName2 = f; }
00111     const Fl_String& field_name2() const { return m_fieldName2; }
00112 
00113     void date_value2(Fl_Date_Time);
00114     Fl_Date_Time date_value2() const;
00115 
00116     virtual void reset() { value(""); value2(""); }
00117     virtual void draw();
00118     virtual void preferred_size(int& w,int &h) const;
00119 
00120     // Data source support
00121     virtual bool load_data(Fl_Data_Source *ds);
00122     virtual bool save_data(Fl_Data_Source *ds);
00123 
00124 protected:
00125 
00126     Fl_String                m_fieldName2;
00127     Fl_Masked_Input     *m_input2;
00128     Fl_Calendar_Button  *m_button2;
00129 
00130     void ctor_init();
00131 };
00132 
00133 #endif

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