Adding focus and unfocused smart callbacks for entry

SVN revision: 47481
This commit is contained in:
Iván Briano 2010-03-26 06:46:31 +00:00
parent efccbe07e8
commit c70784c37c
3 changed files with 19 additions and 1 deletions

View File

@ -614,7 +614,7 @@ extern "C" {
* "selection,start" - the user started selecting text
* "selection,changed" - the user modified the selection size/location
* "selection,cleared" - the user cleared the selection
* "selection,paste" - the user rrequested a paste of text
* "selection,paste" - the user requested a paste of text
* "selection,copy" - the user copied the text
* "selection,cut" - the user cut the text
* "cursor,changed" - the cursor changed position
@ -624,6 +624,8 @@ extern "C" {
* "clicked" - when finger/mouse is pressed and released (without a drag etc.)
* "clicked,double" - when finger/mouse is double-pressed
* "longpressed" - the entry has been longpressed
* "focused" - the entry has received keyboard focus
* "unfocused" - keyboard focus is gone
*/
/* composite widgets - these basically put together basic widgets above

View File

@ -145,6 +145,18 @@ _entry_longpressed(void *data, Evas_Object *obj __UNUSED__, void *event_info __U
evas_object_smart_callback_call(data, "longpressed", NULL);
}
static void
_entry_focused(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
evas_object_smart_callback_call(data, "focused", NULL);
}
static void
_entry_unfocused(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
evas_object_smart_callback_call(data, "unfocused", NULL);
}
EAPI Evas_Object *
elm_scrolled_entry_add(Evas_Object *parent)
{
@ -189,6 +201,8 @@ elm_scrolled_entry_add(Evas_Object *parent)
evas_object_smart_callback_add(wd->entry, "selection,copy", _entry_selection_copy, obj);
evas_object_smart_callback_add(wd->entry, "selection,cut", _entry_selection_cut, obj);
evas_object_smart_callback_add(wd->entry, "longpressed", _entry_longpressed, obj);
evas_object_smart_callback_add(wd->entry, "focused", _entry_focused, obj);
evas_object_smart_callback_add(wd->entry, "unfocused", _entry_unfocused, obj);
_sizing_eval(obj);

View File

@ -211,12 +211,14 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
evas_object_focus_set(wd->ent, 1);
edje_object_signal_emit(wd->ent, "elm,action,focus", "elm");
if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
evas_object_smart_callback_call(obj, "focused", NULL);
}
else
{
edje_object_signal_emit(wd->ent, "elm,action,unfocus", "elm");
evas_object_focus_set(wd->ent, 0);
if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF);
evas_object_smart_callback_call(obj, "unfocused", NULL);
}
}