} Testitem;
static Elm_Gengrid_Item_Class gic;
+static Eina_Bool cursor_setted = EINA_FALSE;
char *
grd_lbl_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
return strdup(buf);
}
+static void
+bt_clicked(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ if (cursor_setted)
+ {
+ elm_object_cursor_unset(obj);
+ cursor_setted = EINA_FALSE;
+ elm_object_text_set(obj, "Cursor set on click");
+ }
+ else
+ {
+ elm_object_cursor_set(obj, ELM_CURSOR_HAND1);
+ cursor_setted = EINA_TRUE;
+ elm_object_text_set(obj, "Cursor unset on click");
+ }
+}
+
void
test_cursor(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
elm_box_pack_end(bx, bt);
evas_object_show(bt);
+ bt = elm_button_add(win);
+ elm_object_text_set(bt, "Cursor set on click");
+ evas_object_smart_callback_add(bt, "clicked", bt_clicked, NULL);
+ elm_box_pack_end(bx, bt);
+ evas_object_show(bt);
+
list = elm_list_add(win);
elm_box_pack_end(bx, list);
evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
#undef CEIL
#define CEIL(a) (((a) % 2 != 0) ? ((a) / 2 + 1) : ((a) / 2))
+#undef IS_INSIDE
+#define IS_INSIDE(x, y, xx, yy, ww, hh) \
+ (((x) < ((xx) + (ww))) && ((y) < ((yy) + (hh))) && \
+ ((x) >= (xx)) && ((y) >= (yy)))
#define ELM_SAFE_FREE(_h, _fn) do { _fn((void*)_h); _h = NULL; } while (0)
#endif
}
}
+
+ Evas_Coord x, y, w, h, px, py;
+ evas_object_geometry_get(cur->eventarea, &x, &y, &w, &h);
+ evas_pointer_canvas_xy_get(cur->evas, &px, &py);
+ if (IS_INSIDE(px, py, x, y, w, h))
+ _elm_cursor_set(cur);
}
/**