<SECTION>
<FILE>gtkdateentry</FILE>
<TITLE>GtkDateEntry</TITLE>
-GTK_TYPE_DATE_ENTRY
-GTK_DATE_ENTRY
-GTK_DATE_ENTRY_CLASS
-GTK_DATE_ENTRY_GET_CLASS
GtkDateEntry
GtkDateEntryClass
-gtk_date_entry_new
-gtk_date_entry_set_separator
-gtk_date_entry_set_format
-gtk_date_entry_get_text
+gtk_date_entry_get_gdate
+gtk_date_entry_get_gdatetime
+gtk_date_entry_get_sql
gtk_date_entry_get_strf
+gtk_date_entry_get_text
gtk_date_entry_get_tm
-gtk_date_entry_get_gdate
+gtk_date_entry_is_date_visible
+gtk_date_entry_is_time_visible
+gtk_date_entry_is_valid
+gtk_date_entry_new
+gtk_date_entry_set_calendar_button_visible
+gtk_date_entry_set_date_gdate
+gtk_date_entry_set_date_gdatetime
gtk_date_entry_set_date_strf
gtk_date_entry_set_date_tm
-gtk_date_entry_set_date_gdate
-gtk_date_entry_is_valid
+gtk_date_entry_set_date_visible
gtk_date_entry_set_editable
gtk_date_entry_set_editable_with_calendar
-gtk_date_entry_set_calendar_button_visible
+gtk_date_entry_set_format
+gtk_date_entry_set_separator
+gtk_date_entry_set_time_separator
+gtk_date_entry_set_time_visible
<SUBSECTION Standard>
-GTK_IS_DATE
+GTK_DATE_ENTRY
+GTK_DATE_ENTRY_CLASS
+GTK_DATE_ENTRY_GET_CLASS
+GTK_IS_DATE_ENTRY
+GTK_IS_DATE_ENTRY_CLASS
+GTK_TYPE_DATE_ENTRY
gtk_date_entry_get_type
-GTK_IS_DATE_CLASS
</SECTION>
<SECTION>
<FILE>gtkformwidgetdateentry</FILE>
-<TITLE>GtkFormWidgetDateEntry</TITLE>
GtkFormWidgetDateEntry
GtkFormWidgetDateEntryClass
-gtk_form_widget_date_entry_new
-gtk_form_widget_date_entry_get_value_stringify
-gtk_form_widget_date_entry_set_value_stringify
-gtk_form_widget_date_entry_set_editable
<SUBSECTION Standard>
-GTK_FORM_WIDGET_DATE_ENTRY
GTK_FORM_IS_WIDGET_DATE_ENTRY
+GTK_FORM_IS_WIDGET_DATE_ENTRY_CLASS
GTK_FORM_TYPE_WIDGET_DATE_ENTRY
-gtk_form_widget_date_entry_get_type
+GTK_FORM_WIDGET_DATE_ENTRY
GTK_FORM_WIDGET_DATE_ENTRY_CLASS
-GTK_FORM_IS_WIDGET_DATE_ENTRY_CLASS
GTK_FORM_WIDGET_DATE_ENTRY_GET_CLASS
</SECTION>
#define GTK_DATE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_DATE_ENTRY, GtkDateEntry))
</MACRO>
<MACRO>
-<NAME>GTK_IS_DATE</NAME>
-#define GTK_IS_DATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_DATE_ENTRY))
+<NAME>GTK_IS_DATE_ENTRY</NAME>
+#define GTK_IS_DATE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_DATE_ENTRY))
</MACRO>
<MACRO>
-<NAME>GTK_IS_DATE_CLASS</NAME>
-#define GTK_IS_DATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DATE_ENTRY))
+<NAME>GTK_IS_DATE_ENTRY_CLASS</NAME>
+#define GTK_IS_DATE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_DATE_ENTRY))
</MACRO>
<MACRO>
<NAME>GTK_DATE_ENTRY_GET_CLASS</NAME>
</MACRO>
<STRUCT>
<NAME>GtkDateEntry</NAME>
-</STRUCT>
-<STRUCT>
-<NAME>GtkDateEntryClass</NAME>
-</STRUCT>
-<STRUCT>
-<NAME>GtkDateEntry</NAME>
struct _GtkDateEntry
{
- GtkHBox hbox;
+ GtkBin parent;
};
</STRUCT>
<STRUCT>
<NAME>GtkDateEntryClass</NAME>
struct _GtkDateEntryClass
{
- GtkHBoxClass parent_class;
+ GtkBinClass parent_class;
};
</STRUCT>
<FUNCTION>
<NAME>gtk_date_entry_get_type</NAME>
-<RETURNS>GType </RETURNS>
+<RETURNS>GType </RETURNS>
void
</FUNCTION>
<FUNCTION>
<NAME>gtk_date_entry_new</NAME>
-<RETURNS>GtkWidget *</RETURNS>
-const gchar *format, const gchar separator, gboolean calendar_button_is_visible
+<RETURNS>GtkWidget *</RETURNS>
+const gchar *format, const gchar *separator, gboolean calendar_button_is_visible
</FUNCTION>
<FUNCTION>
<NAME>gtk_date_entry_set_separator</NAME>
-<RETURNS>void </RETURNS>
-GtkDateEntry *date, const gchar separator
+<RETURNS>gboolean </RETURNS>
+GtkDateEntry *date, const gchar *separator
+</FUNCTION>
+<FUNCTION>
+<NAME>gtk_date_entry_set_time_separator</NAME>
+<RETURNS>gboolean </RETURNS>
+GtkDateEntry *date, const gchar *separator
</FUNCTION>
<FUNCTION>
<NAME>gtk_date_entry_set_format</NAME>
-<RETURNS>gboolean </RETURNS>
+<RETURNS>gboolean </RETURNS>
GtkDateEntry *date, const gchar *format
</FUNCTION>
<FUNCTION>
<NAME>gtk_date_entry_get_text</NAME>
-<RETURNS>const gchar *</RETURNS>
+<RETURNS>const gchar *</RETURNS>
GtkDateEntry *date
</FUNCTION>
<FUNCTION>
<NAME>gtk_date_entry_get_strf</NAME>
-<RETURNS>const gchar *</RETURNS>
-GtkDateEntry *date, const gchar *format, gchar separator
+<RETURNS>const gchar *</RETURNS>
+GtkDateEntry *date, const gchar *format, const gchar *separator, const gchar *time_separator
+</FUNCTION>
+<FUNCTION>
+<NAME>gtk_date_entry_get_sql</NAME>
+<RETURNS>const gchar *</RETURNS>
+GtkDateEntry *date
</FUNCTION>
<FUNCTION>
<NAME>gtk_date_entry_get_tm</NAME>
-<RETURNS>struct tm *</RETURNS>
+<RETURNS>struct tm *</RETURNS>
GtkDateEntry *date
</FUNCTION>
<FUNCTION>
<NAME>gtk_date_entry_get_gdate</NAME>
-<RETURNS>GDate *</RETURNS>
+<RETURNS>GDate *</RETURNS>
+GtkDateEntry *date
+</FUNCTION>
+<FUNCTION>
+<NAME>gtk_date_entry_get_gdatetime</NAME>
+<RETURNS>GDateTime *</RETURNS>
GtkDateEntry *date
</FUNCTION>
<FUNCTION>
<NAME>gtk_date_entry_set_date_strf</NAME>
-<RETURNS>gboolean </RETURNS>
-GtkDateEntry *date, const gchar *str, const gchar *format, const gchar separator
+<RETURNS>gboolean </RETURNS>
+GtkDateEntry *date, const gchar *str, const gchar *format
</FUNCTION>
<FUNCTION>
<NAME>gtk_date_entry_set_date_tm</NAME>
-<RETURNS>void </RETURNS>
+<RETURNS>void </RETURNS>
GtkDateEntry *date, const struct tm tmdate
</FUNCTION>
<FUNCTION>
<NAME>gtk_date_entry_set_date_gdate</NAME>
-<RETURNS>void </RETURNS>
+<RETURNS>void </RETURNS>
GtkDateEntry *date, const GDate *gdate
</FUNCTION>
<FUNCTION>
+<NAME>gtk_date_entry_set_date_gdatetime</NAME>
+<RETURNS>void </RETURNS>
+GtkDateEntry *date, const GDateTime *gdatetime
+</FUNCTION>
+<FUNCTION>
<NAME>gtk_date_entry_is_valid</NAME>
-<RETURNS>gboolean </RETURNS>
+<RETURNS>gboolean </RETURNS>
GtkDateEntry *date
</FUNCTION>
<FUNCTION>
<NAME>gtk_date_entry_set_editable</NAME>
-<RETURNS>void </RETURNS>
+<RETURNS>void </RETURNS>
GtkDateEntry *date, gboolean is_editable
</FUNCTION>
<FUNCTION>
<NAME>gtk_date_entry_set_editable_with_calendar</NAME>
-<RETURNS>void </RETURNS>
+<RETURNS>void </RETURNS>
GtkDateEntry *date, gboolean is_editable_with_calendar
</FUNCTION>
<FUNCTION>
<NAME>gtk_date_entry_set_calendar_button_visible</NAME>
-<RETURNS>void </RETURNS>
+<RETURNS>void </RETURNS>
+GtkDateEntry *date, gboolean is_visible
+</FUNCTION>
+<FUNCTION>
+<NAME>gtk_date_entry_set_date_visible</NAME>
+<RETURNS>void </RETURNS>
+GtkDateEntry *date, gboolean is_visible
+</FUNCTION>
+<FUNCTION>
+<NAME>gtk_date_entry_is_date_visible</NAME>
+<RETURNS>gboolean </RETURNS>
+GtkDateEntry *date
+</FUNCTION>
+<FUNCTION>
+<NAME>gtk_date_entry_set_time_visible</NAME>
+<RETURNS>void </RETURNS>
GtkDateEntry *date, gboolean is_visible
</FUNCTION>
+<FUNCTION>
+<NAME>gtk_date_entry_is_time_visible</NAME>
+<RETURNS>gboolean </RETURNS>
+GtkDateEntry *date
+</FUNCTION>
<MACRO>
<NAME>GTK_FORM_TYPE_WIDGET_DATE_ENTRY</NAME>
#define GTK_FORM_TYPE_WIDGET_DATE_ENTRY (gtk_form_widget_date_entry_get_type ())
#define GTK_FORM_WIDGET_DATE_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_FORM_TYPE_WIDGET_DATE_ENTRY, GtkFormWidgetDateEntryClass))
</MACRO>
<STRUCT>
-<NAME>GtkFormWidgetDateEntry</NAME>
-</STRUCT>
-<STRUCT>
<NAME>GtkFormWidgetDateEntryClass</NAME>
</STRUCT>
<STRUCT>
<NAME>GtkFormWidgetDateEntry</NAME>
-struct _GtkFormWidgetDateEntry
- {
- GtkFormWidget parent;
- };
-</STRUCT>
-<STRUCT>
-<NAME>GtkFormWidgetDateEntryClass</NAME>
-struct _GtkFormWidgetDateEntryClass
- {
- GtkFormWidgetClass parent_class;
- };
</STRUCT>
-<FUNCTION>
-<NAME>gtk_form_widget_date_entry_get_type</NAME>
-<RETURNS>GType </RETURNS>
-void
-</FUNCTION>
-<FUNCTION>
-<NAME>gtk_form_widget_date_entry_new</NAME>
-<RETURNS>GtkFormWidget *</RETURNS>
-void
-</FUNCTION>
-<FUNCTION>
-<NAME>gtk_form_widget_date_entry_get_value_stringify</NAME>
-<RETURNS>gchar *</RETURNS>
-GtkFormWidget *widget
-</FUNCTION>
-<FUNCTION>
-<NAME>gtk_form_widget_date_entry_set_value_stringify</NAME>
-<RETURNS>gboolean </RETURNS>
-GtkFormWidget *fwidget, const gchar *value
-</FUNCTION>
-<FUNCTION>
-<NAME>gtk_form_widget_date_entry_set_editable</NAME>
-<RETURNS>void </RETURNS>
-GtkFormWidget *fwidget, gboolean editable
-</FUNCTION>
-68% symbol docs coverage.
-15 symbols documented.
-0 symbols incomplete.
-7 not documented.
+70% symbol docs coverage.
+26 symbols documented.
+1 symbols incomplete.
+11 not documented.
gtk_date_entry_get_gdate
+gtk_date_entry_get_gdatetime
+gtk_date_entry_get_sql
gtk_date_entry_get_strf
gtk_date_entry_get_tm
+gtk_date_entry_is_date_visible
+gtk_date_entry_is_time_visible
+gtk_date_entry_set_separator (Returns)
gtk_form_widget_date_entry_get_value_stringify
gtk_form_widget_date_entry_new
gtk_form_widget_date_entry_set_value_stringify
GTK_FORM_WIDGET_DATE_ENTRY
GTK_FORM_WIDGET_DATE_ENTRY_CLASS
GTK_FORM_WIDGET_DATE_ENTRY_GET_CLASS
+GTK_IS_DATE_ENTRY
+GTK_IS_DATE_ENTRY_CLASS
GtkFormWidgetDateEntry
GtkFormWidgetDateEntryClass
gtk_date_entry_get_gdate
+gtk_date_entry_get_gdatetime
+gtk_date_entry_get_sql
gtk_date_entry_get_tm
+gtk_date_entry_is_date_visible
+gtk_date_entry_is_time_visible
gtk_date_entry_is_valid
gtk_date_entry_set_calendar_button_visible
gtk_date_entry_set_date_gdate
+gtk_date_entry_set_date_gdatetime
gtk_date_entry_set_date_strf
gtk_date_entry_set_date_tm
+gtk_date_entry_set_date_visible
gtk_date_entry_set_editable
gtk_date_entry_set_editable_with_calendar
-gtk_form_widget_date_entry_get_type
-gtk_form_widget_date_entry_get_value_stringify
-gtk_form_widget_date_entry_new
-gtk_form_widget_date_entry_set_editable
-gtk_form_widget_date_entry_set_value_stringify
+gtk_date_entry_set_time_separator
+gtk_date_entry_set_time_visible
<ARG>
-<NAME>GtkDateEntry::editable-with-calendar</NAME>
+<NAME>GtkDateEntry::calendar-button-visible</NAME>
+<TYPE>gboolean</TYPE>
+<RANGE></RANGE>
+<FLAGS>rw</FLAGS>
+<NICK>TRUE to show the calendar's button</NICK>
+<BLURB>Determines if the calendar's button is visible or not.</BLURB>
+<DEFAULT>TRUE</DEFAULT>
+</ARG>
+
+<ARG>
+<NAME>GtkDateEntry::date-visible</NAME>
+<TYPE>gboolean</TYPE>
+<RANGE></RANGE>
+<FLAGS>rw</FLAGS>
+<NICK>TRUE to show the date part</NICK>
+<BLURB>Determines if the date part of the widget is visible or not.</BLURB>
+<DEFAULT>TRUE</DEFAULT>
+</ARG>
+
+<ARG>
+<NAME>GtkDateEntry::editable-from-calendar</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<DEFAULT>FALSE</DEFAULT>
</ARG>
+<ARG>
+<NAME>GtkDateEntry::format</NAME>
+<TYPE>gchar*</TYPE>
+<RANGE></RANGE>
+<FLAGS>rw</FLAGS>
+<NICK>The date's format</NICK>
+<BLURB>The date's format.</BLURB>
+<DEFAULT>""</DEFAULT>
+</ARG>
+
+<ARG>
+<NAME>GtkDateEntry::separator</NAME>
+<TYPE>gchar*</TYPE>
+<RANGE></RANGE>
+<FLAGS>rw</FLAGS>
+<NICK>The separator</NICK>
+<BLURB>The separator between day, month and year.</BLURB>
+<DEFAULT>""</DEFAULT>
+</ARG>
+
+<ARG>
+<NAME>GtkDateEntry::time-separator</NAME>
+<TYPE>gchar*</TYPE>
+<RANGE></RANGE>
+<FLAGS>rw</FLAGS>
+<NICK>The time separator</NICK>
+<BLURB>The separator between hours, minutes and seconds.</BLURB>
+<DEFAULT>""</DEFAULT>
+</ARG>
+
+<ARG>
+<NAME>GtkDateEntry::time-visible</NAME>
+<TYPE>gboolean</TYPE>
+<RANGE></RANGE>
+<FLAGS>rw</FLAGS>
+<NICK>TRUE to show the time part</NICK>
+<BLURB>Determines if the time part of the widget is visible or not.</BLURB>
+<DEFAULT>TRUE</DEFAULT>
+</ARG>
+
+<ARG>
+<NAME>GtkDateEntry::time-with-seconds</NAME>
+<TYPE>gboolean</TYPE>
+<RANGE></RANGE>
+<FLAGS>rw</FLAGS>
+<NICK>TRUE to show the seconds in time part</NICK>
+<BLURB>Determines if the seconds in the time part of the widget are visible or not.</BLURB>
+<DEFAULT>TRUE</DEFAULT>
+</ARG>
+
GtkObject
GtkWidget
GtkContainer
- GtkBox
- GtkHBox
- GtkDateEntry
+ GtkBin
+ GtkDateEntry
GtkStyle
GdkDrawable
GdkWindow
GTypePlugin
AtkImplementorIface
GtkBuildable
- GtkOrientable
+ GdaExQueryEditorIWidget
GtkWidget AtkImplementorIface GtkBuildable
GtkContainer AtkImplementorIface GtkBuildable
-GtkBox AtkImplementorIface GtkBuildable GtkOrientable
-GtkHBox AtkImplementorIface GtkBuildable GtkOrientable
-GtkDateEntry AtkImplementorIface GtkBuildable GtkOrientable
+GtkBin AtkImplementorIface GtkBuildable
+GtkDateEntry AtkImplementorIface GtkBuildable GdaExQueryEditorIWidget
+GtkBuildable GObject
+GdaExQueryEditorIWidget GObject
</para>
+<!-- ##### ARG GtkDateEntry:editable-with-calendar ##### -->
+<para>
+
+</para>
+
+
</para>
-<!-- ##### ARG GtkDateEntry:editable-with-calendar ##### -->
+<!-- ##### ARG GtkDateEntry:calendar-button-visible ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG GtkDateEntry:date-visible ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG GtkDateEntry:editable-from-calendar ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG GtkDateEntry:format ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG GtkDateEntry:separator ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG GtkDateEntry:time-separator ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG GtkDateEntry:time-visible ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG GtkDateEntry:time-with-seconds ##### -->
<para>
</para>
@date:
@separator:
+@Returns:
<!-- ##### FUNCTION gtk_date_entry_set_format ##### -->
@date:
@format:
@separator:
+@time_separator:
@Returns:
#endif
#include <gtkmaskedentry.h>
+#include <libgdaex/queryeditor_widget_interface.h>
#include "gtkdateentry.h"
static void gtk_date_entry_class_init (GtkDateEntryClass *klass);
static void gtk_date_entry_init (GtkDateEntry *date);
+static void gtk_date_entry_gdaex_query_editor_iwidget_interface_init (GdaExQueryEditorIWidgetIface *iface);
+
static void gtk_date_entry_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_date_entry_size_allocate (GtkWidget *widget,
static gchar *gtk_date_entry_get_separator_from_locale ();
static gchar *gtk_date_entry_get_format_from_locale ();
+static const gchar *gtk_date_entry_get_value (GdaExQueryEditorIWidget *iwidget);
+static const gchar *gtk_date_entry_get_value_sql (GdaExQueryEditorIWidget *iwidget);
+static void gtk_date_entry_set_value (GdaExQueryEditorIWidget *iwidget, const gchar *value);
+
static GtkWidgetClass *parent_class = NULL;
gboolean time_with_seconds;
};
-G_DEFINE_TYPE (GtkDateEntry, gtk_date_entry, GTK_TYPE_BIN)
+G_DEFINE_TYPE_WITH_CODE (GtkDateEntry, gtk_date_entry, GTK_TYPE_BIN,
+ G_IMPLEMENT_INTERFACE (GDAEX_QUERY_EDITOR_TYPE_IWIDGET,
+ gtk_date_entry_gdaex_query_editor_iwidget_interface_init));
static void
gtk_date_entry_class_init (GtkDateEntryClass *klass)
gtk_widget_show (priv->spnSeconds);
}
+static void
+gtk_date_entry_gdaex_query_editor_iwidget_interface_init (GdaExQueryEditorIWidgetIface *iface)
+{
+ iface->get_value = gtk_date_entry_get_value;
+ iface->get_value_sql = gtk_date_entry_get_value_sql;
+ iface->set_value = gtk_date_entry_set_value;
+}
+
/**
* gtk_date_entry_new:
* @format: a #gchar which is the date's format.
return fmt;
}
+
+static const gchar
+*gtk_date_entry_get_value (GdaExQueryEditorIWidget *iwidget)
+{
+ return gtk_date_entry_get_strf (GTK_DATE_ENTRY (iwidget), gtk_date_entry_is_time_visible (GTK_DATE_ENTRY (iwidget)) ? "dmYHMS" : "dmY", NULL, NULL);
+}
+
+static const gchar
+*gtk_date_entry_get_value_sql (GdaExQueryEditorIWidget *iwidget)
+{
+ return gtk_date_entry_get_sql (GTK_DATE_ENTRY (iwidget));
+}
+
+static void
+gtk_date_entry_set_value (GdaExQueryEditorIWidget *iwidget,
+ const gchar *value)
+{
+ gtk_date_entry_set_date_strf (GTK_DATE_ENTRY (iwidget), value == NULL ? g_date_time_format (g_date_time_new_now_local (), "%Y-%m-%d %H.%M.%S") : value, "YmdHMS");
+}