aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/elementary/test_ui_datepicker.c
diff options
context:
space:
mode:
authorWoochan Lee <wc0917.lee@samsung.com>2018-04-25 16:43:53 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2018-04-25 16:48:21 +0900
commitef2e6afd1f7c890297900937fa1f12f0f4f76980 (patch)
treede05efce05d3712a76c47b6f7555df3ee51145c0 /src/bin/elementary/test_ui_datepicker.c
parentbuild break - fix - potfiles.in missing file rename (diff)
downloadefl-ef2e6afd1f7c890297900937fa1f12f0f4f76980.tar.gz
Intrudoce Efl Ui Date, Time interface and picker.
Summary: Create datepicker, timepicker with one manager class(efl_datetime). Test Plan: datepicker, timepicker sample. Reviewers: herb, Jaehyun_Cho, woohyun, SanghyeonLee Reviewed By: Jaehyun_Cho Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D5871
Diffstat (limited to 'src/bin/elementary/test_ui_datepicker.c')
-rw-r--r--src/bin/elementary/test_ui_datepicker.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/bin/elementary/test_ui_datepicker.c b/src/bin/elementary/test_ui_datepicker.c
new file mode 100644
index 0000000000..1eb04612b1
--- /dev/null
+++ b/src/bin/elementary/test_ui_datepicker.c
@@ -0,0 +1,37 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#include <Elementary.h>
+
+static void
+_date_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev)
+{
+ int year, month, day;
+
+ efl_ui_datepicker_date_get(ev->object, &year, &month, &day);
+ printf("Current date is %d %d %d\n", year, month, day);
+}
+
+void
+test_ui_datepicker(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Eo *win, *bx;
+
+ win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
+ efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
+ efl_text_set(efl_added, "Efl.Ui.Datepicker"),
+ efl_ui_win_autodel_set(efl_added, EINA_TRUE));
+
+ bx = efl_add(EFL_UI_BOX_CLASS, win,
+ efl_content_set(win, efl_added),
+ efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
+
+ efl_add(EFL_UI_DATEPICKER_CLASS, bx,
+ efl_ui_datepicker_date_set(efl_added, 1987, 9, 17),
+ efl_ui_datepicker_max_set(efl_added, 1990, 9, 17),
+ efl_ui_datepicker_min_set(efl_added, 1980, 9, 17),
+ efl_event_callback_add(efl_added, EFL_UI_DATEPICKER_EVENT_CHANGED,_date_changed_cb, NULL),
+ efl_pack(bx, efl_added));
+
+ efl_gfx_entity_size_set(win, EINA_SIZE2D(150, 170));
+}