2010-01-07 18:33:03 -08:00
|
|
|
#include <Elementary.h>
|
2010-10-19 11:25:22 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
2010-01-07 18:33:03 -08:00
|
|
|
#ifndef ELM_LIB_QUICKLAUNCH
|
|
|
|
|
|
|
|
void
|
2010-10-19 11:25:22 -07:00
|
|
|
test_label(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2010-01-07 18:33:03 -08:00
|
|
|
{
|
|
|
|
Evas_Object *win, *bg, *bx, *lb;
|
|
|
|
|
|
|
|
win = elm_win_add(NULL, "label", ELM_WIN_BASIC);
|
|
|
|
elm_win_title_set(win, "Label");
|
2011-07-25 07:22:19 -07:00
|
|
|
elm_win_autodel_set(win, EINA_TRUE);
|
2010-01-07 18:33:03 -08:00
|
|
|
|
|
|
|
bg = elm_bg_add(win);
|
|
|
|
elm_win_resize_object_add(win, bg);
|
|
|
|
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_show(bg);
|
|
|
|
|
|
|
|
bx = elm_box_add(win);
|
|
|
|
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
|
|
|
|
lb = elm_label_add(win);
|
2011-06-28 23:41:31 -07:00
|
|
|
elm_object_text_set(lb,
|
2010-01-07 18:33:03 -08:00
|
|
|
"<b>This is a small label</b>"
|
|
|
|
);
|
|
|
|
evas_object_size_hint_weight_set(lb, 0.0, 0.0);
|
|
|
|
evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
elm_box_pack_end(bx, lb);
|
|
|
|
evas_object_show(lb);
|
|
|
|
|
|
|
|
lb = elm_label_add(win);
|
2011-06-28 23:41:31 -07:00
|
|
|
elm_object_text_set(lb,
|
2011-12-08 04:39:18 -08:00
|
|
|
"This is a larger label with newlines<br/>"
|
|
|
|
"to make it bigger, bit it won't expand or wrap<br/>"
|
|
|
|
"just be a block of text that can't change its<br/>"
|
|
|
|
"formatting as it's fixed based on text<br/>"
|
2010-01-07 18:33:03 -08:00
|
|
|
);
|
|
|
|
evas_object_size_hint_weight_set(lb, 0.0, 0.0);
|
|
|
|
evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
elm_box_pack_end(bx, lb);
|
|
|
|
evas_object_show(lb);
|
|
|
|
|
|
|
|
lb = elm_label_add(win);
|
2011-09-29 20:44:46 -07:00
|
|
|
elm_label_line_wrap_set(lb, ELM_WRAP_CHAR);
|
2011-06-28 23:41:31 -07:00
|
|
|
elm_object_text_set(lb,
|
2010-01-07 18:33:03 -08:00
|
|
|
"<b>"
|
|
|
|
"This is more text designed to line-wrap here as "
|
|
|
|
"This object is resized horizontally. As it is "
|
|
|
|
"resized vertically though, nothing should change. "
|
|
|
|
"The amount of space allocated vertically should "
|
|
|
|
"change as horizontal size changes."
|
|
|
|
"</b>"
|
|
|
|
);
|
|
|
|
evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, 0.0);
|
|
|
|
evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
elm_box_pack_end(bx, lb);
|
|
|
|
evas_object_show(lb);
|
|
|
|
|
|
|
|
lb = elm_label_add(win);
|
2011-06-28 23:41:31 -07:00
|
|
|
elm_object_text_set(lb,
|
2010-01-07 18:33:03 -08:00
|
|
|
"This small label set to wrap"
|
|
|
|
);
|
|
|
|
evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, 0.0);
|
|
|
|
evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
elm_box_pack_end(bx, lb);
|
|
|
|
evas_object_show(lb);
|
|
|
|
|
|
|
|
evas_object_resize(win, 320, 300);
|
|
|
|
|
2011-10-31 09:32:13 -07:00
|
|
|
evas_object_show(bx);
|
2010-01-07 18:33:03 -08:00
|
|
|
evas_object_show(win);
|
2011-10-31 09:32:13 -07:00
|
|
|
elm_win_resize_object_add(win, bx);
|
2010-01-07 18:33:03 -08:00
|
|
|
}
|
|
|
|
#endif
|