summaryrefslogtreecommitdiff
path: root/src/examples/elementary/calendar_cxx_example_04.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_04.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_04.cc')
-rw-r--r--src/examples/elementary/calendar_cxx_example_04.cc35
1 files changed, 15 insertions, 20 deletions
diff --git a/src/examples/elementary/calendar_cxx_example_04.cc b/src/examples/elementary/calendar_cxx_example_04.cc
index 0b6b21a35f..e0983268f8 100644
--- a/src/examples/elementary/calendar_cxx_example_04.cc
+++ b/src/examples/elementary/calendar_cxx_example_04.cc
@@ -3,36 +3,34 @@
3#include "elementary_config.h" 3#include "elementary_config.h"
4#endif 4#endif
5 5
6#warning This example can't be implemented with EO APIs... FIXME
7
6#include <Elementary.hh> 8#include <Elementary.hh>
7 9
10using efl::eo::instantiate;
11
8#define SECS_DAY 86400 12#define SECS_DAY 86400
9 13
10EAPI_MAIN int 14static void
11elm_main (int argc EINA_UNUSED, char **argv EINA_UNUSED) 15efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
12{ 16{
13 struct tm selected_time; 17 struct tm selected_time;
14 time_t current_time; 18 time_t current_time;
15 19
16 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN); 20 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
17 21
18 using efl::eo::instantiate;
19
20 efl::ui::Win win(instantiate); 22 efl::ui::Win win(instantiate);
21 //win.title_set("Calendar Day Selection Example"); 23 win.text_set("Calendar Day Selection Example");
22 win.autohide_set(true); 24 win.autohide_set(true);
23 25
24 ::efl::ui::Box bx(instantiate, win); 26 ::efl::ui::Box bx(instantiate, win);
25 //bx.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 27 win.content_set(bx);
26 //win.resize_object_add(bx); 28
27 bx.eo_cxx::efl::Gfx::size_set({700,700}); 29#if 0
28 bx.visible_set(true); 30
29 31 ::efl::ui::Calendar cal(instantiate, win);
30 ::elm::Calendar cal(instantiate, win);
31 // cal.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
32 // cal.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL);
33 cal.select_mode_set(ELM_CALENDAR_SELECT_MODE_NONE); 32 cal.select_mode_set(ELM_CALENDAR_SELECT_MODE_NONE);
34 cal.eo_cxx::efl::Gfx::size_set({125,135}); 33 cal.eo_cxx::efl::Gfx::size_set({125,135});
35 cal.visible_set(true);
36 //bx.pack_end(cal); no matching function for call to ‘efl::ui::Box::pack_end(elm::Calendar&)’ 34 //bx.pack_end(cal); no matching function for call to ‘efl::ui::Box::pack_end(elm::Calendar&)’
37 //candidate: bool eo_cxx::efl::pack::Linear::pack_end(Efl_Gfx*) const 35 //candidate: bool eo_cxx::efl::pack::Linear::pack_end(Efl_Gfx*) const
38 // inline bool eo_cxx::efl::pack::Linear::pack_end(Efl_Gfx * subobj_) const 36 // inline bool eo_cxx::efl::pack::Linear::pack_end(Efl_Gfx * subobj_) const
@@ -44,13 +42,10 @@ elm_main (int argc EINA_UNUSED, char **argv EINA_UNUSED)
44 localtime_r(&current_time, &selected_time); 42 localtime_r(&current_time, &selected_time);
45 // cal2.selected_time_set(&selected_time); 43 // cal2.selected_time_set(&selected_time);
46 cal2.eo_cxx::efl::Gfx::size_set({125,135}); 44 cal2.eo_cxx::efl::Gfx::size_set({125,135});
47 cal2.visible_set(true);
48 //bx.pack_end(cal2); 45 //bx.pack_end(cal2);
49 46
50 win.eo_cxx::efl::Gfx::size_set({500,560}); 47#endif
51 win.visible_set(true);
52 48
53 elm_run(); 49 win.size_set({500,560});
54 return 0;
55} 50}
56ELM_MAIN() 51EFL_MAIN()