and support/test the new edje entry stuff. pretyt solid i think.

SVN revision: 36742
This commit is contained in:
Carsten Haitzler 2008-10-17 06:41:07 +00:00
parent 19d1c80dcf
commit 4c94e5067a
3 changed files with 71 additions and 3 deletions

View File

@ -2685,7 +2685,9 @@ collections {
source: "elm/entry/selection/default"; // selection under
// source2: "X"; // selection over
// source3: "X"; // cursor under
source4: "elm/entry/cursor/default"; // cursor under
source4: "elm/entry/cursor/default"; // cursorover
source5: "elm/entry/anchor/default"; // anchor under
// source6: "X"; // anchor over
description { state: "default" 0.0;
text {
style: "entry_textblock_style";
@ -2835,6 +2837,18 @@ collections {
}
}
}
group { name: "elm/entry/anchor/default";
parts {
part { name: "bg";
type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
color: 128 0 0 64;
}
}
}
}
///////////////////////////////////////////////////////////////////////////////
group { name: "elm/icon/base/default"; min: 10 10;
images.image: "bt_base1.png" COMP; parts { part { name: "base";

View File

@ -686,8 +686,10 @@ my_bt_13(void *data, Evas_Object *obj, void *event_info)
"This is an entry widget in this window that<br>"
"uses markup <b>like this</> for styling and<br>"
"formatting <em>like this</>, as well as<br>"
"<+a href=X><link>links in the text</></>, so enter text<br>"
"in here to edit it.");
"<a href=X><link>links in the text</></a>, so enter text<br>"
"in here to edit it. By the way, links are<br>"
"called <a href=anc-02>Anchors</a> so you will need<br>"
"to refer to them this way.");
evas_object_size_hint_weight_set(en, 1.0, 1.0);
evas_object_size_hint_align_set(en, -1.0, -1.0);
elm_box_pack_end(bx, en);

View File

@ -104,9 +104,48 @@ static void
_signal_cursor_changed(void *data, Evas_Object *obj, const char *emission, const char *source)
{
Widget_Data *wd = elm_widget_data_get(data);
Evas_Coord cx, cy, cw, ch;
evas_object_smart_callback_call(data, "cursor,changed", NULL);
// FIXME: handle auto-scroll within parent (get cursor - if not visible
// jump so it is)
edje_object_part_text_cursor_geometry_get(wd->ent, "elm.text", &cx, &cy, &cw, &ch);
printf("CURSOR: @%i+%i %ix%i\n", cx, cy, cw, ch);
}
static void
_signal_anchor_down(void *data, Evas_Object *obj, const char *emission, const char *source)
{
Widget_Data *wd = elm_widget_data_get(data);
printf("DOWN %s\n", emission);
}
static void
_signal_anchor_up(void *data, Evas_Object *obj, const char *emission, const char *source)
{
Widget_Data *wd = elm_widget_data_get(data);
printf("UP %s\n", emission);
}
static void
_signal_anchor_move(void *data, Evas_Object *obj, const char *emission, const char *source)
{
Widget_Data *wd = elm_widget_data_get(data);
printf("MOVE %s\n", emission);
}
static void
_signal_anchor_in(void *data, Evas_Object *obj, const char *emission, const char *source)
{
Widget_Data *wd = elm_widget_data_get(data);
printf("IN %s\n", emission);
}
static void
_signal_anchor_out(void *data, Evas_Object *obj, const char *emission, const char *source)
{
Widget_Data *wd = elm_widget_data_get(data);
printf("OUT %s\n", emission);
}
EAPI Evas_Object *
@ -134,6 +173,11 @@ elm_entry_add(Evas_Object *parent)
edje_object_signal_callback_add(wd->ent, "entry,copy,notify", "elm.text", _signal_entry_copy_notify, obj);
edje_object_signal_callback_add(wd->ent, "entry,cut,notify", "elm.text", _signal_entry_cut_notify, obj);
edje_object_signal_callback_add(wd->ent, "cursor,changed", "elm.text", _signal_cursor_changed, obj);
edje_object_signal_callback_add(wd->ent, "anchor,mouse,down,*", "elm.text", _signal_anchor_down, obj);
edje_object_signal_callback_add(wd->ent, "anchor,mouse,up,*", "elm.text", _signal_anchor_up, obj);
edje_object_signal_callback_add(wd->ent, "anchor,mouse,move,*", "elm.text", _signal_anchor_move, obj);
edje_object_signal_callback_add(wd->ent, "anchor,mouse,in,*", "elm.text", _signal_anchor_in, obj);
edje_object_signal_callback_add(wd->ent, "anchor,mouse,out,*", "elm.text", _signal_anchor_out, obj);
elm_widget_resize_object_set(obj, wd->ent);
return obj;
}
@ -143,6 +187,14 @@ elm_entry_entry_set(Evas_Object *obj, const char *entry)
{
Widget_Data *wd = elm_widget_data_get(obj);
edje_object_part_text_set(wd->ent, "elm.text", entry);
// debug
{
Evas_List *l, *an;
an = edje_object_part_text_anchor_list_get(wd->ent, "elm.text");
for (l = an; l; l = l->next)
printf("ANCHOR: %s\n", l->data);
}
_sizing_eval(obj);
}