summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavio Sena <savio@expertisesolutions.com.br>2014-08-13 11:28:46 -0300
committerSavio Sena <savio@expertisesolutions.com.br>2014-08-13 11:36:40 -0300
commit71977d5d2ea2bc25e19e32c352fef900cf5424c1 (patch)
tree10eac6c312815ae42e4020478d57eb9a6de0ed2d
parent3f14694970a5ac06c591481c46ad6458cf38c233 (diff)
elm++: Update C++ examples to use the new API.
-rw-r--r--src/examples/box_cxx_example_02.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/examples/box_cxx_example_02.cc b/src/examples/box_cxx_example_02.cc
index 950adfada..676a1546f 100644
--- a/src/examples/box_cxx_example_02.cc
+++ b/src/examples/box_cxx_example_02.cc
@@ -103,19 +103,19 @@ elm_main(int argc, char *argv[])
103 bigbox.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 103 bigbox.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
104 win.resize_object_add(bigbox); 104 win.resize_object_add(bigbox);
105 bigbox.visibility_set(true); 105 bigbox.visibility_set(true);
106 win.event_del_callback_add(clean_ref(bigbox)); 106 win.callback_del_add(clean_ref(bigbox));
107 107
108 elm_box buttons ( efl::eo::parent = win ); 108 elm_box buttons ( efl::eo::parent = win );
109 buttons.horizontal_set(EINA_TRUE); 109 buttons.horizontal_set(EINA_TRUE);
110 bigbox.pack_end(buttons); 110 bigbox.pack_end(buttons);
111 buttons.visibility_set(true); 111 buttons.visibility_set(true);
112 win.event_del_callback_add(clean_ref(buttons)); 112 win.callback_del_add(clean_ref(buttons));
113 113
114 elm_button add ( efl::eo::parent = win ); 114 elm_button add ( efl::eo::parent = win );
115 add.text_set("elm.text", "Add"); 115 add.text_set("elm.text", "Add");
116 buttons.pack_end(add); 116 buttons.pack_end(add);
117 add.visibility_set(true); 117 add.visibility_set(true);
118 add.event_clicked_callback_add 118 add.callback_clicked_add
119 (std::bind([&tdata] 119 (std::bind([&tdata]
120 { 120 {
121 if(efl::eina::optional<elm_box> box = tdata.box.lock()) 121 if(efl::eina::optional<elm_box> box = tdata.box.lock())
@@ -132,21 +132,21 @@ elm_main(int argc, char *argv[])
132 btn.visibility_set(true); 132 btn.visibility_set(true);
133 } 133 }
134 })); 134 }));
135 win.event_del_callback_add(clean_ref(add)); 135 win.callback_del_add(clean_ref(add));
136 136
137 elm_button clear ( efl::eo::parent = win ); 137 elm_button clear ( efl::eo::parent = win );
138 clear.text_set("elm.text", "Clear"); 138 clear.text_set("elm.text", "Clear");
139 buttons.pack_end(clear); 139 buttons.pack_end(clear);
140 clear.visibility_set(true); 140 clear.visibility_set(true);
141 clear.event_clicked_callback_add(std::bind([&tdata] { tdata.box.lock()->clear(); })); 141 clear.callback_clicked_add(std::bind([&tdata] { tdata.box.lock()->clear(); }));
142 win.event_del_callback_add(clean_ref(clear)); 142 win.callback_del_add(clean_ref(clear));
143 143
144 elm_box dynamic ( efl::eo::parent = win ); 144 elm_box dynamic ( efl::eo::parent = win );
145 dynamic.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 145 dynamic.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
146 dynamic.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL); 146 dynamic.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL);
147 bigbox.pack_end(dynamic); 147 bigbox.pack_end(dynamic);
148 dynamic.visibility_set(true); 148 dynamic.visibility_set(true);
149 win.event_del_callback_add(clean_ref(dynamic)); 149 win.callback_del_add(clean_ref(dynamic));
150 150
151 auto unpack = std::bind([&tdata] (evas::clickable_interface obj) 151 auto unpack = std::bind([&tdata] (evas::clickable_interface obj)
152 { 152 {
@@ -159,28 +159,28 @@ elm_main(int argc, char *argv[])
159 159
160 elm_button bt1 ( efl::eo::parent = win ); 160 elm_button bt1 ( efl::eo::parent = win );
161 bt1.text_set("elm.text", "Button 1"); 161 bt1.text_set("elm.text", "Button 1");
162 bt1.event_clicked_callback_add(unpack); 162 bt1.callback_clicked_add(unpack);
163 bt1.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 163 bt1.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
164 bt1.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL); 164 bt1.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL);
165 dynamic.pack_end(bt1); 165 dynamic.pack_end(bt1);
166 bt1.visibility_set(true); 166 bt1.visibility_set(true);
167 win.event_del_callback_add(clean_ref(bt1)); 167 win.callback_del_add(clean_ref(bt1));
168 168
169 elm_button bt2 ( efl::eo::parent = win ); 169 elm_button bt2 ( efl::eo::parent = win );
170 bt2.text_set("elm.text", "Button 2"); 170 bt2.text_set("elm.text", "Button 2");
171 bt2.size_hint_weight_set(EVAS_HINT_EXPAND, 0.0); 171 bt2.size_hint_weight_set(EVAS_HINT_EXPAND, 0.0);
172 bt2.size_hint_align_set(1.0, 0.5); 172 bt2.size_hint_align_set(1.0, 0.5);
173 bt2.event_clicked_callback_add(unpack); 173 bt2.callback_clicked_add(unpack);
174 dynamic.pack_end(bt2); 174 dynamic.pack_end(bt2);
175 bt2.visibility_set(true); 175 bt2.visibility_set(true);
176 win.event_del_callback_add(clean_ref(bt2)); 176 win.callback_del_add(clean_ref(bt2));
177 177
178 elm_button bt3 ( efl::eo::parent = win ); 178 elm_button bt3 ( efl::eo::parent = win );
179 bt3.text_set("elm.text", "Button 3"); 179 bt3.text_set("elm.text", "Button 3");
180 bt3.event_clicked_callback_add(unpack); 180 bt3.callback_clicked_add(unpack);
181 dynamic.pack_end(bt3); 181 dynamic.pack_end(bt3);
182 bt3.visibility_set(true); 182 bt3.visibility_set(true);
183 win.event_del_callback_add(clean_ref(bt3)); 183 win.callback_del_add(clean_ref(bt3));
184 184
185 tdata.box = dynamic; 185 tdata.box = dynamic;
186 tdata.last_layout = evas_object_box_layout_horizontal; 186 tdata.last_layout = evas_object_box_layout_horizontal;