summaryrefslogtreecommitdiff
path: root/src/examples/elementary/calendar_cxx_example_04.cc
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-03-23 12:56:14 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-03-23 13:24:41 -0700
commitc2a1c49ab2042f559b28e840e54feb8494888e0e (patch)
treec6eb110b7c479499854eede9d0c3ab0a80c9a11a /src/examples/elementary/calendar_cxx_example_04.cc
parent9340855597e7e465435c69b6278650346688da14 (diff)
elementary: move all legacy files to their expected new location.
Diffstat (limited to 'src/examples/elementary/calendar_cxx_example_04.cc')
-rw-r--r--src/examples/elementary/calendar_cxx_example_04.cc43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/examples/elementary/calendar_cxx_example_04.cc b/src/examples/elementary/calendar_cxx_example_04.cc
new file mode 100644
index 0000000000..9df983df91
--- /dev/null
+++ b/src/examples/elementary/calendar_cxx_example_04.cc
@@ -0,0 +1,43 @@
1#include <Elementary.hh>
2
3#define SECS_DAY 86400
4
5EAPI_MAIN int
6elm_main (int argc, char *argv[])
7{
8 struct tm selected_time;
9 time_t current_time;
10
11 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
12
13 ::elm::win_standard win;
14 win.title_set("Calendar Day Selection Example");
15 win.autohide_set(true);
16
17 ::elm::box bx(efl::eo::parent = win);
18 bx.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
19 win.resize_object_add(bx);
20 bx.visible_set(true);
21
22 ::elm::calendar cal(efl::eo::parent = win);
23 cal.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
24 cal.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL);
25 cal.select_mode_set(ELM_CALENDAR_SELECT_MODE_NONE);
26 cal.visible_set(true);
27 bx.pack_end(cal);
28
29 ::elm::calendar cal2(efl::eo::parent = win);
30 cal2.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
31 cal2.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL);
32 current_time = time(NULL) +2 * SECS_DAY;
33 localtime_r(&current_time, &selected_time);
34 cal2.selected_time_set(&selected_time);
35 cal2.visible_set(true);
36 bx.pack_end(cal2);
37
38 win.visible_set(true);
39
40 elm_run();
41 return 0;
42}
43ELM_MAIN()