{
Evas_Object *base;
Evas_Object *entry;
- Evas_Object *scroller;
Evas_Object *ricon;
Evas_Object *licon;
const char *label;
if (!wd || !wd->base)
return;
_elm_theme_object_set(obj, wd->base, "editfield", "base", elm_widget_style_get(obj));
- if(wd->single_line)
- edje_object_part_swallow(wd->base, "elm.swallow.content", wd->scroller);
- else
- edje_object_part_swallow(wd->base, "elm.swallow.content", wd->entry);
+ edje_object_part_swallow(wd->base, "elm.swallow.content", wd->entry);
if(!wd->editing)
edje_object_signal_emit(wd->base, "elm,state,over,show", "elm");
if(wd->show_guide_text)
ELM_CHECK_WIDTYPE(obj, widtype);
if (!wd || !wd->base || wd->single_line == single_line)
return;
- wd->single_line = single_line;
+ wd->single_line = !!single_line;
elm_entry_single_line_set(wd->entry, single_line);
if(single_line)
{
- if(!wd->scroller)
- {
- wd->scroller = elm_scroller_add(obj);
- elm_scroller_bounce_set(wd->scroller, 0, 0);
- elm_scroller_policy_set(wd->scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
- elm_widget_sub_object_add(obj, wd->scroller);
- elm_scroller_content_min_limit(wd->scroller, 0, 1);
- }
- edje_object_part_unswallow(wd->base, wd->entry);
- edje_object_part_swallow(wd->base, "elm.swallow.content", wd->scroller);
- 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);
-
- elm_scroller_content_set(wd->scroller, wd->entry);
+ elm_entry_scrollable_set(wd->entry, EINA_TRUE);
+ elm_entry_single_line_set(wd->entry,EINA_TRUE);
edje_object_signal_emit(wd->base, "elm,state,text,singleline", "elm");
}
else
{
- entry = elm_entry_add(obj);
- elm_object_style_set(entry, "editfield");
- evas_object_size_hint_weight_set(entry, 0, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(entry, 0, EVAS_HINT_FILL);
- evas_object_event_callback_add(entry,
- EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _changed_size_hints, obj);
- edje_object_part_swallow(wd->base, "elm.swallow.content", entry);
- evas_object_smart_callback_add(entry, "changed", _entry_changed_cb, obj);
- elm_widget_sub_object_add(obj, entry);
- elm_entry_entry_set(entry, elm_entry_entry_get(wd->entry));
- if(wd->scroller)
- edje_object_part_unswallow(wd->base, wd->scroller);
- evas_object_del(wd->entry);
- wd->entry = entry;
- edje_object_part_swallow(wd->base, "elm.swallow.content", wd->entry);
+ elm_entry_scrollable_set(wd->entry, EINA_FALSE);
+ elm_entry_single_line_set(wd->entry,EINA_FALSE);
edje_object_signal_emit(wd->base, "elm,state,text,multiline", "elm");
}
}