forked from enlightenment/enlightenment
* Add function to get text from e_entry
* Fix typo in e_scrollbar SVN revision: 17171
This commit is contained in:
parent
20f096900d
commit
19436ee45d
|
@ -5,13 +5,9 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO:
|
* TODO:
|
||||||
* - get text
|
|
||||||
* - review everything, was sleepy when i wrote this
|
|
||||||
* - look at theme / how its being set
|
|
||||||
* - implement missing _e_entry_smart_*, very easy
|
* - implement missing _e_entry_smart_*, very easy
|
||||||
* - free / delete properly
|
* - free / delete properly
|
||||||
* - implement focus and interact with theme
|
* - implement focus and interact with theme
|
||||||
* - e style
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct _E_Editable_Text_Smart_Data E_Editable_Text_Smart_Data;
|
typedef struct _E_Editable_Text_Smart_Data E_Editable_Text_Smart_Data;
|
||||||
|
@ -96,6 +92,19 @@ e_editable_text_add(Evas *evas)
|
||||||
return evas_object_smart_add(evas, e_editable_text_smart);
|
return evas_object_smart_add(evas, e_editable_text_smart);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char*
|
||||||
|
e_editable_text_text_get(Evas_Object *object)
|
||||||
|
{
|
||||||
|
E_Editable_Text_Smart_Data *editable_text_sd;
|
||||||
|
Evas_Textblock_Cursor *cursor;
|
||||||
|
|
||||||
|
if ((!object) || !(editable_text_sd = evas_object_smart_data_get(object)))
|
||||||
|
return;
|
||||||
|
|
||||||
|
cursor = (Evas_Textblock_Cursor *)evas_object_textblock2_cursor_get(editable_text_sd->text_object);
|
||||||
|
return evas_textblock2_cursor_node_text_get(cursor);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets the text of the object
|
* @brief Sets the text of the object
|
||||||
* @param object an editable text object
|
* @param object an editable text object
|
||||||
|
@ -109,7 +118,6 @@ e_editable_text_text_set(Evas_Object *object, const char *text)
|
||||||
if ((!object) || (!text) || !(editable_text_sd = evas_object_smart_data_get(object)))
|
if ((!object) || (!text) || !(editable_text_sd = evas_object_smart_data_get(object)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
printf("Text set: %s\n", text);
|
|
||||||
evas_object_textblock2_text_markup_set(editable_text_sd->text_object, text);
|
evas_object_textblock2_text_markup_set(editable_text_sd->text_object, text);
|
||||||
editable_text_sd->cursor_at_the_end = 1;
|
editable_text_sd->cursor_at_the_end = 1;
|
||||||
_e_editable_text_size_update(object);
|
_e_editable_text_size_update(object);
|
||||||
|
@ -353,6 +361,17 @@ e_entry_text_set(Evas_Object *entry, const char *text)
|
||||||
e_editable_text_text_set(e_entry_sd->entry_object, text);
|
e_editable_text_text_set(e_entry_sd->entry_object, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char*
|
||||||
|
e_entry_text_get(Evas_Object *entry)
|
||||||
|
{
|
||||||
|
E_Entry_Smart_Data *e_entry_sd;
|
||||||
|
|
||||||
|
if ((!entry) || !(e_entry_sd = evas_object_smart_data_get(entry)))
|
||||||
|
return;
|
||||||
|
|
||||||
|
return e_editable_text_text_get(e_entry_sd->entry_object);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
e_entry_text_insert(Evas_Object *entry, const char *text)
|
e_entry_text_insert(Evas_Object *entry, const char *text)
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
EAPI Evas_Object *e_editable_text_add(Evas *evas);
|
EAPI Evas_Object *e_editable_text_add(Evas *evas);
|
||||||
|
|
||||||
EAPI void e_editable_text_text_set(Evas_Object *object, const char *text);
|
EAPI void e_editable_text_text_set(Evas_Object *object, const char *text);
|
||||||
|
EAPI const char *e_entry_text_get(Evas_Object *object);
|
||||||
EAPI void e_editable_text_insert(Evas_Object *object, const char *text);
|
EAPI void e_editable_text_insert(Evas_Object *object, const char *text);
|
||||||
|
|
||||||
EAPI void e_editable_text_delete_char_before(Evas_Object *object);
|
EAPI void e_editable_text_delete_char_before(Evas_Object *object);
|
||||||
|
@ -24,6 +25,7 @@ EAPI void e_editable_text_cursor_hide(Evas_Object *object);
|
||||||
|
|
||||||
EAPI Evas_Object *e_entry_add(Evas *evas);
|
EAPI Evas_Object *e_entry_add(Evas *evas);
|
||||||
EAPI void e_entry_text_set (Evas_Object *entry, const char *text);
|
EAPI void e_entry_text_set (Evas_Object *entry, const char *text);
|
||||||
|
EAPI const char* e_editable_text_text_get(Evas_Object *object);
|
||||||
EAPI void e_entry_text_insert (Evas_Object *entry, const char *text);
|
EAPI void e_entry_text_insert (Evas_Object *entry, const char *text);
|
||||||
EAPI void e_entry_delete_char_before(Evas_Object *object);
|
EAPI void e_entry_delete_char_before(Evas_Object *object);
|
||||||
EAPI void e_entry_delete_char_after(Evas_Object *object);
|
EAPI void e_entry_delete_char_after(Evas_Object *object);
|
||||||
|
|
|
@ -74,7 +74,7 @@ e_scrollbar_direction_set(Evas_Object *object, E_Scrollbar_Direction dir)
|
||||||
|
|
||||||
switch (dir)
|
switch (dir)
|
||||||
{
|
{
|
||||||
case E_SCROLLBAR_HORISONTAL:
|
case E_SCROLLBAR_HORIZONTAL:
|
||||||
e_theme_edje_object_set(scrollbar_sd->edje_object,
|
e_theme_edje_object_set(scrollbar_sd->edje_object,
|
||||||
"base/theme/widgets/hscrollbar",
|
"base/theme/widgets/hscrollbar",
|
||||||
"widgets/hscrollbar");
|
"widgets/hscrollbar");
|
||||||
|
@ -94,7 +94,7 @@ e_scrollbar_direction_get(Evas_Object *object)
|
||||||
E_Scrollbar_Smart_Data *scrollbar_sd;
|
E_Scrollbar_Smart_Data *scrollbar_sd;
|
||||||
|
|
||||||
if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object)))
|
if ((!object) || !(scrollbar_sd = evas_object_smart_data_get(object)))
|
||||||
return E_SCROLLBAR_HORISONTAL;
|
return E_SCROLLBAR_HORIZONTAL;
|
||||||
|
|
||||||
return scrollbar_sd->direction;
|
return scrollbar_sd->direction;
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ _e_scrollbar_smart_add(Evas_Object *object)
|
||||||
"base/theme/widgets/hscrollbar",
|
"base/theme/widgets/hscrollbar",
|
||||||
"widgets/hscrollbar");
|
"widgets/hscrollbar");
|
||||||
|
|
||||||
scrollbar_sd->direction = E_SCROLLBAR_HORISONTAL;
|
scrollbar_sd->direction = E_SCROLLBAR_HORIZONTAL;
|
||||||
|
|
||||||
evas_object_smart_member_add(scrollbar_sd->edje_object, object);
|
evas_object_smart_member_add(scrollbar_sd->edje_object, object);
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
typedef enum _E_Scrollbar_Direction
|
typedef enum _E_Scrollbar_Direction
|
||||||
{
|
{
|
||||||
E_SCROLLBAR_HORISONTAL,
|
E_SCROLLBAR_HORIZONTAL,
|
||||||
E_SCROLLBAR_VERTICAL
|
E_SCROLLBAR_VERTICAL
|
||||||
} E_Scrollbar_Direction;
|
} E_Scrollbar_Direction;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue