seoz pushed a commit to branch master.
commit 3e97deb2017eb0709dbe2b3fa6ada54d4af80a64
Author: Daniel Juyung Seo <[email protected]>
Date: Fri Aug 30 18:30:19 2013 +0900
hoversel: flurish hoversel source/example/documentation a little bit more.
1. fixed documentation to be more descriptive.
2. added hoversel smart callback examples.
3. added internal callback description.
---
src/bin/test_hoversel.c | 27 +++++++++++++++++++++++++++
src/lib/elc_hoversel.c | 1 +
src/lib/elc_hoversel.h | 2 +-
3 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/src/bin/test_hoversel.c b/src/bin/test_hoversel.c
index a1939cd..6889d38 100644
--- a/src/bin/test_hoversel.c
+++ b/src/bin/test_hoversel.c
@@ -93,6 +93,27 @@ _cleanup_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj
__UNUSED__, void *e
free(data);
}
+static void
+_hoversel_clicked_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ printf("Hover button is clicked and 'clicked' callback is called.\n");
+}
+
+static void
+_hoversel_selected_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__,
+ void *event_info)
+{
+ printf("'selected' callback is called. (selected item : %p)\n", event_info);
+}
+
+static void
+_hoversel_dismissed_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ printf("'dismissed' callback is called.\n");
+}
+
void
test_hoversel(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void
*event_info __UNUSED__)
{
@@ -135,6 +156,12 @@ test_hoversel(void *data __UNUSED__, Evas_Object *obj
__UNUSED__, void *event_in
elm_hoversel_item_add(hoversel, "Item 4 - Long Label Here", "close",
ELM_ICON_STANDARD, NULL, NULL);
evas_object_size_hint_weight_set(hoversel, 0.0, 0.0);
evas_object_size_hint_align_set(hoversel, 0.5, 0.5);
+ evas_object_smart_callback_add(hoversel, "clicked",
+ _hoversel_clicked_cb, NULL);
+ evas_object_smart_callback_add(hoversel, "selected",
+ _hoversel_selected_cb, NULL);
+ evas_object_smart_callback_add(hoversel, "dismissed",
+ _hoversel_dismissed_cb, NULL);
elm_box_pack_end(bx, hoversel);
evas_object_show(hoversel);
diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c
index cdc01e2..cc640a1 100644
--- a/src/lib/elc_hoversel.c
+++ b/src/lib/elc_hoversel.c
@@ -17,6 +17,7 @@ static const char SIG_DISMISSED[] = "dismissed";
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_SELECTED, ""},
{SIG_DISMISSED, ""},
+ {"clicked", ""}, /**< handled by parent button class */
{NULL, NULL}
};
diff --git a/src/lib/elc_hoversel.h b/src/lib/elc_hoversel.h
index 5c52f80..f676b97 100644
--- a/src/lib/elc_hoversel.h
+++ b/src/lib/elc_hoversel.h
@@ -23,7 +23,7 @@
* - @c "clicked" - the user clicked the hoversel button and popped up
* the sel
* - @c "selected" - an item in the hoversel list is selected. event_info
- * is the item
+ * is the selected item
* - @c "dismissed" - the hover is dismissed
*
* Default content parts of the hoversel widget that you can use for are:
--
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk