vdk 2.4.0
vdkgnomededit.h
00001 /*
00002  * ===========================
00003  * VDK Visual Develeopment Kit
00004  * Version 1.0.4
00005  * December 1999
00006  * ===========================
00007  *
00008  * Copyright (C) 1998, Mario Motta
00009  * Developed by Mario Motta <mmotta@guest.net>
00010  *
00011  * This library is free software; you can redistribute it and/or
00012  * modify it under the terms of the GNU Library General Public
00013  * License as published by the Free Software Foundation; either
00014  * version 2 of the License, or (at your option) any later version.
00015  *
00016  * This library is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  * Library General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Library General Public
00022  * License along with this library; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00024  * 02111-1307, USA.
00025  */
00026 
00027 #ifndef GNOME_DATE_EDIT_H
00028 #define GNOME_DATE_EDIT_H
00029 
00030 #if HAVE_GNOME
00031 #include <vdk/vdkobj.h>
00032 #include <vdk/vdkdate.h>
00033 #include <gnome.h>
00034 class VDKForm;
00046 class VDKGnomeDateEdit: public VDKObject
00047 {
00048  protected:
00049     VDKObjectSignal s_activated;
00050     void ConnectSignals();
00051     static int FocusInEvent(GtkWidget *,
00052                             GdkEventFocus *,
00053                             gpointer wid);
00054     static int FocusOutEvent(GtkWidget *,
00055                             GdkEventFocus *,
00056                             gpointer wid);
00057     static void HandleDateChange(GtkWidget *wid, gpointer gp);
00058     static void HandleTimeChange(GtkWidget *wid, gpointer gp);
00059     // either mmddyyyy or ddmmyyyy      
00060     // reserved for future use,
00061     // doesn't work now, waiting for i18n
00062     // of gnome date edit widget.
00063     int mode;
00064  public:
00068     VDKReadWriteValueProp<VDKGnomeDateEdit, time_t> AbsoluteTime;
00072     VDKReadWriteValueProp<VDKGnomeDateEdit, calendardate> Date;
00080     VDKGnomeDateEdit(VDKForm* owner,
00081                      time_t the_time = (time_t) NULL,
00082                      bool show_time = false,
00083                      bool format24 = true,
00084                      int mode = mmddyyyy);
00094     VDKGnomeDateEdit(VDKForm* owner,
00095                      char* the_date = NULL,
00096                      bool show_time = false,
00097                      bool format24 = true,
00098                      int mode = mmddyyyy);
00102  virtual ~VDKGnomeDateEdit();
00107  void SetAbsoluteTime(time_t t)
00108    {
00109      gnome_date_edit_set_time (GNOME_DATE_EDIT(Widget()), t);
00110    }
00114  time_t GetAbsoluteTime()
00115    {
00116      return gnome_date_edit_get_date (GNOME_DATE_EDIT(Widget()));
00117    }
00122  void SetDate(calendardate d);
00126  calendardate GetDate();        
00127 };
00128 #endif
00129 
00130 #endif