elm test_box.c: Used elm_bg_load_size_set. Patch by cnook
authorseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 16 Feb 2012 02:28:33 +0000 (02:28 +0000)
committerseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 16 Feb 2012 02:28:33 +0000 (02:28 +0000)
<kimcinoo@gmail.com>

On Thu, Feb 16, 2012 at 10:20 AM, cnook <kimcinoo@gmail.com> wrote:
Dear All, Hello~

As you guess, the patch is for the elementary_test.
Please review the patch and give any feedbacks.

The test_actionslider patch is mainly for elm_actionslider_xxx_get()
APIs.
It would not be a good idea to add test code for such APIs.
So I have planed to add test code except elm_xxx_get() APIs

Sincerely,
Shinwoo Kim.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@67996 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/test_bg.c

index 0b4905d..8aefc44 100644 (file)
@@ -5,6 +5,15 @@
 #ifndef ELM_LIB_QUICKLAUNCH
 
 static void
+_cb_size_radio_changed(void *data, Evas_Object *obj, void *event __UNUSED__)
+{
+   Evas_Object *o_bg = data;
+   int size;
+   size = elm_radio_value_get((Evas_Object *)obj);
+   elm_bg_load_size_set(o_bg, size, size);
+}
+
+static void
 _cb_radio_changed(void *data, Evas_Object *obj, void *event __UNUSED__)
 {
    Evas_Object *o_bg = data;
@@ -83,6 +92,8 @@ void
 test_bg_image(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
 {
    Evas_Object *win, *bg;
+   Evas_Object *box, *hbox, *o_bg;
+   Evas_Object *rd, *rdg;
    char buf[PATH_MAX];
 
    win = elm_win_add(NULL, "bg-image", ELM_WIN_BASIC);
@@ -90,12 +101,60 @@ test_bg_image(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in
    elm_win_autodel_set(win, EINA_TRUE);
 
    bg = elm_bg_add(win);
-   snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
-   elm_bg_file_set(bg, buf, NULL);
    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_win_resize_object_add(win, bg);
    evas_object_show(bg);
 
+   box = elm_box_add(win);
+   evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, box);
+   evas_object_show(box);
+
+   o_bg = elm_bg_add(win);
+   snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", elm_app_data_dir_get());
+   elm_bg_file_set(o_bg, buf, NULL);
+   evas_object_size_hint_weight_set(o_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(o_bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   elm_box_pack_end(box, o_bg);
+
+   hbox = elm_box_add(win);
+   elm_box_horizontal_set(hbox, EINA_TRUE);
+   evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
+   evas_object_size_hint_align_set(hbox, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+   rd = elm_radio_add(win);
+   elm_radio_state_value_set(rd, 50);
+   elm_object_text_set(rd, "50 x 50");
+   evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
+   evas_object_smart_callback_add(rd, "changed", _cb_size_radio_changed, o_bg);
+   elm_box_pack_end(hbox, rd);
+   evas_object_show(rd);
+   rdg = rd;
+
+   rd = elm_radio_add(win);
+   elm_radio_state_value_set(rd, 100);
+   elm_radio_group_add(rd, rdg);
+   elm_object_text_set(rd, "100 x 100");
+   evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
+   evas_object_smart_callback_add(rd, "changed", _cb_size_radio_changed, o_bg);
+   elm_box_pack_end(hbox, rd);
+   evas_object_show(rd);
+
+   rd = elm_radio_add(win);
+   elm_radio_state_value_set(rd, 200);
+   elm_radio_group_add(rd, rdg);
+   elm_object_text_set(rd, "200 x 200");
+   evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
+   evas_object_smart_callback_add(rd, "changed", _cb_size_radio_changed, o_bg);
+   elm_box_pack_end(hbox, rd);
+   evas_object_show(rd);
+
+   elm_radio_value_set(rdg, 200);
+
+   elm_box_pack_end(box, hbox);
+   evas_object_show(hbox);
+
+   evas_object_show(o_bg);
    evas_object_size_hint_min_set(bg, 160, 160);
    evas_object_size_hint_max_set(bg, 640, 640);
    evas_object_resize(win, 320, 320);