forked from enlightenment/efl
Merge branch 'master' of ssh://git.enlightenment.org/core/elementary
This commit is contained in:
commit
0461e3d391
|
@ -266,6 +266,13 @@ scrolled_anchor_test(void *data, Evas_Object *obj __UNUSED__, void *event_info _
|
|||
elm_entry_entry_insert(en, "ANCHOR CLICKED");
|
||||
}
|
||||
|
||||
static void
|
||||
_item_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
||||
{
|
||||
Elm_Entry_Context_Menu_Item *item = (Elm_Entry_Context_Menu_Item *)event_info;
|
||||
printf("\ncurrent selected text = %s\n", elm_entry_context_menu_item_label_get(item));
|
||||
}
|
||||
|
||||
void
|
||||
test_entry_scrolled(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
|
@ -338,6 +345,8 @@ test_entry_scrolled(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *ev
|
|||
elm_scroller_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
|
||||
elm_entry_single_line_set(en, EINA_TRUE);
|
||||
elm_entry_select_all(en);
|
||||
elm_entry_context_menu_item_add(en, "Menu1", NULL, ELM_ICON_NONE, _item_cb, NULL);
|
||||
elm_entry_context_menu_item_add(en, "Menu2", NULL, ELM_ICON_NONE, _item_cb, NULL);
|
||||
evas_object_show(en);
|
||||
elm_box_pack_end(bx, en);
|
||||
|
||||
|
|
|
@ -1206,9 +1206,9 @@ _hover_item_clicked_cb(void *data,
|
|||
void *event_info __UNUSED__)
|
||||
{
|
||||
Elm_Entry_Context_Menu_Item *it = data;
|
||||
Evas_Object *obj2 = it->obj;
|
||||
if (!it) return;
|
||||
|
||||
if (it->func) it->func(it->data, obj2, NULL);
|
||||
if (it->func) it->func(it->data, it->obj, it);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -3976,6 +3976,25 @@ _context_menu_disabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
|
|||
*ret = !sd->context_menu;
|
||||
}
|
||||
|
||||
EAPI const char *
|
||||
elm_entry_context_menu_item_label_get(const Elm_Entry_Context_Menu_Item *item)
|
||||
{
|
||||
if(!item) return NULL;
|
||||
return item->label;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_entry_context_menu_item_icon_get(const Elm_Entry_Context_Menu_Item *item,
|
||||
const char **icon_file,
|
||||
const char **icon_group,
|
||||
Elm_Icon_Type *icon_type)
|
||||
{
|
||||
if(!item) return;
|
||||
if (icon_file) *icon_file = item->icon_file;
|
||||
if (icon_group) *icon_group = item->icon_group;
|
||||
if (icon_type) *icon_type = item->icon_type;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_entry_item_provider_append(Evas_Object *obj,
|
||||
Elm_Entry_Item_Provider_Cb func,
|
||||
|
|
|
@ -400,6 +400,14 @@ struct _Elm_Entry_Anchor_Info
|
|||
*/
|
||||
typedef struct _Elm_Entry_Anchor_Hover_Info Elm_Entry_Anchor_Hover_Info;
|
||||
|
||||
/**
|
||||
* @typedef Elm_Entry_Context_Menu_Item
|
||||
*
|
||||
* Type of contextual item that can be added in to long press menu.
|
||||
* @since 1.8
|
||||
*/
|
||||
typedef struct _Elm_Entry_Context_Menu_Item Elm_Entry_Context_Menu_Item;
|
||||
|
||||
/**
|
||||
* @struct _Elm_Entry_Anchor_Hover_Info
|
||||
*
|
||||
|
@ -1795,6 +1803,38 @@ EAPI const char *elm_entry_anchor_hover_style_get(const Evas_Obj
|
|||
*/
|
||||
EAPI void elm_entry_anchor_hover_end(Evas_Object *obj);
|
||||
|
||||
/**
|
||||
* Get the text of the contextual menu item.
|
||||
*
|
||||
* Gets the text of the contextual menu item of entry.
|
||||
*
|
||||
* @param item The item to get the label
|
||||
* @return The text of contextual menu item
|
||||
*
|
||||
* @see elm_entry_context_menu_item_add()
|
||||
* @ingroup Entry
|
||||
* @since 1.8
|
||||
*/
|
||||
EAPI const char *elm_entry_context_menu_item_label_get(const Elm_Entry_Context_Menu_Item *item);
|
||||
|
||||
/**
|
||||
* Get the icon object of the contextual menu item.
|
||||
*
|
||||
* Gets the icon object packed in the contextual menu item of entry.
|
||||
*
|
||||
* @param item The item to get the icon from
|
||||
* @param icon_file The image file path on disk used for the icon or standard
|
||||
* icon name
|
||||
* @param icon_group The edje group used if @p icon_file is an edje file. NULL
|
||||
* if the icon is not an edje file
|
||||
* @param icon_type The icon type
|
||||
*
|
||||
* @see elm_entry_context_menu_item_add()
|
||||
* @ingroup Entry
|
||||
* @since 1.8
|
||||
*/
|
||||
EAPI void elm_entry_context_menu_item_icon_get(const Elm_Entry_Context_Menu_Item *item, const char **icon_file, const char **icon_group, Elm_Icon_Type *icon_type);
|
||||
|
||||
#define ELM_OBJ_ENTRY_CLASS elm_obj_entry_class_get()
|
||||
|
||||
const Eo_Class *elm_obj_entry_class_get(void) EINA_CONST;
|
||||
|
|
|
@ -91,7 +91,6 @@ struct _Elm_Entry_Smart_Data
|
|||
Eina_Bool scroll : 1;
|
||||
};
|
||||
|
||||
typedef struct _Elm_Entry_Context_Menu_Item Elm_Entry_Context_Menu_Item;
|
||||
typedef struct _Elm_Entry_Item_Provider Elm_Entry_Item_Provider;
|
||||
typedef struct _Elm_Entry_Markup_Filter Elm_Entry_Markup_Filter;
|
||||
|
||||
|
|
Loading…
Reference in New Issue