edje/edje_entry : When selected word exists, selection is cleared and cursor remains...
authorWooHyun Jung <wh0705.jung@samsung.com>
Mon, 22 Apr 2013 14:34:25 +0000 (23:34 +0900)
committerWooHyun Jung <wh0705.jung@samsung.com>
Mon, 22 Apr 2013 14:34:25 +0000 (23:34 +0900)
ChangeLog
NEWS
data/libeo.so.1.7.99-gdb.py [new file with mode: 0644]
src/lib/edje/edje_entry.c

index 3ad1ad4..977431f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-04-22  WooHyun Jung
+
+        * Edje: When selected word exists, selection is cleared and cursor
+               remains on the current edje_entry by additional key input.
+
 2013-04-19  Jihoon Kim (jihoon)
 
         * Edje: Remove code to call ecore_imf_context_reset in case of pressing ESC, Return key
diff --git a/NEWS b/NEWS
index 7d30119..17ede5a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -251,3 +251,4 @@ Fixes:
     * Evas: If an object goes to be hidden without replacing the cur/prev state info, the object context can be corrupted at the next show time. Now it replaces the cur/prev in that rare case.
     * Evas: Fix evas gl_x11 in 16bpp and lower depths than 24/32 bpp.
     * Edje: Fix useless ecore_imf_context_reset call in case of pressing ESC and Return key
+    * Edje: When selected word exists, selection is cleared and cursor remains on the current entry by additional key input.
diff --git a/data/libeo.so.1.7.99-gdb.py b/data/libeo.so.1.7.99-gdb.py
new file mode 100644 (file)
index 0000000..5a3778f
--- /dev/null
@@ -0,0 +1,7 @@
+import sys
+
+eodir = '/usr/local/share/eo/gdb'
+if not eodir in sys.path:
+   sys.path.insert(0, eodir)
+
+import eo_gdb
index f6611da..193f712 100644 (file)
@@ -464,18 +464,15 @@ _curs_jump_line(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en, int ln)
    Evas_Coord lx, ly, lw, lh;
    int last = _curs_line_last_get(c, o, en);
 
-   if (ln < 0) ln = 0;
-   else
-     {
-        if (ln > last) ln = last;
-     }
+   if (ln < 0) return EINA_FALSE;
+   if (ln > last) return EINA_FALSE;
 
    _curs_update_from_curs(c, o, en, &cx, &cy);
 
    if (!evas_object_textblock_line_number_geometry_get(o, ln, &lx, &ly, &lw, &lh))
      return EINA_FALSE;
    if (evas_textblock_cursor_char_coord_set(c, cx, ly + (lh / 2)))
-     return EINA_FALSE;
+     return EINA_TRUE;
    evas_textblock_cursor_line_set(c, ln);
    if (cx < (lx + (lw / 2)))
      {
@@ -1340,9 +1337,16 @@ _edje_key_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
         _compose_seq_reset(en);
         if (multiline)
           {
+             if (en->have_selection &&
+                 (evas_textblock_cursor_pos_get(en->sel_start) != evas_textblock_cursor_pos_get(en->sel_end)))
+               ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
              if (en->select_allow)
                {
-                  if (shift) _sel_start(en->cursor, rp->object, en);
+                  if (shift)
+                    {
+                       _sel_start(en->cursor, rp->object, en);
+                       ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+                    }
                   else _sel_clear(ed, en->cursor, rp->object, en);
                }
              if (_curs_up(en->cursor, rp->object, en))
@@ -1362,9 +1366,16 @@ _edje_key_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
         _compose_seq_reset(en);
         if (multiline)
           {
+             if (en->have_selection &&
+                 (evas_textblock_cursor_pos_get(en->sel_start) != evas_textblock_cursor_pos_get(en->sel_end)))
+               ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
              if (en->select_allow)
                {
-                  if (shift) _sel_start(en->cursor, rp->object, en);
+                  if (shift)
+                    {
+                       _sel_start(en->cursor, rp->object, en);
+                       ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+                    }
                   else _sel_clear(ed, en->cursor, rp->object, en);
                }
              if (_curs_down(en->cursor, rp->object, en))
@@ -1382,9 +1393,16 @@ _edje_key_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
             (!strcmp(ev->keyname, "KP_Left") && !ev->string))
      {
         _compose_seq_reset(en);
+        if (en->have_selection &&
+            (evas_textblock_cursor_pos_get(en->sel_start) != evas_textblock_cursor_pos_get(en->sel_end)))
+          ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
         if (en->select_allow)
           {
-             if (shift) _sel_start(en->cursor, rp->object, en);
+             if (shift)
+               {
+                  _sel_start(en->cursor, rp->object, en);
+                  ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+               }
              else _sel_clear(ed, en->cursor, rp->object, en);
           }
         if (evas_textblock_cursor_char_prev(en->cursor))
@@ -1403,9 +1421,16 @@ _edje_key_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
             (!strcmp(ev->keyname, "KP_Right") && !ev->string))
      {
         _compose_seq_reset(en);
+        if (en->have_selection &&
+            (evas_textblock_cursor_pos_get(en->sel_start) != evas_textblock_cursor_pos_get(en->sel_end)))
+          ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
         if (en->select_allow)
           {
-             if (shift) _sel_start(en->cursor, rp->object, en);
+             if (shift)
+               {
+                  _sel_start(en->cursor, rp->object, en);
+                  ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
+               }
              else _sel_clear(ed, en->cursor, rp->object, en);
           }
         /* If control is pressed, go to the end of the word */