Autocomplete: show list of the candidates by Ctrl+space.

Summary:
By press ctrl_l+space will be shown popup with the candidates list,
that relevant to current cursor position.
Added API enventor_object_auto_complete_list_show as public.

Reviewers: Hermet, jpeg

Maniphest Tasks: T2496

Differential Revision: https://phab.enlightenment.org/D2720
This commit is contained in:
Mykyta Biliavskyi 2015-06-22 14:34:52 +09:00 committed by ChunEon Park
parent d1e7eed0fb
commit 5b3aa7ca3b
5 changed files with 32 additions and 0 deletions

View File

@ -660,6 +660,12 @@ ctrl_func(app_data *ad, Ecore_Event_Key *event)
auto_comp_toggle(ad);
return EINA_TRUE;
}
if (!strcmp(event->key, "space"))
{
enventor_object_auto_complete_list_show(ad->enventor);
return EINA_TRUE;
}
//Live Edit
if (!strcmp(event->key, "e") || !strcmp(event->key, "E"))
{

View File

@ -645,6 +645,17 @@ list_item_move(autocomp_data *ad, Eina_Bool up)
/* Externally accessible calls */
/*****************************************************************************/
void
autocomp_list_show(void)
{
Evas_Object *entry;
autocomp_data *ad = g_ad;
if (!g_ad || !g_ad->enabled) return;
entry = edit_entry_get(ad->ed);
context_lexem_get(ad, entry, EINA_TRUE);
}
void
autocomp_target_set(edit_data *ed)
{

View File

@ -501,6 +501,13 @@ class Enventor.Object (Elm.Widget, Efl.File) {
@in font_style: const(char) **; /*@ ... */
}
}
auto_complete_list_show {
/*@
@brief
@warning
@see
@ingroup Enventor */
}
}
implements {
class.constructor;

View File

@ -81,6 +81,7 @@ void autocomp_target_set(edit_data *ed);
void autocomp_enabled_set(Eina_Bool enabled);
Eina_Bool autocomp_enabled_get(void);
Eina_Bool autocomp_event_dispatch(const char *key);
void autocomp_list_show(void);
/* syntax color */

View File

@ -298,6 +298,13 @@ _enventor_object_auto_complete_get(Eo *obj EINA_UNUSED,
return autocomp_enabled_get();
}
EOLIAN static void
_enventor_object_auto_complete_list_show(Eo *obj EINA_UNUSED,
Enventor_Object_Data *pd EINA_UNUSED)
{
autocomp_list_show();
}
EOLIAN static void
_enventor_object_modified_set(Eo *obj EINA_UNUSED, Enventor_Object_Data *pd,
Eina_Bool modified)