EFL
view release on metacpan or search on metacpan
t/elementary_test.t view on Meta::CPAN
elm_win_resize_object_add($win, $bg);
evas_object_size_hint_weight_set($bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show($bg);
$sc = elm_scroller_add($win);
evas_object_size_hint_weight_set($sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add($win, $sc);
evas_object_smart_callback_add($sc, "edge_left", \&my_anchorblock_edge_left, undef);
evas_object_smart_callback_add($sc, "edge_right", \&my_anchorblock_edge_right, undef);
evas_object_smart_callback_add($sc, "edge_top", \&my_anchorblock_edge_top, undef);
evas_object_smart_callback_add($sc, "edge_bottom", \&my_anchorblock_edge_bottom, undef);
evas_object_smart_callback_add($sc, "scroll", \&my_anchorblock_scroll, undef);
$bx = elm_box_add($win);
evas_object_size_hint_weight_set($bx, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set($bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
$ic = elm_icon_add($win);
elm_icon_file_set($ic, $images{'logo_small'}, undef);
elm_icon_scale_set($ic, 0, 0);
evas_object_size_hint_aspect_set($ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
$bb = elm_bubble_add($win);
elm_bubble_label_set($bb, "Message 3");
elm_bubble_info_set($bb, "10:32 4/11/2008");
elm_bubble_icon_set($bb, $ic);
evas_object_show($ic);
evas_object_size_hint_weight_set($bb, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set($bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
$av = elm_anchorblock_add($win);
elm_anchorblock_hover_style_set($av, "popout");
elm_anchorblock_hover_parent_set($av, $win);
elm_anchorblock_text_set($av, "Hi there. This is the most recent message in the " . "list of messages. It has one <a href=tel:+614321234>+61 432 1234</a> " . "(phone number) to click on.");
evas_object_smart_callback_add($av, "anchor,clicked", \&my_anchorblock_anchor, $av);
elm_bubble_content_set($bb, $av);
evas_object_show($av);
elm_box_pack_end($bx, $bb);
evas_object_show($bb);
$ic = elm_icon_add($win);
elm_icon_file_set($ic, $images{'logo_small'}, undef);
evas_object_size_hint_aspect_set($ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
$bb = elm_bubble_add($win);
elm_bubble_label_set($bb, "Message 2");
elm_bubble_info_set($bb, "7:16 27/10/2008");
elm_bubble_icon_set($bb, $ic);
evas_object_show($ic);
evas_object_size_hint_weight_set($bb, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set($bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
$av = elm_anchorblock_add($win);
elm_anchorblock_hover_style_set($av, "popout");
elm_anchorblock_hover_parent_set($av, $win);
elm_anchorblock_text_set($av,
"Hey what are you doing? This is the second last message "
. "Hi there. This is the most recent message in the "
. "list. It's a longer one so it can wrap more and "
. "contains a <a href=contact:john>John</a> contact "
. "link in it to test popups on links. The idea is that "
. "all SMS's are scanned for things that look like phone "
. "numbers or names that are in your contacts list, and "
. "if they are, they become clickable links that pop up "
. "a menus of obvious actions to perform on this piece "
. "of information. This of course can be later explicitly "
. "done by links maybe running local apps or even being "
. "web URL's too that launch the web browser and point it "
. "to that URL.");
evas_object_smart_callback_add($av, "anchor,clicked", \&my_anchorblock_anchor, $av);
elm_bubble_content_set($bb, $av);
evas_object_show($av);
elm_box_pack_end($bx, $bb);
evas_object_show($bb);
$ic = elm_icon_add($win);
elm_icon_file_set($ic, $images{'logo_small'}, undef);
elm_icon_scale_set($ic, 0, 0);
evas_object_size_hint_aspect_set($ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
$bb = elm_bubble_add($win);
elm_bubble_label_set($bb, "Message 1");
elm_bubble_info_set($bb, "20:47 18/6/2008");
elm_bubble_icon_set($bb, $ic);
evas_object_show($ic);
evas_object_size_hint_weight_set($bb, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set($bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
$av = elm_anchorblock_add($win);
elm_anchorblock_hover_style_set($av, "popout");
elm_anchorblock_hover_parent_set($av, $win);
elm_anchorblock_text_set($av, "This is a short message");
evas_object_smart_callback_add($av, "anchor,clicked", \&my_anchorblock_anchor, $av);
elm_bubble_content_set($bb, $av);
evas_object_show($av);
elm_box_pack_end($bx, $bb);
evas_object_show($bb);
elm_scroller_content_set($sc, $bx);
evas_object_show($bx);
evas_object_show($sc);
evas_object_resize($win, 320, 300);
elm_object_focus($win);
evas_object_show($win);
}
sub tb_1 {
my ($data) = @_;
elm_photo_file_set($$data, $images{'panel'});
}
sub tb_2 {
my ($data) = @_;
elm_photo_file_set($$data, $images{'rock'});
}
t/elementary_test.t view on Meta::CPAN
elm_box_pack_end($bx, $ic);
evas_object_show($ic);
elm_list_item_append($li, "are", $bx, undef, undef, undef);
elm_list_item_append($li, "you", undef, undef, undef, undef);
elm_list_item_append($li, "doing", undef, undef, undef, undef);
elm_list_item_append($li, "out", undef, undef, undef, undef);
elm_list_item_append($li, "there", undef, undef, undef, undef);
elm_list_item_append($li, "today", undef, undef, undef, undef);
elm_list_item_append($li, "?", undef, undef, undef, undef);
elm_list_item_append($li, "Here", undef, undef, undef, undef);
elm_list_item_append($li, "are", undef, undef, undef, undef);
elm_list_item_append($li, "some", undef, undef, undef, undef);
elm_list_item_append($li, "more", undef, undef, undef, undef);
elm_list_item_append($li, "items", undef, undef, undef, undef);
elm_list_item_append($li, "Is this label long enough?", undef, undef, undef, undef);
elm_list_item_append($li, "Maybe this one is even longer so we can test long long items.", undef, undef, undef, undef);
elm_list_go($li);
evas_object_show($li);
evas_object_resize($win, 320, 300);
evas_object_show($win);
}
sub test_carousel {
my ($win, $bg);
$win = elm_win_add(undef, "carousel", ELM_WIN_BASIC);
elm_win_title_set($win, "Carousel");
elm_win_autodel_set($win, 1);
$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);
evas_object_resize($win, 320, 240);
evas_object_show($win);
}
sub test_inwin {
my ($win, $bg, $inwin, $lb);
$win = elm_win_add(undef, "inwin", ELM_WIN_BASIC);
elm_win_title_set($win, "Inwin");
elm_win_autodel_set($win, 1);
$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);
$inwin = elm_win_inwin_add($win);
evas_object_show($inwin);
$lb = elm_label_add($win);
elm_label_label_set($lb,
"This is an \"inwin\" - a window in a<br>"
. "window. This is handy for quick popups<br>"
. "you want centered, taking over the window<br>"
. "until dismissed somehow. Unlike hovers they<br>"
. "don't hover over their target.");
elm_win_inwin_content_set($inwin, $lb);
evas_object_show($lb);
evas_object_resize($win, 320, 240);
evas_object_show($win);
}
sub test_inwin2 {
my ($win, $bg, $inwin, $lb);
$win = elm_win_add(undef, "inwin", ELM_WIN_BASIC);
elm_win_title_set($win, "Inwin");
elm_win_autodel_set($win, 1);
$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);
$inwin = elm_win_inwin_add($win);
elm_object_style_set($inwin, "minimal_vertical");
evas_object_show($inwin);
$lb = elm_label_add($win);
elm_label_label_set($lb,
"This is an \"inwin\" - a window in a<br>"
. "window. This is handy for quick popups<br>"
. "you want centered, taking over the window<br>"
. "until dismissed somehow. Unlike hovers they<br>"
. "don't hover over their target.<br>" . "<br>"
. "This inwin style compacts itself vertically<br>"
. "to the size of its contents minimum size.");
elm_win_inwin_content_set($inwin, $lb);
evas_object_show($lb);
evas_object_resize($win, 320, 240);
evas_object_show($win);
}
sub test_scaling {
my ($win, $bg, $bx, $bt);
$win = elm_win_add(undef, "scaling", ELM_WIN_BASIC);
elm_win_title_set($win, "Scaling");
elm_win_autodel_set($win, 1);
$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);
elm_win_resize_object_add($win, $bx);
evas_object_show($bx);
$bt = elm_button_add($win);
elm_button_label_set($bt, "Scale: 0.5");
elm_object_scale_set($bt, 0.5);
elm_box_pack_end($bx, $bt);
evas_object_show($bt);
$bt = elm_button_add($win);
elm_button_label_set($bt, "Scale: 0.75");
elm_object_scale_set($bt, 0.75);
elm_box_pack_end($bx, $bt);
evas_object_show($bt);
$bt = elm_button_add($win);
elm_button_label_set($bt, "Scale: 1.0");
elm_object_scale_set($bt, 1.0);
elm_box_pack_end($bx, $bt);
evas_object_show($bt);
$bt = elm_button_add($win);
elm_button_label_set($bt, "Scale: 1.5");
elm_object_scale_set($bt, 1.5);
elm_box_pack_end($bx, $bt);
evas_object_show($bt);
$bt = elm_button_add($win);
elm_button_label_set($bt, "Scale: 2.0");
elm_object_scale_set($bt, 2.0);
elm_box_pack_end($bx, $bt);
evas_object_show($bt);
$bt = elm_button_add($win);
( run in 1.032 second using v1.01-cache-2.11-cpan-364913b4093 )