summaryrefslogtreecommitdiff
path: root/src/examples/elementary/calendar_cxx_example_03.cc
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-11-01 22:42:04 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-07 09:57:24 +0900
commit9c9278cd458422b73a3016ba056c0267d3d65bfb (patch)
tree2c5a5aa3f6d94a2f7ecd86674c59d8f95ac67108 /src/examples/elementary/calendar_cxx_example_03.cc
parent03b22c4d7b41c2310b4c25ed7ce8543942d638d5 (diff)
cxx: Fix a few examples
- Calendar: Some examples can't be ported. Not good. - Toolbar: Needs the new API to be completed. - Clock: Crashes at runtime. Ping @felipealmeida
Diffstat (limited to 'src/examples/elementary/calendar_cxx_example_03.cc')
-rw-r--r--src/examples/elementary/calendar_cxx_example_03.cc34
1 files changed, 13 insertions, 21 deletions
diff --git a/src/examples/elementary/calendar_cxx_example_03.cc b/src/examples/elementary/calendar_cxx_example_03.cc
index 672e6319f9..c780987f48 100644
--- a/src/examples/elementary/calendar_cxx_example_03.cc
+++ b/src/examples/elementary/calendar_cxx_example_03.cc
@@ -5,35 +5,27 @@
5 5
6#include <Elementary.hh> 6#include <Elementary.hh>
7 7
8EAPI_MAIN int 8using efl::eo::instantiate;
9elm_main (int argc EINA_UNUSED, char **argv EINA_UNUSED) 9
10static void
11efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
10{ 12{
11 Efl_Time min, max; 13 Efl_Time min = {}, max = {};
12 14
13 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN); 15 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
14 16
15 using efl::eo::instantiate;
16
17 efl::ui::Win win(instantiate);
18 //win.title_set("Calendar Min/Max Year Example");
19 win.autohide_set(true);
20
21 elm::Calendar cal(instantiate, win);
22
23 min.tm_year = 2020 - 1900; 17 min.tm_year = 2020 - 1900;
24 max.tm_year = 2022 - 1900; 18 max.tm_year = 2022 - 1900;
25 19
26 //cal.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 20 auto win = efl::ui::Win(instantiate);
27 //win.resize_object_add(cal); 21 win.text_set("Calendar Min/Max Year Example");
22 win.autohide_set(true);
23
24 auto cal = efl::ui::Calendar(instantiate, win);
25 win.content_set(cal);
28 cal.date_min_set(min); 26 cal.date_min_set(min);
29 cal.date_max_set(max); 27 cal.date_max_set(max);
30 cal.visible_set(true);
31
32 cal.eo_cxx::efl::Gfx::size_set({140,140});
33 win.eo_cxx::efl::Gfx::size_set({140,140});
34 win.visible_set(true);
35 28
36 elm_run(); 29 win.size_set({320,320});
37 return 0;
38} 30}
39ELM_MAIN() 31EFL_MAIN()