used new edje calls and fix bugs.
authorCarsten Haitzler <raster@rasterman.com>
Tue, 18 Nov 2008 08:45:38 +0000 (08:45 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Tue, 18 Nov 2008 08:45:38 +0000 (08:45 +0000)
SVN revision: 37701

data/themes/default.edc
src/bin/test.c
src/lib/Elementary.h
src/lib/elm_entry.c

index 38dd511..eab6828 100644 (file)
@@ -2950,7 +2950,7 @@ collections {
            description { state: "default" 0.0;
               text {
                  style: "entry_single_textblock_style";
-                 repch: "";
+                 repch: "*";
                  min: 1 1;
               }
            }
index 501b5b0..629788d 100644 (file)
@@ -769,6 +769,7 @@ my_bt_14(void *data, Evas_Object *obj, void *event_info)
    elm_entry_entry_set(en, "This is a single line");
    evas_object_size_hint_weight_set(en, 1.0, 0.0);
    evas_object_size_hint_align_set(en, -1.0, 0.0);
+   elm_entry_select_all(en);
    elm_scroller_content_set(sc, en);
    evas_object_show(en);
 
index 697e22a..40abd08 100644 (file)
@@ -200,6 +200,9 @@ extern "C" {
    EAPI void         elm_entry_entry_insert(Evas_Object *obj, const char *entry);
    EAPI void         elm_entry_line_wrap_set(Evas_Object *obj, Evas_Bool wrap);
    EAPI void         elm_entry_editable_set(Evas_Object *obj, Evas_Bool editable);
+   EAPI void         elm_entry_select_none(Evas_Object *obj);
+   EAPI void         elm_entry_select_all(Evas_Object *obj);
+       
    /* smart callbacks called:
     * "changed" - the text content changed
     * "selection,start" - the user started selecting text
@@ -285,19 +288,18 @@ extern "C" {
 ////////////////////////
 // 
 //// (bugs - high priority)
-// * single line entry on scale change adds newlines
 // * scale change for hover doesnt seem to do new size alloc nicely
-// * left/right arrow broken with password mode for entry
+// * left/right arrow broken with password mode for entry + utf8 chars...
 // 
 //// (incomplete - medium priority)
 // * disabled not supported
 // * tab widget focusing (not useful for touchscreen tho...)
-// * entry needs to support setting selection to all, or clearing
 // * bubble should allow style (left/right + top/bottom)
 // * need to get toplevel object (win)
 // * entry needs to set vkbd properties/hint (as does win)
-// * entry selection conflicts with finger scroll
+// * entry selection conflicts with finger scroll (make selection start/stop work on signals?)
 // * on the fly theme changes - test (should work)
+// * entry doesnt talk with x copy & paste at all
 // 
 //// (more widgets/features - medium priority)
 // * toolbar widget (edje + box + button + separators)
index 408c185..e585052 100644 (file)
@@ -30,10 +30,13 @@ static void _signal_entry_copy_notify(void *data, Evas_Object *obj, const char *
 static void _signal_entry_cut_notify(void *data, Evas_Object *obj, const char *emission, const char *source);
 static void _signal_cursor_changed(void *data, Evas_Object *obj, const char *emission, const char *source);
 
+static Eina_List *entries = NULL;
+
 static void
 _del_hook(Evas_Object *obj)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
+   entries = eina_list_remove(entries, obj);
    if (wd->deferred_recalc_job) ecore_job_del(wd->deferred_recalc_job);
    free(wd);
 }
@@ -165,7 +168,12 @@ static void
 _signal_selection_start(void *data, Evas_Object *obj, const char *emission, const char *source)
 {
    Widget_Data *wd = elm_widget_data_get(data);
+   Eina_List *l;
    evas_object_smart_callback_call(data, "selection,start", NULL);
+   for (l = entries; l; l = l->next)
+     {
+        if (l->data != data) elm_entry_select_none(l->data);
+     }
    // FIXME: x clipboard/copy & paste - do
 }
 
@@ -352,6 +360,7 @@ elm_entry_add(Evas_Object *parent)
    edje_object_part_text_set(wd->ent, "elm.text", "<br>");
    elm_widget_resize_object_set(obj, wd->ent);
    _sizing_eval(obj);
+   entries = eina_list_prepend(entries, obj);
    return obj;
 }
 
@@ -459,3 +468,17 @@ elm_entry_editable_set(Evas_Object *obj, Evas_Bool editable)
    if (t) free(t);
    _sizing_eval(obj);
 }
+
+EAPI void
+elm_entry_select_none(Evas_Object *obj)
+{
+   Widget_Data *wd = elm_widget_data_get(obj);
+   edje_object_part_text_select_none(wd->ent, "elm.text");
+}
+
+EAPI void
+elm_entry_select_all(Evas_Object *obj)
+{
+   Widget_Data *wd = elm_widget_data_get(obj);
+   edje_object_part_text_select_all(wd->ent, "elm.text");
+}