}
static void
+my_pop_close_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Evas_Object *btn, *pop, *en;
+ pop = data;
+ en = elm_object_parent_widget_get(pop);
+ elm_object_text_set(en, "This is very long text,"
+ " it is longer than width of this page."
+ " So if scroller is moved to next page,"
+ " that is bug when you click under button"
+ " and then click this entry text");
+ elm_entry_cursor_end_set(en);
+
+ evas_object_del(pop);
+}
+
+static void
+my_pop_bt_clr(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Evas_Object *pop, *btn, *en;
+ en = data;
+ elm_object_text_set(en, "");
+ elm_entry_cursor_end_set(en);
+
+ pop = elm_popup_add(en);
+ elm_object_text_set(pop, "If you click confirm, "
+ "set long text to entry "
+ "and delete popup obj");
+
+ btn = elm_button_add(pop);
+ elm_object_text_set(btn, "Confirm");
+ evas_object_smart_callback_add(btn, "clicked", my_pop_close_cb, pop);
+ elm_object_part_content_set(pop, "button1", btn);
+
+ evas_object_show(btn);
+ evas_object_show(pop);
+}
+
+static void
my_en_bt_clr(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Evas_Object *en = data;
en = elm_entry_add(ly);
elm_object_part_text_set(en, "guide", "Entry area");
- elm_object_text_set(en, "This is very long text, it is longer than width of this page. So if scroller is moved to next page, that is bug when you click under button and then click this entry text");
+ elm_object_text_set(en, "This is very long text,"
+ " it is longer than width of this page."
+ " So if scroller is moved to next page,"
+ " that is bug when you click under button"
+ " and then click this entry text");
elm_object_part_content_set(ly, "element1", en);
elm_entry_scrollable_set(en, EINA_TRUE);
elm_entry_single_line_set(en, EINA_TRUE);
evas_object_show(btn);
elm_object_focus_set(btn, EINA_TRUE);
+ btn = elm_button_add(ly);
+ elm_object_text_set(btn, "Click this and close popup");
+ elm_object_part_content_set(ly, "element3", btn);
+ evas_object_smart_callback_add(btn, "clicked", my_pop_bt_clr, en);
+ evas_object_show(btn);
+ elm_object_focus_set(btn, EINA_TRUE);
+
elm_object_part_text_set(ly, "text", "Page1");
elm_box_pack_end(bx, ly);
evas_object_show(ly);
}
EOLIAN static Eina_Bool
-_elm_entry_elm_widget_on_focus_region(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
+_elm_entry_elm_widget_on_focus_region(Eo *obj, Elm_Entry_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
{
- Evas_Coord edje_x, edje_y, elm_x, elm_y;
+ Evas_Coord cx, cy, cw, ch;
+ Evas_Coord edx, edy;
+ Evas_Coord elx, ely, elw, elh;
edje_object_part_text_cursor_geometry_get
- (sd->entry_edje, "elm.text", x, y, w, h);
+ (sd->entry_edje, "elm.text", &cx, &cy, &cw, &ch);
if (sd->single_line)
{
- evas_object_geometry_get(sd->entry_edje, NULL, NULL, NULL, h);
- if (y) *y = 0;
+ evas_object_geometry_get(sd->entry_edje, &edx, &edy, NULL, &ch);
+ cy = 0;
}
+ else
+ {
+ evas_object_geometry_get(sd->entry_edje, &edx, &edy, NULL, NULL);
+ }
+ evas_object_geometry_get(obj, &elx, &ely, &elw, &elh);
- evas_object_geometry_get(sd->entry_edje, &edje_x, &edje_y, NULL, NULL);
-
- evas_object_geometry_get(obj, &elm_x, &elm_y, NULL, NULL);
+ if (x)
+ {
+ *x = cx + edx - elx;
+ if ((cw < elw) && (*x + cw > elw)) *x = elw - cw;
+ }
+ if (y)
+ {
+ *y = cy + edy - ely;
+ if ((ch < elh) && (*y + ch > elh)) *y = elh - ch;
+ }
+ if (w) *w = cw;
+ if (h) *h = ch;
- if (x) *x += edje_x - elm_x;
- if (y) *y += edje_y - elm_y;
return EINA_TRUE;
}