summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2016-01-19 20:33:47 +0100
committerDave Andreoli <dave@gurumeditation.it>2016-01-19 20:33:47 +0100
commit31027d719fc21122c042aab90dad7ae6d817b40c (patch)
tree2a242bc74d92fee19becfbc92697b01ed2331ee1 /src
parent1029f53f99d748c3d515a3b74a74c529b289c80e (diff)
Combobox: rename the "selected" event to "item,selected" as it should be.
Also updated the test to reflect this change
Diffstat (limited to 'src')
-rw-r--r--src/bin/test_combobox.c16
-rw-r--r--src/lib/elc_combobox.c6
-rw-r--r--src/lib/elm_combobox.eo2
3 files changed, 13 insertions, 11 deletions
diff --git a/src/bin/test_combobox.c b/src/bin/test_combobox.c
index b5f11729c..43bd4efa6 100644
--- a/src/bin/test_combobox.c
+++ b/src/bin/test_combobox.c
@@ -12,11 +12,11 @@ _combobox_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
12} 12}
13 13
14static void 14static void
15_combobox_selected_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, 15_combobox_item_selected_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
16 void *event_info) 16 void *event_info)
17{ 17{
18 const char *txt = elm_object_item_text_get(event_info); 18 const char *txt = elm_object_item_text_get(event_info);
19 printf("'selected' callback is called. (selected item : %s)\n", txt); 19 printf("'item,selected' callback is called. (selected item : %s)\n", txt);
20} 20}
21 21
22static void 22static void
@@ -125,12 +125,12 @@ test_combobox(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
125 (void*)(uintptr_t)(i * 10)); 125 (void*)(uintptr_t)(i * 10));
126 evas_object_smart_callback_add(combobox, "clicked", 126 evas_object_smart_callback_add(combobox, "clicked",
127 _combobox_clicked_cb, NULL); 127 _combobox_clicked_cb, NULL);
128 evas_object_smart_callback_add(combobox, "selected",
129 _combobox_selected_cb, NULL);
130 evas_object_smart_callback_add(combobox, "dismissed", 128 evas_object_smart_callback_add(combobox, "dismissed",
131 _combobox_dismissed_cb, NULL); 129 _combobox_dismissed_cb, NULL);
132 evas_object_smart_callback_add(combobox, "expanded", 130 evas_object_smart_callback_add(combobox, "expanded",
133 _combobox_expanded_cb, NULL); 131 _combobox_expanded_cb, NULL);
132 evas_object_smart_callback_add(combobox, "item,selected",
133 _combobox_item_selected_cb, NULL);
134 evas_object_smart_callback_add(combobox, "item,pressed", 134 evas_object_smart_callback_add(combobox, "item,pressed",
135 _combobox_item_pressed_cb, NULL); 135 _combobox_item_pressed_cb, NULL);
136 evas_object_smart_callback_add(combobox, "filter,done", 136 evas_object_smart_callback_add(combobox, "filter,done",
@@ -148,8 +148,10 @@ test_combobox(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
148 (void*)(uintptr_t)(i * 10)); 148 (void*)(uintptr_t)(i * 10));
149 evas_object_smart_callback_add(combobox, "clicked", 149 evas_object_smart_callback_add(combobox, "clicked",
150 _combobox_clicked_cb, NULL); 150 _combobox_clicked_cb, NULL);
151 evas_object_smart_callback_add(combobox, "selected", 151 evas_object_smart_callback_add(combobox, "item,selected",
152 _combobox_selected_cb, NULL); 152 _combobox_item_selected_cb, NULL);
153 evas_object_smart_callback_add(combobox, "item,pressed",
154 _combobox_item_pressed_cb, NULL);
153 evas_object_smart_callback_add(combobox, "dismissed", 155 evas_object_smart_callback_add(combobox, "dismissed",
154 _combobox_dismissed_cb, NULL); 156 _combobox_dismissed_cb, NULL);
155 evas_object_smart_callback_add(combobox, "expanded", 157 evas_object_smart_callback_add(combobox, "expanded",
diff --git a/src/lib/elc_combobox.c b/src/lib/elc_combobox.c
index 9e11a2f96..4076c416c 100644
--- a/src/lib/elc_combobox.c
+++ b/src/lib/elc_combobox.c
@@ -15,16 +15,16 @@
15#define MY_CLASS_NAME "Elm_Combobox" 15#define MY_CLASS_NAME "Elm_Combobox"
16#define MY_CLASS_NAME_LEGACY "elm_combobox" 16#define MY_CLASS_NAME_LEGACY "elm_combobox"
17 17
18static const char SIG_SELECTED[] = "selected";
19static const char SIG_DISMISSED[] = "dismissed"; 18static const char SIG_DISMISSED[] = "dismissed";
20static const char SIG_EXPANDED[] = "expanded"; 19static const char SIG_EXPANDED[] = "expanded";
20static const char SIG_ITEM_SELECTED[] = "item,selected";
21static const char SIG_ITEM_PRESSED[] = "item,pressed"; 21static const char SIG_ITEM_PRESSED[] = "item,pressed";
22static const char SIG_FILTER_DONE[] = "filter,done"; 22static const char SIG_FILTER_DONE[] = "filter,done";
23 23
24static const Evas_Smart_Cb_Description _smart_callbacks[] = { 24static const Evas_Smart_Cb_Description _smart_callbacks[] = {
25 {SIG_SELECTED, ""},
26 {SIG_DISMISSED, ""}, 25 {SIG_DISMISSED, ""},
27 {SIG_EXPANDED, ""}, 26 {SIG_EXPANDED, ""},
27 {SIG_ITEM_SELECTED, ""},
28 {SIG_ITEM_PRESSED, ""}, 28 {SIG_ITEM_PRESSED, ""},
29 {SIG_FILTER_DONE, ""}, 29 {SIG_FILTER_DONE, ""},
30 {"clicked", ""}, /**< handled by parent button class */ 30 {"clicked", ""}, /**< handled by parent button class */
@@ -165,7 +165,7 @@ _on_item_selected(void *data , Evas_Object *obj EINA_UNUSED, void *event)
165{ 165{
166 ELM_COMBOBOX_DATA_GET(data, sd); 166 ELM_COMBOBOX_DATA_GET(data, sd);
167 elm_object_focus_set(sd->entry, EINA_TRUE); 167 elm_object_focus_set(sd->entry, EINA_TRUE);
168 eo_do(data, eo_event_callback_call(ELM_COMBOBOX_EVENT_SELECTED, event)); 168 eo_do(data, eo_event_callback_call(ELM_COMBOBOX_EVENT_ITEM_SELECTED, event));
169} 169}
170 170
171static void 171static void
diff --git a/src/lib/elm_combobox.eo b/src/lib/elm_combobox.eo
index 80e55329c..f189fca13 100644
--- a/src/lib/elm_combobox.eo
+++ b/src/lib/elm_combobox.eo
@@ -48,10 +48,10 @@ class Elm_Combobox (Elm.Button, Evas.Selectable_Interface,
48 Elm_Interface_Atspi_Widget_Action.elm_actions.get; 48 Elm_Interface_Atspi_Widget_Action.elm_actions.get;
49 } 49 }
50 events { 50 events {
51 selected;
52 dismissed; 51 dismissed;
53 expanded; 52 expanded;
54 clicked; 53 clicked;
54 item,selected;
55 item,pressed; 55 item,pressed;
56 filter,done; 56 filter,done;
57 } 57 }