add calls to select all/none

SVN revision: 37700
This commit is contained in:
Carsten Haitzler 2008-11-18 08:45:27 +00:00
parent e3dd190240
commit d5bc0e8546
4 changed files with 62 additions and 7 deletions

View File

@ -236,6 +236,9 @@ extern "C" {
EAPI void edje_object_part_text_set (Evas_Object *obj, const char *part, const char *text);
EAPI const char *edje_object_part_text_get (const Evas_Object *obj, const char *part);
EAPI const char *edje_object_part_text_selection_get(const Evas_Object *obj, const char *part);
EAPI void edje_object_part_text_select_none(const Evas_Object *obj, const char *part);
EAPI void edje_object_part_text_select_all(const Evas_Object *obj, const char *part);
EAPI void edje_object_part_text_insert (Evas_Object *obj, const char *part, const char *text);
EAPI Eina_List *edje_object_part_text_anchor_list_get(const Evas_Object *obj, const char *part);
EAPI Eina_List *edje_object_part_text_anchor_geometry_get(const Evas_Object *obj, const char *part, const char *anchor);

View File

@ -27,13 +27,6 @@ void *alloca (size_t);
#include "edje_private.h"
// FIXME: need a way to propagate emits to selections and cursors (eg for disabled etc.)
// FIXME: look for anchors <+ a href=X>...</> in nodes - make matching anchor
// ranges (2 cursors) AND then make matching acnhor event objects,
// capture events on those objects, emit achor mouse,in, mouse,out,
// mouse,down and mouse,up
// FIXME: apis 's query anchor stuff???, anchor revents
typedef struct _Entry Entry;
typedef struct _Sel Sel;
typedef struct _Anchor Anchor;
@ -1345,6 +1338,27 @@ _edje_entry_set_cursor_end(Edje_Real_Part *rp)
_curs_end(en->cursor, rp->object, en);
}
void
_edje_entry_select_none(Edje_Real_Part *rp)
{
Entry *en = rp->entry_data;
if (!en) return;
_sel_clear(en->cursor, rp->object, en);
}
void
_edje_entry_select_all(Edje_Real_Part *rp)
{
Entry *en = rp->entry_data;
if (!en) return;
_sel_clear(en->cursor, rp->object, en);
_curs_start(en->cursor, rp->object, en);
_sel_enable(en->cursor, rp->object, en);
_sel_start(en->cursor, rp->object, en);
_curs_end(en->cursor, rp->object, en);
_sel_extend(en->cursor, rp->object, en);
}
const Eina_List *
_edje_entry_anchor_geometry_get(Edje_Real_Part *rp, const char *anchor)
{

View File

@ -1236,6 +1236,8 @@ void _edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text);
void _edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text);
void _edje_entry_set_cursor_start(Edje_Real_Part *rp);
void _edje_entry_set_cursor_end(Edje_Real_Part *rp);
void _edje_entry_select_none(Edje_Real_Part *rp);
void _edje_entry_select_all(Edje_Real_Part *rp);
const Eina_List *_edje_entry_anchor_geometry_get(Edje_Real_Part *rp, const char *anchor);
const Eina_List *_edje_entry_anchors_list(Edje_Real_Part *rp);
void _edje_entry_cursor_geometry_get(Edje_Real_Part *rp, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch);

View File

@ -947,6 +947,42 @@ edje_object_part_text_selection_get(const Evas_Object *obj, const char *part)
return NULL;
}
/** sets the selection to be none
* @param obj A valid Evas_Object handle
* @param part The part name
*/
EAPI void
edje_object_part_text_select_none(const Evas_Object *obj, const char *part)
{
Edje *ed;
Edje_Real_Part *rp;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return;
rp = _edje_real_part_recursive_get(ed, (char *)part);
if (!rp) return;
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
_edje_entry_select_none(rp);
}
/** sets the selection to be everything
* @param obj A valid Evas_Object handle
* @param part The part name
*/
EAPI void
edje_object_part_text_select_all(const Evas_Object *obj, const char *part)
{
Edje *ed;
Edje_Real_Part *rp;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return;
rp = _edje_real_part_recursive_get(ed, (char *)part);
if (!rp) return;
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
_edje_entry_select_all(rp);
}
/** Inserts the text for an object part just before the cursor position
* @param obj A valid Evas Object handle
* @param part The part name