printf("'dismissed' callback is called.\n");
}
+static void
+_hoversel_expanded_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ Elm_Object_Item *it = data;
+
+ printf("'expanded' callback is called.\n");
+ printf("old style: %s\n", elm_object_item_style_get(it));
+ //item type is button. set the style of button
+ elm_object_item_style_set(it, "anchor");
+ printf("new style: %s\n", elm_object_item_style_get(it));
+}
+
void
test_hoversel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Evas_Object *win, *bx, *bt, *ic, *bxx, *hoversel;
+ Elm_Object_Item *it;
char buf[PATH_MAX];
api_data *api = calloc(1, sizeof(api_data));
elm_box_pack_end(bx, hoversel);
evas_object_show(hoversel);
+ hoversel = elm_hoversel_add(win);
+ elm_hoversel_hover_parent_set(hoversel, win);
+ elm_object_text_set(hoversel, "Custom Item Style");
+ elm_hoversel_item_add(hoversel, "Item 1", NULL, ELM_ICON_NONE, NULL, NULL);
+ elm_hoversel_item_add(hoversel, "Item 2", NULL, ELM_ICON_NONE, NULL, NULL);
+ elm_hoversel_item_add(hoversel, "Item 3", NULL, ELM_ICON_NONE, NULL, NULL);
+ elm_hoversel_item_add(hoversel, "Item 4", NULL, ELM_ICON_NONE, NULL, NULL);
+ it = elm_hoversel_item_add(hoversel, "Manage items", NULL, ELM_ICON_NONE, NULL, NULL);
+ 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);
+ //pass the last item as data and use elm_object_item_style_set() to change the item style.
+ evas_object_smart_callback_add(hoversel, "expanded",
+ _hoversel_expanded_cb, it);
+ elm_box_pack_end(bx, hoversel);
+ evas_object_show(hoversel);
+
evas_object_resize(win, 320, 500);
evas_object_show(win);
static const char SIG_SELECTED[] = "selected";
static const char SIG_DISMISSED[] = "dismissed";
+static const char SIG_EXPANDED[] = "expanded";
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_SELECTED, ""},
{SIG_DISMISSED, ""},
+ {SIG_EXPANDED, ""},
{"clicked", ""}, /**< handled by parent button class */
{NULL, NULL}
};
elm_object_part_content_set(sd->hover, elm_hover_best_content_location_get
(sd->hover, ELM_HOVER_AXIS_VERTICAL), bx);
+ evas_object_smart_callback_call(obj, SIG_EXPANDED, NULL);
evas_object_show(sd->hover);
}