2017-11-05 21:25:22 -08:00
|
|
|
// g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` spinner_cxx_example.cc -o spinner_cxx_example
|
|
|
|
|
|
|
|
#define ELM_WIDGET_PROTECTED
|
|
|
|
|
2019-05-02 11:08:04 -07:00
|
|
|
#include <Efl_Ui.hh>
|
2017-11-05 21:25:22 -08:00
|
|
|
#include <iostream>
|
|
|
|
|
2017-11-20 03:31:07 -08:00
|
|
|
#warning FIXME: This example requires proper EO API usage (not legacy spinner)
|
2014-12-16 13:04:43 -08:00
|
|
|
|
2017-11-05 21:25:22 -08:00
|
|
|
using efl::eo::instantiate;
|
|
|
|
|
|
|
|
static void
|
|
|
|
efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
|
2014-12-16 13:04:43 -08:00
|
|
|
{
|
2017-11-20 03:31:07 -08:00
|
|
|
#if 0
|
2014-12-16 13:04:43 -08:00
|
|
|
|
2017-11-05 21:25:22 -08:00
|
|
|
efl::ui::Win win(instantiate);
|
|
|
|
win.text_set("Spinner Example");
|
2014-12-16 13:04:43 -08:00
|
|
|
win.autohide_set(true);
|
|
|
|
|
2017-11-20 03:31:07 -08:00
|
|
|
|
2017-11-05 21:25:22 -08:00
|
|
|
efl::ui::Box bx(instantiate, win);
|
|
|
|
win.content_set(bx);
|
2014-12-16 13:04:43 -08:00
|
|
|
|
2017-11-05 21:25:22 -08:00
|
|
|
elm::Spinner sp(instantiate, win);
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
sp.hint_fill_set(true, false);
|
2014-12-16 13:04:43 -08:00
|
|
|
bx.pack_end(sp);
|
|
|
|
|
2017-11-05 21:25:22 -08:00
|
|
|
elm::Spinner sp2(instantiate, win);
|
2014-12-16 13:04:43 -08:00
|
|
|
sp2.label_format_set("Percentage %%%1.2f something");
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
sp2.hint_fill_set(true, false);
|
2014-12-16 13:04:43 -08:00
|
|
|
bx.pack_end(sp2);
|
|
|
|
|
2017-11-05 21:25:22 -08:00
|
|
|
elm::Spinner sp3(instantiate, win);
|
2014-12-16 13:04:43 -08:00
|
|
|
sp3.label_format_set("%1.1f units");
|
|
|
|
sp3.step_set(1.5);
|
|
|
|
sp3.wrap_set(true);
|
|
|
|
sp3.min_max_set(-50.0, 250.0);
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
sp3.hint_fill_set(true, false);
|
2014-12-16 13:04:43 -08:00
|
|
|
bx.pack_end(sp3);
|
|
|
|
|
2017-11-05 21:25:22 -08:00
|
|
|
elm::Spinner sp4(instantiate, win);
|
2014-12-16 13:04:43 -08:00
|
|
|
sp4.style_set("vertical");
|
|
|
|
sp4.interval_set(0.2);
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
sp4.hint_fill_set(true, false);
|
2014-12-16 13:04:43 -08:00
|
|
|
bx.pack_end(sp4);
|
|
|
|
|
2017-11-05 21:25:22 -08:00
|
|
|
elm::Spinner sp5(instantiate, win);
|
2014-12-16 13:04:43 -08:00
|
|
|
sp5.editable_set(false);
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
sp5.hint_fill_set(true, false);
|
2014-12-16 13:04:43 -08:00
|
|
|
bx.pack_end(sp5);
|
|
|
|
|
2017-11-05 21:25:22 -08:00
|
|
|
elm::Spinner sp6(instantiate, win);
|
2014-12-16 13:04:43 -08:00
|
|
|
sp6.editable_set(false);
|
|
|
|
sp6.min_max_set(1, 12);
|
|
|
|
sp6.special_value_add(1, "January");
|
|
|
|
sp6.special_value_add(2, "February");
|
|
|
|
sp6.special_value_add(3, "March");
|
|
|
|
sp6.special_value_add(4, "April");
|
|
|
|
sp6.special_value_add(5, "May");
|
|
|
|
sp6.special_value_add(6, "June");
|
|
|
|
sp6.special_value_add(7, "July");
|
|
|
|
sp6.special_value_add(8, "August");
|
|
|
|
sp6.special_value_add(9, "September");
|
|
|
|
sp6.special_value_add(10, "October");
|
|
|
|
sp6.special_value_add(11, "November");
|
|
|
|
sp6.special_value_add(12, "December");
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
sp6.hint_fill_set(true, false);
|
2014-12-16 13:04:43 -08:00
|
|
|
bx.pack_end(sp6);
|
|
|
|
|
2017-11-05 21:25:22 -08:00
|
|
|
elm::Spinner sp7(instantiate, win);
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
sp7.hint_fill_set(true, false);
|
2014-12-16 13:04:43 -08:00
|
|
|
bx.pack_end(sp7);
|
|
|
|
sp7.editable_set(true);
|
|
|
|
|
2017-11-05 21:25:22 -08:00
|
|
|
auto changed = std::bind([] (elm::Spinner &spinner)
|
|
|
|
{ std::cout << "Value changed to " << spinner.value_get() << std::endl; },
|
|
|
|
std::placeholders::_1);
|
|
|
|
efl::eolian::event_add(elm::Spinner::changed_event, sp7, changed);
|
2014-12-16 13:04:43 -08:00
|
|
|
|
2017-11-05 21:25:22 -08:00
|
|
|
auto delay = std::bind([] (elm::Spinner &spinner)
|
|
|
|
{ std::cout << "Value changed to " << spinner.value_get() << "" << std::endl; },
|
|
|
|
std::placeholders::_1);
|
|
|
|
efl::eolian::event_add(elm::Spinner::delay_changed_event, sp7, delay);
|
2017-11-20 03:31:07 -08:00
|
|
|
|
|
|
|
#endif
|
2014-12-16 13:04:43 -08:00
|
|
|
}
|
2017-11-05 21:25:22 -08:00
|
|
|
EFL_MAIN()
|