2010-09-17 11:26:04 -07:00
|
|
|
#include <Elementary.h>
|
|
|
|
#include <Elementary_Cursor.h>
|
2010-10-19 11:25:22 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
2010-09-17 11:26:04 -07:00
|
|
|
#ifndef ELM_LIB_QUICKLAUNCH
|
|
|
|
|
2010-09-27 11:18:37 -07:00
|
|
|
typedef struct _Testitem
|
|
|
|
{
|
|
|
|
Elm_Gengrid_Item *item;
|
|
|
|
const char *path;
|
|
|
|
int mode;
|
|
|
|
int onoff;
|
|
|
|
} Testitem;
|
|
|
|
|
|
|
|
static Elm_Gengrid_Item_Class gic;
|
|
|
|
|
|
|
|
char *
|
2010-10-19 11:25:22 -07:00
|
|
|
grd_lbl_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__)
|
2010-09-27 11:18:37 -07:00
|
|
|
{
|
|
|
|
const Testitem *ti = data;
|
|
|
|
char buf[256];
|
|
|
|
snprintf(buf, sizeof(buf), "Photo %s", ti->path);
|
|
|
|
return strdup(buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
Evas_Object *
|
|
|
|
grd_icon_get(void *data, Evas_Object *obj, const char *part)
|
|
|
|
{
|
|
|
|
const Testitem *ti = data;
|
|
|
|
if (!strcmp(part, "elm.swallow.icon"))
|
|
|
|
{
|
|
|
|
Evas_Object *icon = elm_bg_add(obj);
|
|
|
|
elm_bg_file_set(icon, ti->path, NULL);
|
|
|
|
evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL,
|
|
|
|
1, 1);
|
|
|
|
evas_object_show(icon);
|
|
|
|
return icon;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Elm_Genlist_Item_Class itct;
|
|
|
|
|
|
|
|
static void
|
2010-10-19 11:25:22 -07:00
|
|
|
glt_exp(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
2010-09-27 11:18:37 -07:00
|
|
|
{
|
|
|
|
Elm_Genlist_Item *it = event_info;
|
|
|
|
Evas_Object *gl = elm_genlist_item_genlist_get(it);
|
2010-09-29 05:22:22 -07:00
|
|
|
int val = (int)(long)elm_genlist_item_data_get(it);
|
2010-09-27 11:18:37 -07:00
|
|
|
Elm_Genlist_Item *it1, *it2, *it3;
|
|
|
|
|
|
|
|
val *= 10;
|
2010-09-29 05:22:22 -07:00
|
|
|
it1 = elm_genlist_item_append(gl, &itct, (void *)(long)(val + 1), it,
|
2010-09-27 11:18:37 -07:00
|
|
|
ELM_GENLIST_ITEM_NONE, NULL, NULL);
|
2010-09-29 05:22:22 -07:00
|
|
|
it2 = elm_genlist_item_append(gl, &itct, (void *)(long)(val + 2), it,
|
2010-09-27 11:18:37 -07:00
|
|
|
ELM_GENLIST_ITEM_NONE, NULL, NULL);
|
2010-09-29 05:22:22 -07:00
|
|
|
it3 = elm_genlist_item_append(gl, &itct, (void *)(long)(val + 3), it,
|
2010-09-27 11:18:37 -07:00
|
|
|
ELM_GENLIST_ITEM_SUBITEMS, NULL, NULL);
|
|
|
|
|
|
|
|
elm_genlist_item_cursor_set(it1, ELM_CURSOR_HAND2);
|
|
|
|
elm_genlist_item_cursor_set(it2, ELM_CURSOR_HAND2);
|
|
|
|
elm_genlist_item_cursor_set(it3, ELM_CURSOR_HAND1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-10-19 11:25:22 -07:00
|
|
|
glt_con(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
2010-09-27 11:18:37 -07:00
|
|
|
{
|
|
|
|
Elm_Genlist_Item *it = event_info;
|
|
|
|
elm_genlist_item_subitems_clear(it);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-10-19 11:25:22 -07:00
|
|
|
glt_exp_req(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
2010-09-27 11:18:37 -07:00
|
|
|
{
|
|
|
|
Elm_Genlist_Item *it = event_info;
|
|
|
|
elm_genlist_item_expanded_set(it, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-10-19 11:25:22 -07:00
|
|
|
glt_con_req(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
2010-09-27 11:18:37 -07:00
|
|
|
{
|
|
|
|
Elm_Genlist_Item *it = event_info;
|
|
|
|
elm_genlist_item_expanded_set(it, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
char *
|
2010-10-19 11:25:22 -07:00
|
|
|
glt_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__)
|
2010-09-27 11:18:37 -07:00
|
|
|
{
|
|
|
|
char buf[256];
|
2010-09-29 05:22:22 -07:00
|
|
|
snprintf(buf, sizeof(buf), "Item mode %i", (int)(long)data);
|
2010-09-27 11:18:37 -07:00
|
|
|
return strdup(buf);
|
|
|
|
}
|
|
|
|
|
2010-09-17 11:26:04 -07:00
|
|
|
void
|
2010-10-19 11:25:22 -07:00
|
|
|
test_cursor(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2010-09-17 11:26:04 -07:00
|
|
|
{
|
|
|
|
Evas_Object *win, *bg, *bx, *bt, *list, *entry, *ck;
|
2010-09-28 05:44:08 -07:00
|
|
|
Elm_List_Item *lit;
|
2010-09-17 11:26:04 -07:00
|
|
|
|
|
|
|
win = elm_win_add(NULL, "cursor", ELM_WIN_BASIC);
|
|
|
|
elm_win_title_set(win, "Cursor");
|
|
|
|
elm_win_autodel_set(win, 1);
|
|
|
|
|
|
|
|
bg = elm_bg_add(win);
|
|
|
|
elm_win_resize_object_add(win, bg);
|
|
|
|
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_show(bg);
|
|
|
|
elm_object_cursor_set(bg, ELM_CURSOR_CIRCLE);
|
|
|
|
|
|
|
|
bx = elm_box_add(win);
|
|
|
|
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
elm_win_resize_object_add(win, bx);
|
|
|
|
evas_object_show(bx);
|
|
|
|
|
|
|
|
ck = elm_clock_add(win);
|
|
|
|
elm_object_cursor_set(ck, ELM_CURSOR_CLOCK);
|
|
|
|
elm_box_pack_end(bx, ck);
|
|
|
|
evas_object_show(ck);
|
|
|
|
|
|
|
|
bt = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(bt, ELM_CURSOR_COFFEE_MUG);
|
|
|
|
elm_button_label_set(bt, "Coffee Mug");
|
|
|
|
elm_box_pack_end(bx, bt);
|
|
|
|
evas_object_show(bt);
|
|
|
|
|
|
|
|
bt = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(bt, ELM_CURSOR_CLOCK);
|
|
|
|
elm_button_label_set(bt, "Cursor unset");
|
|
|
|
elm_object_cursor_unset(bt);
|
|
|
|
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);
|
|
|
|
evas_object_size_hint_fill_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
elm_object_cursor_set(list, ELM_CURSOR_WATCH);
|
2010-09-28 05:44:08 -07:00
|
|
|
lit = elm_list_item_append(list, "watch over list | hand1", NULL, NULL, NULL,
|
|
|
|
NULL);
|
|
|
|
elm_list_item_cursor_set(lit, ELM_CURSOR_HAND1);
|
|
|
|
lit = elm_list_item_append(list, "watch over list | hand2", NULL, NULL, NULL,
|
|
|
|
NULL);
|
|
|
|
elm_list_item_cursor_set(lit, ELM_CURSOR_HAND2);
|
2010-09-17 11:26:04 -07:00
|
|
|
elm_list_go(list);
|
|
|
|
evas_object_show(list);
|
|
|
|
|
|
|
|
entry = elm_scrolled_entry_add(win);
|
|
|
|
elm_scrolled_entry_entry_set(entry, "Xterm cursor");
|
|
|
|
elm_scrolled_entry_single_line_set(entry, EINA_TRUE);
|
|
|
|
evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0);
|
|
|
|
evas_object_size_hint_fill_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
elm_box_pack_end(bx, entry);
|
|
|
|
evas_object_show(entry);
|
|
|
|
elm_object_cursor_set(entry, ELM_CURSOR_XTERM);
|
|
|
|
|
|
|
|
evas_object_resize(win, 320, 480);
|
|
|
|
evas_object_show(win);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2010-10-19 11:25:22 -07:00
|
|
|
test_cursor2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2010-09-17 11:26:04 -07:00
|
|
|
{
|
2010-09-27 11:18:37 -07:00
|
|
|
Evas_Object *win, *bg, *bx, *o, *grid, *gl;
|
|
|
|
Elm_Genlist_Item *it1, *it2, *it3;
|
2010-09-17 11:26:04 -07:00
|
|
|
Elm_Toolbar_Item *tit;
|
|
|
|
Elm_List_Item *lit;
|
2010-09-27 11:18:37 -07:00
|
|
|
char buf[PATH_MAX];
|
|
|
|
static Testitem ti[144];
|
|
|
|
int i, n;
|
|
|
|
const char *img[9] =
|
|
|
|
{
|
|
|
|
"panel_01.jpg",
|
|
|
|
"plant_01.jpg",
|
|
|
|
"rock_01.jpg",
|
|
|
|
"rock_02.jpg",
|
|
|
|
"sky_01.jpg",
|
|
|
|
"sky_02.jpg",
|
|
|
|
"sky_03.jpg",
|
|
|
|
"sky_04.jpg",
|
|
|
|
"wood_01.jpg",
|
|
|
|
};
|
2010-09-17 11:26:04 -07:00
|
|
|
|
|
|
|
win = elm_win_add(NULL, "cursor", ELM_WIN_BASIC);
|
2010-09-25 15:01:19 -07:00
|
|
|
elm_win_title_set(win, "Cursor 2");
|
2010-09-17 11:26:04 -07:00
|
|
|
elm_win_autodel_set(win, 1);
|
|
|
|
|
|
|
|
bg = elm_bg_add(win);
|
|
|
|
elm_win_resize_object_add(win, bg);
|
|
|
|
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_show(bg);
|
|
|
|
|
|
|
|
bx = elm_box_add(win);
|
|
|
|
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
elm_win_resize_object_add(win, bx);
|
|
|
|
evas_object_show(bx);
|
|
|
|
|
|
|
|
o = elm_toolbar_add(win);
|
|
|
|
elm_toolbar_homogenous_set(o, 0);
|
|
|
|
evas_object_size_hint_weight_set(o, 0.0, 0.0);
|
|
|
|
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.0);
|
Change toolbar API for consistency with other widgets
BIG FAT WARNING: lots of changes on toolbar API
Trying to get a lib with easy to use API, I'm changing toolbar API
to be consistent with genlist / gengrid widgets and to be more concise.
Functions select_next, select_first, select_last, unselect, unselect_all
get all are gone.
You can do this calling a combination of the others functions.
This commit changes toolbar to use inlist, and previous items can be
get.
So now we have:
Elm_Toolbar_Item *elm_toolbar_first_item_get(const Evas_Object *obj)
Elm_Toolbar_Item *elm_toolbar_last_item_get(const Evas_Object *obj)
Elm_Toolbar_Item *elm_toolbar_item_next_get(const Elm_Toolbar_Item *it)
Elm_Toolbar_Item *elm_toolbar_item_prev_get(const Elm_Toolbar_Item *it)
Eina_Bool elm_toolbar_item_selected_get(const Elm_Toolbar_Item)
void elm_toolbar_item_selected_set(Elm_Toolbar_Item *item, Eina_Bool selected)
Elm_Toolbar_Item *elm_toolbar_selected_item_get(const Evas_Object *obj)
With these functions you can iterate over the items list getting /
selecting the item you need.
Another big change is that elm_toolbar_item_add is gone. Now you can
insert items in the position you want, with the functions append,
prepend, insert after, insert before (a relative item).
If you don't like any changes or have a case of use for something
that should be different, please ping me.
At last, includes ELM_TOOLBAR_ITEM_CHECK_OR_RETURN on EAPI that
receives items.
SVN revision: 53894
2010-10-26 03:29:24 -07:00
|
|
|
tit = elm_toolbar_item_append(o, NULL, "Bogosity", NULL, NULL);
|
2010-09-17 11:26:04 -07:00
|
|
|
elm_toolbar_item_cursor_set(tit, ELM_CURSOR_BOGOSITY);
|
Change toolbar API for consistency with other widgets
BIG FAT WARNING: lots of changes on toolbar API
Trying to get a lib with easy to use API, I'm changing toolbar API
to be consistent with genlist / gengrid widgets and to be more concise.
Functions select_next, select_first, select_last, unselect, unselect_all
get all are gone.
You can do this calling a combination of the others functions.
This commit changes toolbar to use inlist, and previous items can be
get.
So now we have:
Elm_Toolbar_Item *elm_toolbar_first_item_get(const Evas_Object *obj)
Elm_Toolbar_Item *elm_toolbar_last_item_get(const Evas_Object *obj)
Elm_Toolbar_Item *elm_toolbar_item_next_get(const Elm_Toolbar_Item *it)
Elm_Toolbar_Item *elm_toolbar_item_prev_get(const Elm_Toolbar_Item *it)
Eina_Bool elm_toolbar_item_selected_get(const Elm_Toolbar_Item)
void elm_toolbar_item_selected_set(Elm_Toolbar_Item *item, Eina_Bool selected)
Elm_Toolbar_Item *elm_toolbar_selected_item_get(const Evas_Object *obj)
With these functions you can iterate over the items list getting /
selecting the item you need.
Another big change is that elm_toolbar_item_add is gone. Now you can
insert items in the position you want, with the functions append,
prepend, insert after, insert before (a relative item).
If you don't like any changes or have a case of use for something
that should be different, please ping me.
At last, includes ELM_TOOLBAR_ITEM_CHECK_OR_RETURN on EAPI that
receives items.
SVN revision: 53894
2010-10-26 03:29:24 -07:00
|
|
|
tit = elm_toolbar_item_append(o, NULL, "Unset", NULL, NULL);
|
2010-09-17 11:26:04 -07:00
|
|
|
elm_toolbar_item_cursor_set(tit, ELM_CURSOR_BOGOSITY);
|
|
|
|
elm_toolbar_item_cursor_unset(tit);
|
Change toolbar API for consistency with other widgets
BIG FAT WARNING: lots of changes on toolbar API
Trying to get a lib with easy to use API, I'm changing toolbar API
to be consistent with genlist / gengrid widgets and to be more concise.
Functions select_next, select_first, select_last, unselect, unselect_all
get all are gone.
You can do this calling a combination of the others functions.
This commit changes toolbar to use inlist, and previous items can be
get.
So now we have:
Elm_Toolbar_Item *elm_toolbar_first_item_get(const Evas_Object *obj)
Elm_Toolbar_Item *elm_toolbar_last_item_get(const Evas_Object *obj)
Elm_Toolbar_Item *elm_toolbar_item_next_get(const Elm_Toolbar_Item *it)
Elm_Toolbar_Item *elm_toolbar_item_prev_get(const Elm_Toolbar_Item *it)
Eina_Bool elm_toolbar_item_selected_get(const Elm_Toolbar_Item)
void elm_toolbar_item_selected_set(Elm_Toolbar_Item *item, Eina_Bool selected)
Elm_Toolbar_Item *elm_toolbar_selected_item_get(const Evas_Object *obj)
With these functions you can iterate over the items list getting /
selecting the item you need.
Another big change is that elm_toolbar_item_add is gone. Now you can
insert items in the position you want, with the functions append,
prepend, insert after, insert before (a relative item).
If you don't like any changes or have a case of use for something
that should be different, please ping me.
At last, includes ELM_TOOLBAR_ITEM_CHECK_OR_RETURN on EAPI that
receives items.
SVN revision: 53894
2010-10-26 03:29:24 -07:00
|
|
|
tit = elm_toolbar_item_append(o, NULL, "Xterm", NULL, NULL);
|
2010-09-17 11:26:04 -07:00
|
|
|
elm_toolbar_item_cursor_set(tit, ELM_CURSOR_XTERM);
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_list_add(win);
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
lit = elm_list_item_append(o, "cursor bogosity", NULL, NULL, NULL, NULL);
|
|
|
|
elm_list_item_cursor_set(lit, ELM_CURSOR_BOGOSITY);
|
|
|
|
lit = elm_list_item_append(o, "cursor unset", NULL, NULL, NULL, NULL);
|
|
|
|
elm_list_item_cursor_set(lit, ELM_CURSOR_BOGOSITY);
|
|
|
|
elm_list_item_cursor_unset(lit);
|
|
|
|
lit = elm_list_item_append(o, "cursor xterm", NULL, NULL, NULL, NULL);
|
|
|
|
elm_list_item_cursor_set(lit, ELM_CURSOR_XTERM);
|
|
|
|
elm_list_go(o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
2010-09-27 11:18:37 -07:00
|
|
|
gl = elm_genlist_add(win);
|
|
|
|
evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_show(gl);
|
|
|
|
|
|
|
|
itct.item_style = "default";
|
|
|
|
itct.func.label_get = glt_label_get;
|
|
|
|
|
|
|
|
it1 = elm_genlist_item_append(gl, &itct, (void *) 1, NULL,
|
|
|
|
ELM_GENLIST_ITEM_SUBITEMS, NULL, NULL);
|
|
|
|
it2 = elm_genlist_item_append(gl, &itct, (void *) 2, NULL,
|
|
|
|
ELM_GENLIST_ITEM_SUBITEMS, NULL, NULL);
|
|
|
|
it3 = elm_genlist_item_append(gl, &itct, (void *) 3, NULL,
|
|
|
|
ELM_GENLIST_ITEM_NONE, NULL, NULL);
|
|
|
|
|
|
|
|
elm_genlist_item_cursor_set(it1, ELM_CURSOR_HAND1);
|
|
|
|
elm_genlist_item_cursor_set(it2, ELM_CURSOR_HAND1);
|
|
|
|
elm_genlist_item_cursor_set(it3, ELM_CURSOR_CROSS);
|
|
|
|
|
|
|
|
evas_object_smart_callback_add(gl, "expand,request", glt_exp_req, gl);
|
|
|
|
evas_object_smart_callback_add(gl, "contract,request", glt_con_req, gl);
|
|
|
|
evas_object_smart_callback_add(gl, "expanded", glt_exp, gl);
|
|
|
|
evas_object_smart_callback_add(gl, "clicked", NULL, gl);
|
|
|
|
evas_object_smart_callback_add(gl, "contracted", glt_con, gl);
|
|
|
|
|
|
|
|
elm_box_pack_end(bx, gl);
|
|
|
|
|
|
|
|
grid = elm_gengrid_add(win);
|
|
|
|
elm_gengrid_item_size_set(grid, 130, 130);
|
|
|
|
elm_gengrid_horizontal_set(grid, EINA_FALSE);
|
|
|
|
elm_gengrid_multi_select_set(grid, EINA_TRUE);
|
|
|
|
evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_fill_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
|
|
|
|
gic.item_style = "default";
|
|
|
|
gic.func.label_get = grd_lbl_get;
|
|
|
|
gic.func.icon_get = grd_icon_get;
|
|
|
|
|
|
|
|
n = 0;
|
|
|
|
for (i = 0; i < 3 * 3; i++)
|
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "%s/images/%s", PACKAGE_DATA_DIR, img[n]);
|
|
|
|
n = (n + 1) % 9;
|
|
|
|
ti[i].mode = i;
|
|
|
|
ti[i].path = eina_stringshare_add(buf);
|
|
|
|
ti[i].item = elm_gengrid_item_append(grid, &gic, &(ti[i]), NULL, NULL);
|
|
|
|
if (n % 2)
|
|
|
|
elm_gengrid_item_cursor_set(ti[i].item, ELM_CURSOR_HAND1);
|
|
|
|
else
|
|
|
|
elm_gengrid_item_cursor_set(ti[i].item, ELM_CURSOR_CLOCK);
|
|
|
|
if (!(i % 5))
|
|
|
|
elm_gengrid_item_selected_set(ti[i].item, EINA_TRUE);
|
|
|
|
}
|
|
|
|
elm_box_pack_end(bx, grid);
|
|
|
|
evas_object_show(grid);
|
|
|
|
|
2010-09-17 11:26:04 -07:00
|
|
|
evas_object_resize(win, 320, 480);
|
|
|
|
evas_object_show(win);
|
|
|
|
}
|
|
|
|
|
2010-09-25 15:01:19 -07:00
|
|
|
void
|
2010-10-19 11:25:22 -07:00
|
|
|
test_cursor3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
2010-09-25 15:01:19 -07:00
|
|
|
{
|
|
|
|
Evas_Object *win, *bg, *bx, *o;
|
|
|
|
Elm_List_Item *lit;
|
|
|
|
|
|
|
|
win = elm_win_add(NULL, "cursor", ELM_WIN_BASIC);
|
|
|
|
elm_win_title_set(win, "Cursor 3");
|
|
|
|
elm_win_autodel_set(win, 1);
|
|
|
|
|
|
|
|
bg = elm_bg_add(win);
|
|
|
|
elm_win_resize_object_add(win, bg);
|
|
|
|
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_show(bg);
|
|
|
|
|
|
|
|
bx = elm_box_add(win);
|
|
|
|
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
elm_win_resize_object_add(win, bx);
|
|
|
|
evas_object_show(bx);
|
|
|
|
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(o, ELM_CURSOR_HAND1);
|
|
|
|
elm_object_cursor_engine_only_set(o, EINA_FALSE);
|
|
|
|
elm_button_label_set(o, "hand1");
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(o, ELM_CURSOR_HAND2);
|
2010-09-25 15:03:37 -07:00
|
|
|
elm_button_label_set(o, "hand2 x");
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(o, ELM_CURSOR_HAND2);
|
|
|
|
elm_object_cursor_engine_only_set(o, EINA_FALSE);
|
2010-09-25 15:01:19 -07:00
|
|
|
elm_button_label_set(o, "hand2");
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(o, "hand3");
|
2010-09-25 15:03:37 -07:00
|
|
|
elm_object_cursor_engine_only_set(o, EINA_FALSE);
|
2010-09-25 15:01:19 -07:00
|
|
|
elm_button_label_set(o, "hand3");
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(o, "hand3");
|
2010-09-25 15:03:37 -07:00
|
|
|
elm_object_cursor_engine_only_set(o, EINA_FALSE);
|
2010-09-25 15:01:19 -07:00
|
|
|
elm_object_cursor_style_set(o, "transparent");
|
|
|
|
elm_button_label_set(o, "hand3 transparent");
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(o, "hand3");
|
2010-09-25 15:03:37 -07:00
|
|
|
elm_object_cursor_engine_only_set(o, EINA_FALSE);
|
2010-09-25 15:01:19 -07:00
|
|
|
elm_object_cursor_unset(o);
|
|
|
|
elm_button_label_set(o, "unset");
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(o, "hand4");
|
|
|
|
elm_button_label_set(o, "not existent");
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
2010-09-25 15:04:51 -07:00
|
|
|
elm_cursor_engine_only_set(0);
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(o, "hand2");
|
|
|
|
elm_button_label_set(o, "hand 2 engine only config false");
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
elm_cursor_engine_only_set(1);
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_cursor_set(o, "hand2");
|
|
|
|
elm_button_label_set(o, "hand 2 engine only config true");
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
2010-09-25 15:01:19 -07:00
|
|
|
o = elm_list_add(win);
|
|
|
|
elm_box_pack_end(bx, o);
|
|
|
|
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
2010-09-25 15:03:37 -07:00
|
|
|
lit = elm_list_item_append(o, "cursor hand2 x", NULL, NULL, NULL, NULL);
|
|
|
|
elm_list_item_cursor_set(lit, ELM_CURSOR_HAND2);
|
2010-09-25 15:01:19 -07:00
|
|
|
lit = elm_list_item_append(o, "cursor hand2", NULL, NULL, NULL, NULL);
|
|
|
|
elm_list_item_cursor_set(lit, ELM_CURSOR_HAND2);
|
2010-09-25 15:03:37 -07:00
|
|
|
elm_list_item_cursor_engine_only_set(lit, EINA_FALSE);
|
2010-09-25 15:01:19 -07:00
|
|
|
lit = elm_list_item_append(o, "cursor hand3", NULL, NULL, NULL, NULL);
|
|
|
|
elm_list_item_cursor_set(lit, "hand3");
|
2010-09-25 15:03:37 -07:00
|
|
|
elm_list_item_cursor_engine_only_set(lit, EINA_FALSE);
|
2010-09-25 15:01:19 -07:00
|
|
|
lit = elm_list_item_append(o, "cursor hand3 transparent", NULL, NULL,
|
|
|
|
NULL, NULL);
|
|
|
|
elm_list_item_cursor_set(lit, "hand3");
|
|
|
|
elm_list_item_cursor_style_set(lit, "transparent");
|
2010-09-25 15:03:37 -07:00
|
|
|
elm_list_item_cursor_engine_only_set(lit, EINA_FALSE);
|
2010-09-25 15:01:19 -07:00
|
|
|
elm_list_go(o);
|
|
|
|
evas_object_show(o);
|
|
|
|
|
|
|
|
evas_object_resize(win, 320, 480);
|
|
|
|
evas_object_show(win);
|
|
|
|
}
|
|
|
|
|
2010-09-17 11:26:04 -07:00
|
|
|
#endif
|