2009-11-01 05:18:59 -08:00
|
|
|
#include "test.h"
|
2009-10-11 11:21:17 -07:00
|
|
|
|
|
|
|
void test_button (void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
2009-11-30 15:31:37 -08:00
|
|
|
Icon *ic = NULL;
|
|
|
|
Button *bt = NULL;
|
2011-04-13 06:25:55 -07:00
|
|
|
|
2009-11-30 15:31:37 -08:00
|
|
|
Window *win = Window::factory ("buttons", ELM_WIN_BASIC);
|
2009-10-11 11:21:17 -07:00
|
|
|
win->setTitle ("Buttons");
|
|
|
|
win->setAutoDel (true);
|
2011-04-13 06:25:55 -07:00
|
|
|
|
2009-11-30 15:31:37 -08:00
|
|
|
Background *bg = Background::factory (*win);
|
2012-11-21 14:20:44 -08:00
|
|
|
win->addResizeObject (*bg);
|
2012-11-21 12:38:54 -08:00
|
|
|
bg->setSizeHintWeight (EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
2009-10-11 11:21:17 -07:00
|
|
|
bg->show ();
|
2011-04-13 06:25:55 -07:00
|
|
|
|
2009-11-30 15:31:37 -08:00
|
|
|
Box *bx = Box::factory (*win);
|
2012-11-21 14:20:44 -08:00
|
|
|
win->addResizeObject (*bx);
|
2012-11-21 12:38:54 -08:00
|
|
|
bx->setSizeHintWeight (EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
2009-10-11 11:21:17 -07:00
|
|
|
bx->show ();
|
|
|
|
|
2009-11-30 15:31:37 -08:00
|
|
|
ic = Icon::factory (*win);
|
2009-10-11 11:21:17 -07:00
|
|
|
ic->setFile (searchPixmapFile ("elementaryxx/logo_small.png"));
|
2012-11-21 12:38:54 -08:00
|
|
|
ic->setSizeHintAspect (EVAS_ASPECT_CONTROL_VERTICAL, Size (1, 1));
|
2009-11-30 15:31:37 -08:00
|
|
|
bt = Button::factory (*win);
|
2012-03-16 14:02:58 -07:00
|
|
|
bt->setText ("Icon sized to button");
|
|
|
|
bt->setContent (*ic);
|
2009-10-11 11:21:17 -07:00
|
|
|
bx->packEnd (*bt);
|
|
|
|
bt->show ();
|
|
|
|
ic->show ();
|
2011-04-13 06:25:55 -07:00
|
|
|
|
2009-11-30 15:31:37 -08:00
|
|
|
ic = Icon::factory (*win);
|
2009-10-11 14:03:08 -07:00
|
|
|
ic->setFile (searchPixmapFile ("elementaryxx/logo_small.png"));
|
2012-11-21 12:38:54 -08:00
|
|
|
ic->setSizeHintAspect (EVAS_ASPECT_CONTROL_VERTICAL, Size (1, 1));
|
2009-11-30 15:31:37 -08:00
|
|
|
bt = Button::factory (*win);
|
2012-03-16 14:02:58 -07:00
|
|
|
bt->setText ("Disabled Button");
|
|
|
|
bt->setContent (*ic);
|
2009-10-11 14:03:08 -07:00
|
|
|
bt->setDisabled (true);
|
|
|
|
bx->packEnd (*bt);
|
|
|
|
bt->show ();
|
|
|
|
ic->show ();
|
2009-10-11 11:21:17 -07:00
|
|
|
|
2009-11-30 15:31:37 -08:00
|
|
|
ic = Icon::factory (*win);
|
2009-10-11 14:03:08 -07:00
|
|
|
ic->setFile (searchPixmapFile ("elementaryxx/logo_small.png"));
|
2012-03-14 15:19:42 -07:00
|
|
|
ic->setNoScale (true);
|
2009-11-30 15:31:37 -08:00
|
|
|
bt = Button::factory (*win);
|
2012-03-16 14:02:58 -07:00
|
|
|
bt->setText ("Icon no scale");
|
|
|
|
bt->setContent (*ic);
|
2009-10-11 14:03:08 -07:00
|
|
|
bx->packEnd (*bt);
|
|
|
|
bt->show ();
|
|
|
|
ic->show ();
|
2009-10-11 11:21:17 -07:00
|
|
|
|
2009-11-30 15:31:37 -08:00
|
|
|
bt = Button::factory (*win);
|
2012-03-16 14:02:58 -07:00
|
|
|
bt->setText ("Label Only");
|
2009-10-11 14:03:08 -07:00
|
|
|
bx->packEnd (*bt);
|
|
|
|
bt->show ();
|
2009-10-11 11:21:17 -07:00
|
|
|
|
2009-11-30 15:31:37 -08:00
|
|
|
ic = Icon::factory (*win);
|
2009-10-11 14:03:08 -07:00
|
|
|
ic->setFile (searchPixmapFile ("elementaryxx/logo_small.png"));
|
2012-03-14 15:19:42 -07:00
|
|
|
ic->setNoScale (true);
|
2009-11-30 15:31:37 -08:00
|
|
|
bt = Button::factory (*win);
|
2012-03-16 14:02:58 -07:00
|
|
|
bt->setText ("Icon no scale");
|
|
|
|
bt->setContent (*ic);
|
2009-10-11 14:03:08 -07:00
|
|
|
bx->packEnd (*bt);
|
|
|
|
bt->show ();
|
|
|
|
ic->show ();
|
2011-04-13 06:25:55 -07:00
|
|
|
|
2009-10-11 11:21:17 -07:00
|
|
|
win->show ();
|
|
|
|
}
|