summaryrefslogtreecommitdiff
path: root/src/examples/elementary/radio_cxx_example_01.cc
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-05-29 20:06:25 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-06-20 16:02:02 +0200
commit89102ecbd3bb99c996d7b34fbbb55900686200bc (patch)
tree9dfb0db1da14ca205c2772372ad23a6d922c6023 /src/examples/elementary/radio_cxx_example_01.cc
parent8cc340e8b2016bab13872e19abcde6a0b438b4db (diff)
efl_ui_radio: cleanup API
This is a bit of a giant commit. However, the problem here is that cleaning up the API went hand in hand with rewriting most of the usages. In the process of renewing and removing old API the following was done: - Legacy API testcases have been ported back to smart callbacks - EO-API testcases have been ported to efl_add syntax - weird event #defines have been removed - Wrong constructor usage has been removed - Ported to the new box object introduced before - removed legacy API from efl_ui_radio -> no more ptr(int) q66 will do jumps of happiness -> no more ununderstandable group_add methods -> Seperated code in blocks only for legacy, and blocks only for non-legacy To verify this commit, you can check all the tests that have been touched here. Additionally, the cxx example has been adjusted ref T7867 Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D9060
Diffstat (limited to 'src/examples/elementary/radio_cxx_example_01.cc')
-rw-r--r--src/examples/elementary/radio_cxx_example_01.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/examples/elementary/radio_cxx_example_01.cc b/src/examples/elementary/radio_cxx_example_01.cc
index c6d5146655..1b6c659e14 100644
--- a/src/examples/elementary/radio_cxx_example_01.cc
+++ b/src/examples/elementary/radio_cxx_example_01.cc
@@ -16,7 +16,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
16 win.text_set("Radio Example"); 16 win.text_set("Radio Example");
17 win.autohide_set(true); 17 win.autohide_set(true);
18 18
19 efl::ui::Box bx(instantiate, win); 19 efl::ui::Radio_Box bx(instantiate, win);
20 bx.orientation_set(EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL); 20 bx.orientation_set(EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL);
21 win.content_set(bx); 21 win.content_set(bx);
22 22
@@ -30,15 +30,14 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
30 radio.content_set(ic); 30 radio.content_set(ic);
31 bx.pack_end(radio); 31 bx.pack_end(radio);
32 32
33 auto cb_val = std::bind([] (efl::ui::Radio &obj) 33 auto cb_val = std::bind([bx] (efl::ui::Radio &obj EINA_UNUSED)
34 { std::cout << "val is now: " << obj.group_value_get() << std::endl; }, 34 { std::cout << "val is now: " << bx.selected_value_get() << std::endl; },
35 std::placeholders::_1); 35 std::placeholders::_1);
36 efl::eolian::event_add(efl::ui::Nstate::changed_event, radio, cb_val); 36 efl::eolian::event_add(efl::ui::Nstate::changed_event, radio, cb_val);
37 37
38 efl::ui::Radio radio2(instantiate, win); 38 efl::ui::Radio radio2(instantiate, win);
39 radio2.text_set("Radio 2"); 39 radio2.text_set("Radio 2");
40 radio2.state_value_set(2); 40 radio2.state_value_set(2);
41 radio2.group_add(group);
42 41
43 efl::ui::Image ic2(instantiate, win); 42 efl::ui::Image ic2(instantiate, win);
44 ic2.icon_set("file"); 43 ic2.icon_set("file");
@@ -49,14 +48,12 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
49 efl::ui::Radio radio3(instantiate, win); 48 efl::ui::Radio radio3(instantiate, win);
50 radio3.text_set("Radio 3"); 49 radio3.text_set("Radio 3");
51 radio3.state_value_set(3); 50 radio3.state_value_set(3);
52 radio3.group_add(group);
53 bx.pack_end(radio3); 51 bx.pack_end(radio3);
54 efl::eolian::event_add(efl::ui::Nstate::changed_event, radio3, cb_val); 52 efl::eolian::event_add(efl::ui::Nstate::changed_event, radio3, cb_val);
55 53
56 efl::ui::Radio radio4(instantiate, win); 54 efl::ui::Radio radio4(instantiate, win);
57 radio4.text_set("Radio 4"); 55 radio4.text_set("Radio 4");
58 radio4.state_value_set(4); 56 radio4.state_value_set(4);
59 radio4.group_add(group);
60 bx.pack_end(radio4); 57 bx.pack_end(radio4);
61 efl::eolian::event_add(efl::ui::Nstate::changed_event, radio4, cb_val); 58 efl::eolian::event_add(efl::ui::Nstate::changed_event, radio4, cb_val);
62} 59}