cxx: Added examples and tutorial for C++ binding
[platform/upstream/elementary.git] / src / examples / separator_cxx_example_01.cc
1 #include <Elementary.hh>
2 #include <Evas.hh>
3
4 EAPI_MAIN int
5 elm_main (int argc, char *argv[])
6 {
7    elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
8
9    ::elm::win_standard win;
10    win.title_set("Separator");
11    win.autohide_set(true);
12
13    ::elm::bg bg(efl::eo::parent = win);
14    bg.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
15    win.resize_object_add(bg);
16    bg.visible_set(true);
17
18    ::elm::box bx(efl::eo::parent = win);
19    bx.horizontal_set(true);
20    bx.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
21    win.resize_object_add(bx);
22    bx.visible_set(true);
23
24    evas::rectangle rect(efl::eo::parent = win);
25    rect.color_set( 0, 255, 0, 255);
26    rect.size_hint_min_set( 90, 200);
27    rect.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
28    rect.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL);
29    rect.visible_set(true);
30    bx.pack_end(rect);
31
32    ::elm::separator separator(efl::eo::parent = win);
33    separator.horizontal_set(true);
34    separator.visible_set(true);
35    bx.pack_end(separator);
36
37    evas::rectangle rect2(efl::eo::parent = win);
38    rect2.color_set( 0, 0, 255, 255);
39    rect2.size_hint_min_set( 90, 200);
40    rect2.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
41    rect2.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL);
42    rect2.visible_set(true);
43    bx.pack_end(rect2);
44
45    win.visible_set(true);
46
47    elm_run();
48    return 0;
49 }
50 ELM_MAIN()
51