elm test_genlist.c: Fixed wrong item class assignment. Anybody who wrote this code...
[framework/uifw/elementary.git] / src / bin / test_toggle.c
index e8046f1..7bda066 100644 (file)
@@ -11,7 +11,7 @@ test_toggle(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
 
    win = elm_win_add(NULL, "toggles", ELM_WIN_BASIC);
    elm_win_title_set(win, "Toggles");
-   elm_win_autodel_set(win, 1);
+   elm_win_autodel_set(win, EINA_TRUE);
 
    bg = elm_bg_add(win);
    elm_win_resize_object_add(win, bg);
@@ -24,60 +24,66 @@ test_toggle(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
    evas_object_show(bx);
 
    ic = elm_icon_add(win);
-   snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
+   snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
    elm_icon_file_set(ic, buf, NULL);
    evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
 
-   tg = elm_toggle_add(win);
+   tg = elm_check_add(win);
+   elm_object_style_set(tg, "toggle");
    evas_object_size_hint_weight_set(tg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(tg, EVAS_HINT_FILL, 0.5);
-   elm_toggle_label_set(tg, "Icon sized to toggle");
-   elm_toggle_icon_set(tg, ic);
-   elm_toggle_state_set(tg, 1);
-   elm_toggle_states_labels_set(tg, "Yes", "No");
+   elm_object_text_set(tg, "Icon sized to toggle");
+   elm_object_part_content_set(tg, "icon", ic);
+   elm_check_state_set(tg, EINA_TRUE);
+   elm_object_part_text_set(tg, "on", "Yes");
+   elm_object_part_text_set(tg, "off", "No");
    elm_box_pack_end(bx, tg);
    evas_object_show(tg);
    evas_object_show(ic);
 
    ic = elm_icon_add(win);
-   snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
+   snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
    elm_icon_file_set(ic, buf, NULL);
-   elm_icon_scale_set(ic, 0, 0);
+   elm_icon_resizable_set(ic, 0, 0);
 
-   tg = elm_toggle_add(win);
-   elm_toggle_label_set(tg, "Icon no scale");
-   elm_toggle_icon_set(tg, ic);
+   tg = elm_check_add(win);
+   elm_object_style_set(tg, "toggle");
+   elm_object_text_set(tg, "Icon no scale");
+   elm_object_part_content_set(tg, "icon", ic);
    elm_box_pack_end(bx, tg);
    evas_object_show(tg);
    evas_object_show(ic);
 
    ic = elm_icon_add(win);
-   snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
+   snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
    elm_icon_file_set(ic, buf, NULL);
-   elm_icon_scale_set(ic, 0, 0);
+   elm_icon_resizable_set(ic, 0, 0);
 
-   tg = elm_toggle_add(win);
-   elm_toggle_label_set(tg, "Icon no scale");
-   elm_toggle_icon_set(tg, ic);
-   elm_object_disabled_set(tg, 1);
+   tg = elm_check_add(win);
+   elm_object_style_set(tg, "toggle");
+   elm_object_text_set(tg, "Disabled check");
+   elm_object_part_content_set(tg, "icon", ic);
+   elm_object_disabled_set(tg, EINA_TRUE);
    elm_box_pack_end(bx, tg);
    evas_object_show(tg);
    evas_object_show(ic);
 
-   tg = elm_toggle_add(win);
-   elm_toggle_label_set(tg, "Label Only");
-   elm_toggle_states_labels_set(tg, "Big long fun times label", 
-                                "Small long happy fun label");
+   tg = elm_check_add(win);
+   elm_object_style_set(tg, "toggle");
+   elm_object_text_set(tg, "Label Only");
+   elm_object_part_text_set(tg, "on", "Big long fun times label");
+   elm_object_part_text_set(tg, "off", "Small long happy fun label");
    elm_box_pack_end(bx, tg);
    evas_object_show(tg);
 
    ic = elm_icon_add(win);
-   snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
+   snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
    elm_icon_file_set(ic, buf, NULL);
-   elm_icon_scale_set(ic, 0, 0);
+   elm_icon_resizable_set(ic, 0, 0);
 
-   tg = elm_toggle_add(win);
-   elm_toggle_icon_set(tg, ic);
+   tg = elm_check_add(win);
+   elm_object_style_set(tg, "toggle");
+   elm_object_part_content_set(tg, "icon", ic);
    elm_box_pack_end(bx, tg);
    evas_object_show(tg);
    evas_object_show(ic);