tasn pushed a commit to branch master. http://git.enlightenment.org/bindings/cxx/eflxx.git/commit/?id=f3125c9b989b98509c17a3dd899c296b3aeee7ff
commit f3125c9b989b98509c17a3dd899c296b3aeee7ff Author: Andreas Volz <li...@brachttal.net> Date: Sun Nov 1 17:05:43 2009 +0000 ElmRadio example code SVN revision: 43396 --- eflxx_examples/src/elementaryxx/full/Makefile.am | 3 +- eflxx_examples/src/elementaryxx/full/main.cpp | 5 +- .../src/elementaryxx/full/test_radio.cpp | 89 ++++++++++++++++++++++ 3 files changed, 94 insertions(+), 3 deletions(-) diff --git a/eflxx_examples/src/elementaryxx/full/Makefile.am b/eflxx_examples/src/elementaryxx/full/Makefile.am index f322753..ded8de5 100644 --- a/eflxx_examples/src/elementaryxx/full/Makefile.am +++ b/eflxx_examples/src/elementaryxx/full/Makefile.am @@ -17,7 +17,8 @@ elementaryxx_example_full_SOURCES = \ test_table.cpp \ test_toggle.cpp \ test_slider.cpp \ - test_check.cpp + test_check.cpp \ + test_radio.cpp elementaryxx_example_full_LDADD = \ $(ELEMENTARYXX_LIBS) \ diff --git a/eflxx_examples/src/elementaryxx/full/main.cpp b/eflxx_examples/src/elementaryxx/full/main.cpp index fd5e2c5..ecb0517 100644 --- a/eflxx_examples/src/elementaryxx/full/main.cpp +++ b/eflxx_examples/src/elementaryxx/full/main.cpp @@ -27,6 +27,7 @@ void test_notepad (void *data, Evas_Object *obj, void *event_info); // ... void test_slider (void *data, Evas_Object *obj, void *event_info); void test_check (void *data, Evas_Object *obj, void *event_info); +void test_radio (void *data, Evas_Object *obj, void *event_info); // ElmApplication *elmApp; @@ -151,8 +152,8 @@ int main (int argc, char **argv) li.append("Genlist 3", NULL, NULL, my_bt_31, NULL); li.append("Genlist 4", NULL, NULL, my_bt_32, NULL);*/ li->append("Checks", test_check, NULL); - /*li.append("Radios", NULL, NULL, my_bt_34, NULL); - li.append("Pager", NULL, NULL, my_bt_35, NULL); + li->append("Radios", test_radio, NULL); + /*li.append("Pager", NULL, NULL, my_bt_35, NULL); li.append("Genlist Tree", NULL, NULL, my_bt_36, NULL); li.append("Genlist 5", NULL, NULL, my_bt_37, NULL); li.append("Window States", NULL, NULL, my_bt_38, NULL);*/ diff --git a/eflxx_examples/src/elementaryxx/full/test_radio.cpp b/eflxx_examples/src/elementaryxx/full/test_radio.cpp new file mode 100644 index 0000000..39a9df3 --- /dev/null +++ b/eflxx_examples/src/elementaryxx/full/test_radio.cpp @@ -0,0 +1,89 @@ +#include "test.h" + +void test_radio (void *data, Evas_Object *obj, void *event_info) +{ + ElmRadio *rd = NULL; + ElmRadio *rdg = NULL; + ElmIcon *ic = NULL; + + ElmWindow *win = ElmWindow::factory ("radio", ELM_WIN_BASIC); + win->setTitle ("Radios"); + win->setAutoDel (true); + + ElmBackground *bg = ElmBackground::factory (*win); + win->addObjectResize (*bg); + bg->setWeightHintSize (EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + bg->show (); + + ElmBox *bx = ElmBox::factory (*win); + win->addObjectResize (*bx); + bx->setWeightHintSize (EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + bx->show (); + + ic = ElmIcon::factory (*win); + ic->setFile (searchPixmapFile ("elementaryxx/logo_small.png")); + ic->setAspectHintSize (EVAS_ASPECT_CONTROL_VERTICAL, Size (1, 1)); + rd = ElmRadio::factory (*win); + rd->setWeightHintSize (EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + rd->setAlignHintSize (EVAS_HINT_FILL, 0.5); + rd->setLabel ("Icon sized to radio"); + rd->setIcon (*ic); + bx->packEnd (*rd); + rd->show (); + ic->show (); + rdg = rd; + + ic = ElmIcon::factory (*win); + ic->setFile (searchPixmapFile ("elementaryxx/logo_small.png")); + ic->setScale (false, false); + rd = ElmRadio::factory (*win); + rd->setStateValue (1); + rd->addGroup (*rdg); + rd->setLabel ("Icon no scale"); + rd->setIcon (*ic); + bx->packEnd (*rd); + rd->show (); + ic->show (); + + rd = ElmRadio::factory (*win); + rd->setStateValue (2); + rd->addGroup (*rdg); + rd->setLabel ("Label Only"); + bx->packEnd (*rd); + rd->show (); + + rd = ElmRadio::factory (*win); + rd->setStateValue (3); + rd->addGroup (*rdg); + rd->setLabel ("Disabled"); + rd->setDisabled (true); + bx->packEnd (*rd); + rd->show (); + + ic = ElmIcon::factory (*win); + ic->setFile (searchPixmapFile ("elementaryxx/logo_small.png")); + ic->setScale (false, false); + rd = ElmRadio::factory (*win); + rd->setStateValue (4); + rd->addGroup (*rdg); + rd->setIcon (*ic); + bx->packEnd (*rd); + rd->show (); + ic->show (); + + ic = ElmIcon::factory (*win); + ic->setFile (searchPixmapFile ("elementaryxx/logo_small.png")); + ic->setScale (false, false); + rd = ElmRadio::factory (*win); + rd->setStateValue (5); + rd->addGroup (*rdg); + rd->setIcon (*ic); + rd->setDisabled (true); + bx->packEnd (*rd); + rd->show (); + ic->show (); + + rdg->setValue (2); + + win->show (); +} --