forked from enlightenment/efl
warnings-- and beginning of entry widget.
SVN revision: 36653
This commit is contained in:
parent
f3a9115d1b
commit
cd8a1192b0
|
@ -180,6 +180,8 @@ extern "C" {
|
||||||
/* smart callbacks called:
|
/* smart callbacks called:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
EAPI Evas_Object *elm_entry_add(Evas_Object *parent);
|
||||||
|
|
||||||
// FIXME: fixes to do
|
// FIXME: fixes to do
|
||||||
// * current sizing tree inefficient
|
// * current sizing tree inefficient
|
||||||
// * scroller could do with page up/down/left/right buttons and and idea of
|
// * scroller could do with page up/down/left/right buttons and and idea of
|
||||||
|
@ -190,6 +192,8 @@ extern "C" {
|
||||||
// * toggle needs to be able to use custom frame style
|
// * toggle needs to be able to use custom frame style
|
||||||
//
|
//
|
||||||
// FIXME: immediate hitlist for widgets:
|
// FIXME: immediate hitlist for widgets:
|
||||||
|
// ENTRY: 1 or more line text entry
|
||||||
|
//
|
||||||
// POPSEL: a button that when pressed uses a hover to display a h/v box or
|
// POPSEL: a button that when pressed uses a hover to display a h/v box or
|
||||||
// a table of options surrounding the button with scroll butons at
|
// a table of options surrounding the button with scroll butons at
|
||||||
// the end and the ability to drag and scroll
|
// the end and the ability to drag and scroll
|
||||||
|
|
|
@ -32,6 +32,9 @@ elm_table.c \
|
||||||
elm_clock.c \
|
elm_clock.c \
|
||||||
elm_layout.c \
|
elm_layout.c \
|
||||||
elm_hover.c \
|
elm_hover.c \
|
||||||
|
elm_entry.c \
|
||||||
|
elm_contact.c \
|
||||||
|
elm_contactlist.c \
|
||||||
\
|
\
|
||||||
els_pan.c \
|
els_pan.c \
|
||||||
els_pan.h \
|
els_pan.h \
|
||||||
|
@ -44,8 +47,6 @@ els_table.h \
|
||||||
els_icon.c \
|
els_icon.c \
|
||||||
els_icon.h
|
els_icon.h
|
||||||
|
|
||||||
#... later
|
|
||||||
#elm_contactlist.c
|
|
||||||
|
|
||||||
libelementary_la_CFLAGS =
|
libelementary_la_CFLAGS =
|
||||||
libelementary_la_LIBADD = @my_libs@ @ELEMENTARY_LIBS@
|
libelementary_la_LIBADD = @my_libs@ @ELEMENTARY_LIBS@
|
||||||
|
|
|
@ -0,0 +1,66 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
#include "elm_priv.h"
|
||||||
|
|
||||||
|
typedef struct _Widget_Data Widget_Data;
|
||||||
|
|
||||||
|
struct _Widget_Data
|
||||||
|
{
|
||||||
|
Evas_Object *ent;
|
||||||
|
};
|
||||||
|
|
||||||
|
static void _del_hook(Evas_Object *obj);
|
||||||
|
static void _sizing_eval(Evas_Object *obj);
|
||||||
|
|
||||||
|
static void
|
||||||
|
_del_hook(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
|
free(wd);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_sizing_eval(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
|
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||||
|
|
||||||
|
edje_object_size_min_calc(wd->ent, &minw, &minh);
|
||||||
|
evas_object_size_hint_min_set(obj, minw, minh);
|
||||||
|
evas_object_size_hint_max_set(obj, maxw, maxh);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_on_focus_hook(void *data, Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Widget_Data *wd = elm_widget_data_get(obj);
|
||||||
|
evas_object_focus_set(wd->ent, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI Evas_Object *
|
||||||
|
elm_entry_add(Evas_Object *parent)
|
||||||
|
{
|
||||||
|
Evas_Object *obj;
|
||||||
|
Evas *e;
|
||||||
|
Widget_Data *wd;
|
||||||
|
|
||||||
|
wd = ELM_NEW(Widget_Data);
|
||||||
|
e = evas_object_evas_get(parent);
|
||||||
|
obj = elm_widget_add(e);
|
||||||
|
elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
|
||||||
|
elm_widget_data_set(obj, wd);
|
||||||
|
elm_widget_del_hook_set(obj, _del_hook);
|
||||||
|
elm_widget_can_focus_set(obj, 1);
|
||||||
|
|
||||||
|
wd->ent = edje_object_add(e);
|
||||||
|
_elm_theme_set(wd->ent, "entry", "base", "default");
|
||||||
|
elm_widget_resize_object_set(obj, wd->ent);
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
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);
|
||||||
|
_sizing_eval(obj);
|
||||||
|
}
|
|
@ -669,7 +669,7 @@ _smart_scrollbar_read(Smart_Data *sd)
|
||||||
static void
|
static void
|
||||||
_smart_scrollbar_reset(Smart_Data *sd)
|
_smart_scrollbar_reset(Smart_Data *sd)
|
||||||
{
|
{
|
||||||
Evas_Coord px, py;
|
Evas_Coord px = 0, py = 0;
|
||||||
|
|
||||||
edje_object_part_drag_value_set(sd->edje_obj, "elm.dragable.vbar", 0.0, 0.0);
|
edje_object_part_drag_value_set(sd->edje_obj, "elm.dragable.vbar", 0.0, 0.0);
|
||||||
edje_object_part_drag_value_set(sd->edje_obj, "elm.dragable.hbar", 0.0, 0.0);
|
edje_object_part_drag_value_set(sd->edje_obj, "elm.dragable.hbar", 0.0, 0.0);
|
||||||
|
@ -880,7 +880,7 @@ _smart_scrollbar_size_adjust(Smart_Data *sd)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Evas_Coord px, py;
|
Evas_Coord px = 0, py = 0;
|
||||||
|
|
||||||
edje_object_part_drag_size_set(sd->edje_obj, "elm.dragable.vbar", 1.0, 1.0);
|
edje_object_part_drag_size_set(sd->edje_obj, "elm.dragable.vbar", 1.0, 1.0);
|
||||||
edje_object_part_drag_size_set(sd->edje_obj, "elm.dragable.hbar", 1.0, 1.0);
|
edje_object_part_drag_size_set(sd->edje_obj, "elm.dragable.hbar", 1.0, 1.0);
|
||||||
|
|
Loading…
Reference in New Issue