summaryrefslogtreecommitdiff
path: root/src/examples/elementary/clock_cxx_example.cc
blob: bb8be2b39a03d05607fb1457fb8bee4de47e26d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "elementary_config.h"
#endif

#include <Elementary.hh>

EAPI_MAIN int
elm_main (int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);

   using efl::eo::instantiate;

   efl::ui::Win win(instantiate);
   //win.title_set("Clock Example");
   win.autohide_set(true);

   efl::ui::Box bx(instantiate, win);
   //bx.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   //win.resize_object_add(bx);
   bx.eo_cxx::efl::Gfx::size_set({300,300});
   bx.visible_set(true);

   ::elm::Clock ck(instantiate, win);
   bx.pack_end(ck);
   ck.visible_set(true);

   ::elm::Clock ck2(instantiate, win);
   ck2.show_am_pm_set(true);
   bx.pack_end(ck2);
   ck2.visible_set(true);

   ::elm::Clock ck3(instantiate, win);
   ck3.show_seconds_set(true);
   ck3.time_set(10, 11, 12);
   bx.pack_end(ck3);
   ck3.visible_set(true);

   ::elm::Clock ck4(instantiate, win);
   ck4.edit_set(true);
   ck4.show_seconds_set(true);
   ck4.show_am_pm_set(true);
   ck4.time_set(10, 11, 12);
   bx.pack_end(ck4);
   ck4.visible_set(true);

   ::elm::Clock ck5(instantiate, win);
   ck5.show_seconds_set(true);
   ck5.edit_set(true);
   int digedit = ELM_CLOCK_EDIT_HOUR_UNIT | ELM_CLOCK_EDIT_MIN_UNIT | ELM_CLOCK_EDIT_SEC_UNIT;
   ck5.edit_mode_set(static_cast<Elm_Clock_Edit_Mode>(digedit));
   bx.pack_end(ck5);
   ck5.visible_set(true);

   win.eo_cxx::efl::Gfx::size_set({500,500});
   win.visible_set(true);

   elm_run();
   return 0;
}
ELM_MAIN()