2009-01-20 Claudio Saavedra <csaavedra@igalia.com>
+ * examples/hildon-date-button-example.c: (main): Use the new
+ hildon_date_button_new_with_year_range() method in the example.
+ * src/hildon-date-button.c:
+ (+hildon_date_button_new_with_year_range): New public method
+ to conveniently create a HildonDateButton with a custom year range
+ in its HildonDateSelector.
+ * src/hildon-date-button.h: Add the new public method definition.
+
+ Fixes: NB#97908 (Not possible to change the year range in
+ HildonDateSelector/HildonDateButton)
+
+2009-01-20 Claudio Saavedra <csaavedra@igalia.com>
+
* src/hildon-date-selector.c:
(+hildon_date_selector_set_property),
(+hildon_date_selector_get_property),
gtk_window_set_default_size (GTK_WINDOW (window), 300, 200);
hildon_program_add_window (program, HILDON_WINDOW (window));
- button = hildon_date_button_new (HILDON_SIZE_AUTO, HILDON_BUTTON_ARRANGEMENT_VERTICAL);
+ button = hildon_date_button_new_with_year_range (HILDON_SIZE_AUTO,
+ HILDON_BUTTON_ARRANGEMENT_VERTICAL,
+ 1990, 2020);
g_signal_connect (G_OBJECT (button), "value-changed",
G_CALLBACK (on_picker_value_changed), NULL);
}
/**
+ * hildon_date_button_new_with_year_range:
+ * @size: One of #HildonSizeType
+ * @arrangement: one of #HildonButtonArrangement
+ * @min_year: the minimum available year or -1 to ignore
+ * @max_year: the maximum available year or -1 to ignore
+ *
+ * Creates a new #HildonDateButton with a specific valid range of years.
+ * See hildon_date_selector_new_with_year_range() for details on the range.
+ *
+ * Returns: a new #HildonDateButton
+ *
+ * Since: 2.2
+ **/
+GtkWidget *
+hildon_date_button_new_with_year_range (HildonSizeType size,
+ HildonButtonArrangement arrangement,
+ gint min_year,
+ gint max_year)
+{
+ GtkWidget *button;
+ GtkWidget *selector;
+
+ button = hildon_date_button_new (size, arrangement);
+ selector = hildon_date_selector_new_with_year_range (min_year, max_year);
+ hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (button),
+ HILDON_TOUCH_SELECTOR (selector));
+
+ return button;
+}
+
+/**
* hildon_date_button_get_date:
* @button: a #HildonDateButton
* @year: return location for the selected year
hildon_date_button_new (HildonSizeType size,
HildonButtonArrangement arrangement);
+GtkWidget *
+hildon_date_button_new_with_year_range (HildonSizeType size,
+ HildonButtonArrangement arrangement,
+ gint min_year,
+ gint max_year);
+
void
hildon_date_button_get_date (HildonDateButton *button,
guint *year,