HildonCalendarPopup

HildonCalendarPopup — CalendarPopup allows choosing a date from a popup calendar.

Synopsis

                    HildonCalendarPopup;
GtkWidget*          hildon_calendar_popup_new           (GtkWindow *parent,
                                                         guint year,
                                                         guint month,
                                                         guint day);
void                hildon_calendar_popup_set_date      (HildonCalendarPopup *cal,
                                                         guint year,
                                                         guint month,
                                                         guint day);
void                hildon_calendar_popup_get_date      (HildonCalendarPopup *cal,
                                                         guint *year,
                                                         guint *month,
                                                         guint *day);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBin
                                 +----GtkWindow
                                       +----GtkDialog
                                             +----HildonCalendarPopup

Implemented Interfaces

HildonCalendarPopup implements AtkImplementorIface and GtkBuildable.

Properties

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

Description

HildonCalendarPopup is a dialog which contains a HildonCalendar. It also contains arrow buttons for changing the month/year. If an entered date is invalid, an information message will be shown.

Note

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

Example 20. HildonCalendarPopup example

...
gint y, m, d;
GtkWidget *parent, *popup;

// get current date into &y, &m, &d...

gtk_widget_get_ancestor (GTK_WIDGET (data), GTK_TYPE_WINDOW);
popup = hildon_calendar_popup_new (GTK_WINDOW (parent), y, m, d);

result = gtk_dialog_run (GTK_DIALOG (popup));
switch (result)
{
     case GTK_RESPONSE_OK:
     case GTK_RESPONSE_ACCEPT:

hildon_calendar_popup_get_date (HILDON_CALENDAR_POPUP (popup), &y, &m, &d);

// here set the new date
}
gtk_widget_destroy(popup);
...


Details

HildonCalendarPopup

typedef struct _HildonCalendarPopup HildonCalendarPopup;

Warning

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


hildon_calendar_popup_new ()

GtkWidget*          hildon_calendar_popup_new           (GtkWindow *parent,
                                                         guint year,
                                                         guint month,
                                                         guint day);

Warning

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

This function returns a new HildonCalendarPopup. The initially selected date is specified by the parameters (year, month, day). If the specified date is invalid, the current date is used.

parent : parent window for dialog
year : initial year
month : initial month
day : initial day
Returns : new HildonCalendarPopup widget

hildon_calendar_popup_set_date ()

void                hildon_calendar_popup_set_date      (HildonCalendarPopup *cal,
                                                         guint year,
                                                         guint month,
                                                         guint day);

Warning

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

Activates a new date on the calendar popup.

cal : the HildonCalendarPopup widget
year : year
month : month
day : day

hildon_calendar_popup_get_date ()

void                hildon_calendar_popup_get_date      (HildonCalendarPopup *cal,
                                                         guint *year,
                                                         guint *month,
                                                         guint *day);

Warning

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

Gets the currently selected year, month, and day. It's possible to pass NULL to any of the pointers if you don't need that data.

cal : the HildonCalendarPopup widget
year : year
month : month
day : day

Property Details

The "day" property

  "day"                      gint                  : Read / Write

currently selected day.

Default value: 0


The "max-year" property

  "max-year"                 guint                 : Write

Maximum valid year.

Allowed values: [1,10000]

Default value: 2037


The "min-year" property

  "min-year"                 guint                 : Write

Minimum valid year.

Allowed values: [1,10000]

Default value: 1970


The "month" property

  "month"                    gint                  : Read / Write

currently selected month.

Default value: 0


The "year" property

  "year"                     gint                  : Read / Write

the currently selected year.

Default value: 0

See Also

HildonDateEditor, HildonTimeEditor