}
static void
-_first_bt_clicked(void *data, Evas_Object *obj __UNUSED__,
- void *event_info __UNUSED__)
-{
- char str[128];
- Evas_Object *li = (Evas_Object *) data;
- Evas_Object *lb;
-
- Elm_Object_Item *lit = elm_list_first_item_get(li);
- if (!lit) return;
- sprintf(str, "%s is selected", elm_object_item_text_get(lit));
- elm_list_item_bring_in(lit);
- elm_list_item_selected_set(lit, EINA_TRUE);
-
- lb = evas_object_data_get(li, "label");
- elm_object_text_set(lb, str);
-}
-
-static void
-_prev_bt_clicked(void *data, Evas_Object *obj __UNUSED__,
- void *event_info __UNUSED__)
-{
- char str[128];
- Evas_Object *li = (Evas_Object *) data;
- Evas_Object *lb;
-
- Elm_Object_Item *lit = elm_list_selected_item_get(li);
- if (!lit) return;
- lit = elm_list_item_prev(lit);
- if (!lit) return;
-
- sprintf(str, "%s is selected", elm_object_item_text_get(lit));
- elm_list_item_bring_in(lit);
- elm_list_item_selected_set(lit, EINA_TRUE);
-
- lb = evas_object_data_get(li, "label");
- elm_object_text_set(lb, str);
-}
-
-static void
-_next_bt_clicked(void *data, Evas_Object *obj __UNUSED__,
- void *event_info __UNUSED__)
-{
- char str[128];
- Evas_Object *li = (Evas_Object *) data;
- Evas_Object *lb;
-
- Elm_Object_Item *lit = elm_list_selected_item_get(li);
- if (!lit) return;
- lit = elm_list_item_next(lit);
- if (!lit) return;
-
- sprintf(str, "%s is selected", elm_object_item_text_get(lit));
- elm_list_item_bring_in(lit);
- elm_list_item_selected_set(lit, EINA_TRUE);
-
- lb = evas_object_data_get(li, "label");
- elm_object_text_set(lb, str);
-}
-
-static void
-_last_bt_clicked(void *data, Evas_Object *obj __UNUSED__,
- void *event_info __UNUSED__)
-{
- char str[128];
- Evas_Object *li = (Evas_Object *) data;
- Evas_Object *lb;
-
- Elm_Object_Item *lit = elm_list_last_item_get(li);
- if (!lit) return;
- sprintf(str, "%s is selected", elm_object_item_text_get(lit));
- elm_list_item_bring_in(lit);
- elm_list_item_selected_set(lit, EINA_TRUE);
-
- lb = evas_object_data_get(li, "label");
- elm_object_text_set(lb, str);
-}
-
-static void
_it_clicked(void *data, Evas_Object *obj __UNUSED__,
void *event_info __UNUSED__)
{
evas_object_show(win);
}
+static void
+_first_bt_clicked(void *data, Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ char str[128];
+ Evas_Object *li = data, *lb;
+ Elm_Object_Item *lit = elm_list_first_item_get(li);
+ if (!lit) return;
+
+ sprintf(str, "%s is selected", elm_object_item_text_get(lit));
+ elm_list_item_bring_in(lit);
+ elm_list_item_selected_set(lit, EINA_TRUE);
+
+ lb = evas_object_data_get(li, "label");
+ elm_object_text_set(lb, str);
+}
+
+static void
+_prev_bt_clicked(void *data, Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ char str[128];
+ Evas_Object *li = data, *lb;
+
+ Elm_Object_Item *lit = elm_list_selected_item_get(li);
+ if (!lit) return;
+ lit = elm_list_item_prev(lit);
+ if (!lit) return;
+
+ sprintf(str, "%s is selected", elm_object_item_text_get(lit));
+ elm_list_item_bring_in(lit);
+ elm_list_item_selected_set(lit, EINA_TRUE);
+
+ lb = evas_object_data_get(li, "label");
+ elm_object_text_set(lb, str);
+}
+
+static void
+_next_bt_clicked(void *data, Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ char str[128];
+ Evas_Object *li = data, *lb;
+
+ Elm_Object_Item *lit = elm_list_selected_item_get(li);
+ if (!lit) return;
+ lit = elm_list_item_next(lit);
+ if (!lit) return;
+
+ sprintf(str, "%s is selected", elm_object_item_text_get(lit));
+ elm_list_item_bring_in(lit);
+ elm_list_item_selected_set(lit, EINA_TRUE);
+
+ lb = evas_object_data_get(li, "label");
+ elm_object_text_set(lb, str);
+}
+
+static void
+_last_bt_clicked(void *data, Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ char str[128];
+ Evas_Object *li = data, *lb;
+ Elm_Object_Item *lit = elm_list_last_item_get(li);
+ if (!lit) return;
+
+ sprintf(str, "%s is selected", elm_object_item_text_get(lit));
+ elm_list_item_bring_in(lit);
+ elm_list_item_selected_set(lit, EINA_TRUE);
+
+ lb = evas_object_data_get(li, "label");
+ elm_object_text_set(lb, str);
+}
+
void
test_list6(void *data __UNUSED__,
Evas_Object *obj __UNUSED__,
void *event_info __UNUSED__)
{
Evas_Object *win, *gd, *bt, *li, *lb;
+
win = elm_win_util_standard_add("list6", "List 6");
elm_win_autodel_set(win, EINA_TRUE);
li = elm_list_add(win);
evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_list_mode_set(li, ELM_LIST_COMPRESS);
- elm_grid_pack(gd, li, 4, 4, 92, 72);
+ elm_grid_pack(gd, li, 4, 4, 92, 72);
evas_object_show(li);
elm_list_item_append(li, "Eina", NULL, NULL, _it_clicked, li);
bt = elm_button_add(win);
elm_object_text_set(bt, "First");
evas_object_smart_callback_add(bt, "clicked", _first_bt_clicked, li);
- elm_grid_pack(gd, bt, 4, 80, 20, 10);
+ elm_grid_pack(gd, bt, 4, 80, 20, 10);
evas_object_show(bt);
bt = elm_button_add(win);
elm_object_text_set(bt, "Prev");
evas_object_smart_callback_add(bt, "clicked", _prev_bt_clicked, li);
- elm_grid_pack(gd, bt, 28, 80, 20, 10);
+ elm_grid_pack(gd, bt, 28, 80, 20, 10);
evas_object_show(bt);
bt = elm_button_add(win);
elm_object_text_set(bt, "Next");
evas_object_smart_callback_add(bt, "clicked", _next_bt_clicked, li);
- elm_grid_pack(gd, bt, 52, 80, 20, 10);
+ elm_grid_pack(gd, bt, 52, 80, 20, 10);
evas_object_show(bt);
bt = elm_button_add(win);
elm_object_text_set(bt, "Last");
evas_object_smart_callback_add(bt, "clicked", _last_bt_clicked, li);
- elm_grid_pack(gd, bt, 76, 80, 20, 10);
+ elm_grid_pack(gd, bt, 76, 80, 20, 10);
evas_object_show(bt);
lb = elm_label_add(win);
elm_object_text_set(lb, "Nothing is selected");
- elm_grid_pack(gd, lb, 4, 90, 92, 10);
+ elm_grid_pack(gd, lb, 4, 90, 92, 10);
evas_object_show(lb);
evas_object_data_set(li, "label", lb);