-#include <Elementary.h>
#include <Elementary_Cursor.h>
#include "test.h"
#ifdef HAVE_CONFIG_H
#include "elementary_config.h"
#endif
+#include <Elementary.h>
#ifndef ELM_LIB_QUICKLAUNCH
struct _api_data
{
set_api_state(api_data *api)
{
const Eina_List *items = elm_box_children_get(api->box);
- if(!eina_list_count(items))
+ if (!eina_list_count(items))
return;
Evas_Object *gl = eina_list_nth(items, 0); /* Genlist is the first item */
void
test_genlist10(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
- Evas_Object *win, *fr, *lb, *bx, *bx2, *bx3, *rd, *rdg, *gl;
+ Evas_Object *win, *fr, *bx, *bx2, *rd, *rdg, *gl;
int i;
- win = elm_win_util_standard_add("genlist10", "Genlist Mode");
+ win = elm_win_util_standard_add("genlist-decorate-item-mode", "Genlist Decorate Item Mode");
elm_win_autodel_set(win, EINA_TRUE);
bx = elm_box_add(win);
evas_object_show(bx);
fr = elm_frame_add(win);
- elm_object_text_set(fr, "Mode Type");
+ elm_object_text_set(fr, "Decorate Mode Type");
elm_box_pack_end(bx, fr);
evas_object_show(fr);
elm_object_content_set(fr, bx2);
evas_object_show(bx2);
- lb = elm_label_add(win);
- elm_object_text_set(lb,
- "Sweep genlist items to the right.<br/>"
- "Test this by changing Mode Type to Slide or Rotate.");
- elm_box_pack_end(bx2, lb);
- evas_object_show(lb);
-
- bx3 = elm_box_add(win);
- elm_box_horizontal_set(bx3, EINA_TRUE);
- elm_box_pack_end(bx2, bx3);
- evas_object_show(bx3);
-
rd = elm_radio_add(win);
evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_radio_state_value_set(rd, 0);
- elm_object_text_set(rd, "Slide ");
+ elm_object_text_set(rd, "Slide : Sweep genlist items to the right.");
evas_object_show(rd);
- elm_box_pack_end(bx3, rd);
+ elm_box_pack_end(bx2, rd);
rdg = rd;
rd = elm_radio_add(win);
evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_radio_state_value_set(rd, 1);
- elm_object_text_set(rd, "Rotate");
+ elm_object_text_set(rd, "Rotate : Click each item.");
elm_radio_group_add(rd, rdg);
evas_object_show(rd);
- elm_box_pack_end(bx3, rd);
+ elm_box_pack_end(bx2, rd);
gl = elm_genlist_add(win);
evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
* @param obj : the genlist object.
* @param item : the moved item.
*
- * If the move_after is true,
+ * the item(*item) had been moved
+ *
+ */
+static void gl_moved(Evas_Object *data __UNUSED__, Evas_Object *obj __UNUSED__, Elm_Object_Item *item __UNUSED__)
+{
+ // if needed, add application logic.
+}
+
+/**
+ * gl_moved_after is called after an item was reordered.
+ * This is only called when reorder mode is enabled.
+ *
+ * @param data : the genlist object passed as data.
+ * @param obj : the genlist object.
+ * @param item : the moved item.
+ *
* the item(*item) had been moved after the given relative item(*rel_item) in list.
- * If the move_after is false,
+ *
+ */
+static void gl_moved_after(Evas_Object *data __UNUSED__, Evas_Object *obj __UNUSED__, Elm_Object_Item *item __UNUSED__)
+{
+ // if needed, add application logic.
+ Elm_Object_Item *it;
+ it = elm_genlist_item_prev_get(item);
+ printf("it=%p, prev_it=%p\n",item,it);
+}
+
+/**
+ * gl_moved_before is called after an item was reordered.
+ * This is only called when reorder mode is enabled.
+ *
+ * @param data : the genlist object passed as data.
+ * @param obj : the genlist object.
+ * @param item : the moved item.
+ *
* the item(*item) had been moved before the given relative item(*rel_item) in list.
*
*/
-static void gl_moved(Evas_Object *data __UNUSED__, Evas_Object *obj __UNUSED__, Elm_Object_Item *item __UNUSED__)
+static void gl_moved_before(Evas_Object *data __UNUSED__, Evas_Object *obj __UNUSED__, Elm_Object_Item *item __UNUSED__)
{
// if needed, add application logic.
+ Elm_Object_Item *it;
+ it = elm_genlist_item_next_get(item);
+ printf("it=%p, next_it=%p\n",item,it);
}
void
itc1->func.state_get = gl_state_get;
itc1->func.del = NULL;
evas_object_smart_callback_add(gl, "moved", (Evas_Smart_Cb)gl_moved, gl);
+ evas_object_smart_callback_add(gl, "moved,after", (Evas_Smart_Cb)gl_moved_after, gl);
+ evas_object_smart_callback_add(gl, "moved,before", (Evas_Smart_Cb)gl_moved_before, gl);
for (i = 0; i < 50; i++)
elm_genlist_item_append(gl,
// "edit_default" EDC layout is like below. each part is swallow part.
// the existing item is swllowed to elm.swallow.edit.content part.
- // ----------------------------------------------------------------
- // | elm.edit.icon.1 | elm.swallow.edit.content | elm.edit.icon,2 |
- // ----------------------------------------------------------------
+ // --------------------------------------------------------------------
+ // | elm.edit.icon.1 | elm.swallow.decorate.content | elm.edit.icon,2 |
+ // --------------------------------------------------------------------
if (!strcmp(part, "elm.swallow.end"))
{
}
static void
-gl15_edit_mode(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+gl15_deco_all_mode(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
elm_genlist_decorate_mode_set(data, EINA_TRUE);
elm_genlist_select_mode_set(data, ELM_OBJECT_SELECT_MODE_ALWAYS);
int i;
static Testitem tit[100];
- win = elm_win_util_standard_add("genlist-edit-mode", "Genlist Edit Mode");
+ win = elm_win_util_standard_add("genlist-decorate-all-mode", "Genlist Decorate All Mode");
elm_win_autodel_set(win, EINA_TRUE);
bx = elm_box_add(win);
evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
bt = elm_button_add(win);
- elm_object_text_set(bt, "Edit mode");
- evas_object_smart_callback_add(bt, "clicked", gl15_edit_mode, gl);
+ elm_object_text_set(bt, "Decorate All mode");
+ evas_object_smart_callback_add(bt, "clicked", gl15_deco_all_mode, gl);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
elm_box_pack_end(bx2, bt);