printf("drag stop\n");
}
+static void
+item_longpress(void *data, Evas_Object *obj, void *event_info)
+{
+ printf("longpress\n");
+}
+
void
test_genlist5(void *data, Evas_Object *obj, void *event_info)
{
evas_object_smart_callback_add(gl, "drag,start,right", item_drag_right, NULL);
evas_object_smart_callback_add(gl, "drag", item_drag, NULL);
evas_object_smart_callback_add(gl, "drag,stop", item_drag_stop, NULL);
+ evas_object_smart_callback_add(gl, "longpressed", item_longpress, NULL);
bx2 = elm_box_add(win);
elm_box_horizontal_set(bx2, 1);
_item_unselect(it);
}
}
- if ((!it->down) || (it->wd->on_hold) || (it->wd->longpressed))
+ if ((it->dragging) && (it->down))
{
if (it->long_timer)
{
ecore_timer_del(it->long_timer);
it->long_timer = NULL;
}
+ evas_object_smart_callback_call(it->wd->obj, "drag", it);
return;
}
- if (it->dragging)
+ if ((!it->down)/* || (it->wd->on_hold)*/ || (it->wd->longpressed))
{
if (it->long_timer)
{
ecore_timer_del(it->long_timer);
it->long_timer = NULL;
}
- evas_object_smart_callback_call(it->wd->obj, "drag", it);
return;
}
if (!it->display_only)
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
it->dx = ev->canvas.x - x;
it->dy = ev->canvas.y - y;
+ it->wd->longpressed = EINA_FALSE;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) it->wd->on_hold = EINA_TRUE;
else it->wd->on_hold = EINA_FALSE;
it->wd->wasselected = it->selected;
it->down = 0;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) it->wd->on_hold = EINA_TRUE;
else it->wd->on_hold = EINA_FALSE;
+ it->wd->longpressed = EINA_FALSE;
if (it->long_timer)
{
ecore_timer_del(it->long_timer);
}
if (it->wd->on_hold)
{
- it->wd->longpressed = EINA_FALSE;
it->wd->on_hold = EINA_FALSE;
return;
}
if (ev->button != 1) return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) wd->on_hold = EINA_TRUE;
else wd->on_hold = EINA_FALSE;
+ wd->longpressed = EINA_FALSE;
if (it->long_timer)
{
ecore_timer_del(it->long_timer);
}
if (wd->longpressed)
{
- wd->longpressed = EINA_FALSE;
if (!wd->wasselected) _item_unselect(it);
wd->wasselected = 0;
return;