HildonDateEditor

HildonDateEditor — A widget which queries a date from user or opens a HildonCalendarPopup.

Synopsis

                    HildonDateEditor;
GtkWidget*          hildon_date_editor_new              (void);
void                hildon_date_editor_set_date         (HildonDateEditor *date,
                                                         guint year,
                                                         guint month,
                                                         guint day);
void                hildon_date_editor_get_date         (HildonDateEditor *date,
                                                         guint *year,
                                                         guint *month,
                                                         guint *day);
gboolean            hildon_date_editor_set_year         (HildonDateEditor *editor,
                                                         guint year);
gboolean            hildon_date_editor_set_month        (HildonDateEditor *editor,
                                                         guint month);
gboolean            hildon_date_editor_set_day          (HildonDateEditor *editor,
                                                         guint day);
guint               hildon_date_editor_get_year         (HildonDateEditor *editor);
guint               hildon_date_editor_get_month        (HildonDateEditor *editor);
guint               hildon_date_editor_get_day          (HildonDateEditor *editor);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----HildonDateEditor

Implemented Interfaces

HildonDateEditor implements AtkImplementorIface and GtkBuildable.

Properties

  "day"                      guint                 : Read / Write
  "max-year"                 guint                 : Read / Write
  "min-year"                 guint                 : Read / Write
  "month"                    guint                 : Read / Write
  "year"                     guint                 : Read / Write

Signals

  "date-error"                                     : Run Last

Description

HildonDateEditor is a widget with three entry fields (day, month, year) and an icon (button): clicking on the icon opens up a HildonCalendarPopup.

Note

HildonDateEditor has been deprecated since Hildon 2.2 and should not be used in newly written code. Use HildonDateSelector instead. See Migrating Date Widgets section to know how to migrate this deprecated widget.

Example 26. 

guint y, m, d;
GtkDialog *dialog;
GtkWidget *date_editor;

dialog = GTK_DIALOG (gtk_dialog_new ());
date_editor = hildon_date_editor_new ();

gtk_box_pack_start (GTK_BOX (dialog->vbox), gtk_label_new ("Choose a date"), FALSE, FALSE, 10);
gtk_box_pack_start (GTK_BOX (dialog->vbox), date_editor, FALSE, FALSE, 10);
gtk_dialog_add_button (dialog, "Close", GTK_RESPONSE_CANCEL);

gtk_widget_show_all (GTK_WIDGET (dialog));
gtk_dialog_run (dialog);

hildon_date_editor_get_date (HILDON_DATE_EDITOR (date_editor), &y, &m, &d);
g_debug ("Date: %u-%u-%u", y, m, d);


Details

HildonDateEditor

typedef struct _HildonDateEditor HildonDateEditor;

Warning

HildonDateEditor is deprecated and should not be used in newly-written code.


hildon_date_editor_new ()

GtkWidget*          hildon_date_editor_new              (void);

Warning

hildon_date_editor_new is deprecated and should not be used in newly-written code.

Creates a new date editor. The current system date is shown in the editor.

Returns : pointer to a new HildonDateEditor widget.

hildon_date_editor_set_date ()

void                hildon_date_editor_set_date         (HildonDateEditor *date,
                                                         guint year,
                                                         guint month,
                                                         guint day);

Warning

hildon_date_editor_set_date is deprecated and should not be used in newly-written code.

Sets the date shown in the editor.

date : the HildonDateEditor widget
year : year
month : month
day : day

hildon_date_editor_get_date ()

void                hildon_date_editor_get_date         (HildonDateEditor *date,
                                                         guint *year,
                                                         guint *month,
                                                         guint *day);

Warning

hildon_date_editor_get_date is deprecated and should not be used in newly-written code.

Gets the date selected in date. You can pass NULL in any of the pointers if you're not interested in obtaining a particular field.

date : the HildonDateEditor widget
year : a pointer to store the selected year
month : a pointer to store the selected month
day : a pointer to store the selected day

hildon_date_editor_set_year ()

gboolean            hildon_date_editor_set_year         (HildonDateEditor *editor,
                                                         guint year);

Warning

hildon_date_editor_set_year is deprecated and should not be used in newly-written code.

Sets the year shown in the editor.

editor : the HildonDateEditor widget
year : year
Returns : TRUE if the year is valid and has been set.

hildon_date_editor_set_month ()

gboolean            hildon_date_editor_set_month        (HildonDateEditor *editor,
                                                         guint month);

Warning

hildon_date_editor_set_month is deprecated and should not be used in newly-written code.

Sets the month shown in the editor.

editor : the HildonDateEditor widget
month : month
Returns : TRUE if the month is valid and has been set.

hildon_date_editor_set_day ()

gboolean            hildon_date_editor_set_day          (HildonDateEditor *editor,
                                                         guint day);

Warning

hildon_date_editor_set_day is deprecated and should not be used in newly-written code.

Sets the day shown in the editor.

editor : the HildonDateEditor widget
day : day
Returns : TRUE if the day is valid and has been set.

hildon_date_editor_get_year ()

guint               hildon_date_editor_get_year         (HildonDateEditor *editor);

Warning

hildon_date_editor_get_year is deprecated and should not be used in newly-written code.

Gets the year shown in the editor.

editor : the HildonDateEditor widget
Returns : the current year shown in the editor.

hildon_date_editor_get_month ()

guint               hildon_date_editor_get_month        (HildonDateEditor *editor);

Warning

hildon_date_editor_get_month is deprecated and should not be used in newly-written code.

Gets the month shown in the editor.

editor : the HildonDateEditor widget
Returns : the current month shown in the editor.

hildon_date_editor_get_day ()

guint               hildon_date_editor_get_day          (HildonDateEditor *editor);

Warning

hildon_date_editor_get_day is deprecated and should not be used in newly-written code.

Gets the day shown in the editor.

editor : the HildonDateEditor widget
Returns : the current day shown in the editor

Property Details

The "day" property

  "day"                      guint                 : Read / Write

Current day.

Allowed values: [1,31]

Default value: 1


The "max-year" property

  "max-year"                 guint                 : Read / Write

Maximum valid year.

Allowed values: [1,10000]

Default value: 2037


The "min-year" property

  "min-year"                 guint                 : Read / Write

Minimum valid year.

Allowed values: [1,10000]

Default value: 1970


The "month" property

  "month"                    guint                 : Read / Write

Current month.

Allowed values: [1,12]

Default value: 1


The "year" property

  "year"                     guint                 : Read / Write

Current year.

Allowed values: [1,10000]

Default value: 2007

Signal Details

The "date-error" signal

gboolean            user_function                      (HildonDateEditor   *hildondateeditor,
                                                        HildonDateTimeError arg1,
                                                        gpointer            user_data)             : Run Last

hildondateeditor : the object which received the signal.
arg1 :
user_data : user data set when the signal handler was connected.
Returns :

See Also

HildonCalendarPopup, HildonTimeEditor