forked from enlightenment/efl
event catcher should be the lowest object!
this damn bitch made me waste hours hunting a supposedly bug in Evas event dispatch system just to realize the bug was in the theme... and list in the LIST + COMPRESSED! :-( Everything else was correct. The idea of "end" is that we may want to have some action item as well, such as a button (see modification in test_list.c). In this case we want the button to receive the event before the list item (or even block the event going to the list item). Use case: add a "delete" button to the item, click delete and you want to avoid it being selected (think of a bookmark where you want to delete a folder, but select the item would enter that folder that you want to delete). SVN revision: 53121
This commit is contained in:
parent
d959e612eb
commit
4091d2cbd3
|
@ -10999,6 +10999,15 @@ collections {
|
|||
image: "ilist_item_shadow.png" COMP;
|
||||
}
|
||||
parts {
|
||||
part {
|
||||
name: "event";
|
||||
type: RECT;
|
||||
repeat_events: 1;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
}
|
||||
part {
|
||||
name: "base_sh";
|
||||
mouse_events: 0;
|
||||
|
@ -11168,15 +11177,6 @@ collections {
|
|||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
part {
|
||||
name: "event";
|
||||
type: RECT;
|
||||
repeat_events: 1;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program {
|
||||
|
@ -11212,6 +11212,15 @@ collections {
|
|||
image: "ilist_2.png" COMP;
|
||||
}
|
||||
parts {
|
||||
part {
|
||||
name: "event";
|
||||
type: RECT;
|
||||
repeat_events: 1;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
}
|
||||
part {
|
||||
name: "base";
|
||||
mouse_events: 0;
|
||||
|
@ -11359,15 +11368,6 @@ collections {
|
|||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
part {
|
||||
name: "event";
|
||||
type: RECT;
|
||||
repeat_events: 1;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program {
|
||||
|
|
|
@ -274,6 +274,18 @@ test_list2(void *data, Evas_Object *obj, void *event_info)
|
|||
|
||||
/***********/
|
||||
|
||||
static void
|
||||
_bt_clicked(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
printf("button was clicked\n");
|
||||
}
|
||||
|
||||
static void
|
||||
_it_clicked(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
printf("item was clicked\n");
|
||||
}
|
||||
|
||||
void
|
||||
test_list3(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
|
@ -296,8 +308,14 @@ test_list3(void *data, Evas_Object *obj, void *event_info)
|
|||
|
||||
ic = elm_icon_add(win);
|
||||
snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
|
||||
elm_icon_scale_set(ic, 0, 0);
|
||||
elm_icon_file_set(ic, buf, NULL);
|
||||
elm_list_item_append(li, "Hello", ic, NULL, NULL, NULL);
|
||||
ic2 = elm_button_add(win);
|
||||
elm_button_label_set(ic2, "Click me");
|
||||
evas_object_smart_callback_add(ic2, "clicked", _bt_clicked, NULL);
|
||||
evas_object_propagate_events_set(ic2, 0);
|
||||
elm_list_item_append(li, "Hello", ic, ic2, _it_clicked, NULL);
|
||||
|
||||
ic = elm_icon_add(win);
|
||||
snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
|
||||
elm_icon_scale_set(ic, 0, 0);
|
||||
|
|
Loading…
Reference in New Issue