From: GoUn Lee <gouni.lee@samsung.com>
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 5 Mar 2012 09:58:38 +0000 (09:58 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 5 Mar 2012 09:58:38 +0000 (09:58 +0000)
Subject: [E-devel] [Patch]New feature in Multibuttonentry widget
(input panel handles manually)

I've added patch for a new feature in Multibuttonentry widget.
When Multibuttonenetry gets/lost a focus, it shows input panel(virtual
keyboard) using elm_entry_input_panel_show/hide() function.
A multibuttonenetry manually handles input panel.
The reason why it handles manually input panel even though it has entry,
the multibuttonentry must show input panel when entry lost focus and
multibuttonentry widget is focused.
Such as item(button) is clicked.

So I've added this feature.
Please review this patch.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@68688 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elc_multibuttonentry.c

index d932b98..4e8545f 100644 (file)
@@ -174,19 +174,30 @@ _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
    Widget_Data *wd = elm_widget_data_get(obj);
 
    if (!wd) return;
+
    if (elm_widget_focus_get(obj))
      {
+        if ((wd->current))
+          {
+             elm_entry_input_panel_show(wd->entry);
+          }
+        else if (((!wd->current) || (!eina_list_count(wd->items))))
+          {
+             if (wd->entry) elm_entry_cursor_end_set(wd->entry);
+             _view_update(obj);
+             elm_entry_input_panel_show(wd->entry);
+          }
         wd->focused = EINA_TRUE;
-        if (wd->entry) elm_entry_cursor_end_set(wd->entry);
         evas_object_smart_callback_call(obj, "focused", NULL);
      }
    else
      {
         wd->focused = EINA_FALSE;
+        _view_update(obj);
+
+        elm_entry_input_panel_hide(wd->entry);
         evas_object_smart_callback_call(obj, "unfocused", NULL);
      }
-
-   _view_update(obj);
 }
 
 static Eina_Bool
@@ -231,6 +242,8 @@ _signal_mouse_clicked(void *data, Evas_Object *obj __UNUSED__, const char *emiss
    wd->focused = EINA_TRUE;
    _view_update(data);
 
+   elm_entry_input_panel_show(wd->entry);
+
    evas_object_smart_callback_call(data, "clicked", NULL);
 }
 
@@ -1110,6 +1123,7 @@ _view_init(Evas_Object *obj)
         if (!wd->entry) return;
         elm_entry_single_line_set(wd->entry, EINA_TRUE);
         elm_object_text_set(wd->entry, "");
+        elm_entry_input_panel_enabled_set(wd->entry, EINA_FALSE);
         evas_object_size_hint_min_set(wd->entry, MIN_W_ENTRY, 0);
         evas_object_size_hint_weight_set(wd->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
         evas_object_size_hint_align_set(wd->entry, EVAS_HINT_FILL, EVAS_HINT_FILL);