diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-11-07 22:21:13 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-11-07 22:21:13 +0900 |
commit | a0dc0eb5161f88507e3e44bb426ac26245aa6847 (patch) | |
tree | 85f16eaf088670c56de136da75f64979c2ea28ec | |
parent | 528dfce251e3fdf566379e27b262486da62e9e85 (diff) |
cxx: Fix slider example
The fix is not complete. We need to make efl_part() work nicely in C++:
- Get the refs work properly (maybe without auto-del)
- Generate the parts from the EO file as methods on the object
Final form should be close to:
slider.indicator().format_string_set("%1.2f");
Where everything autocompletes nicely :)
-rw-r--r-- | src/examples/elementary/slider_cxx_example.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/examples/elementary/slider_cxx_example.cc b/src/examples/elementary/slider_cxx_example.cc index 797e1bd5b6..b3b3676205 100644 --- a/src/examples/elementary/slider_cxx_example.cc +++ b/src/examples/elementary/slider_cxx_example.cc | |||
@@ -30,7 +30,9 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) | |||
30 | efl::ui::Image ic2(instantiate, win); | 30 | efl::ui::Image ic2(instantiate, win); |
31 | ic2.icon_set("folder"); | 31 | ic2.icon_set("folder"); |
32 | ic2.scalable_set(false, false); | 32 | ic2.scalable_set(false, false); |
33 | efl::eo::downcast<efl::Container>(sl2.part("end")).content_set(ic2); | 33 | // FIXME: C++ part API needs special reference handling! This will show ERR! |
34 | efl::eo::downcast<efl::Container>(sl2.part("elm.swallow.end")) | ||
35 | .content_set(ic2); | ||
34 | 36 | ||
35 | sl2.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); | 37 | sl2.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); |
36 | bx.pack_end(sl2); | 38 | bx.pack_end(sl2); |
@@ -48,8 +50,12 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) | |||
48 | bx.pack_end(sl4); | 50 | bx.pack_end(sl4); |
49 | 51 | ||
50 | efl::ui::Slider sl5(instantiate, win); | 52 | efl::ui::Slider sl5(instantiate, win); |
51 | sl5.indicator_format_set("%1.2f"); | 53 | |
52 | sl4.direction_set(EFL_UI_DIR_UP); | 54 | // FIXME: C++ part API needs special reference handling! This will show ERR! |
55 | efl::eo::downcast<efl::ui::slider::Part>(sl5.part("indicator")) | ||
56 | .format_string_set("%1.2f"); | ||
57 | |||
58 | sl5.direction_set(EFL_UI_DIR_UP); | ||
53 | sl5.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); | 59 | sl5.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); |
54 | bx.pack_end(sl5); | 60 | bx.pack_end(sl5); |
55 | 61 | ||