warnings-- and beginning of entry widget.

SVN revision: 36653
This commit is contained in:
Carsten Haitzler 2008-10-14 08:05:30 +00:00
parent f3a9115d1b
commit cd8a1192b0
4 changed files with 75 additions and 4 deletions

View File

@ -179,6 +179,8 @@ extern "C" {
EAPI void elm_hover_style_set(Evas_Object *obj, const char *style);
/* smart callbacks called:
*/
EAPI Evas_Object *elm_entry_add(Evas_Object *parent);
// FIXME: fixes to do
// * current sizing tree inefficient
@ -190,6 +192,8 @@ extern "C" {
// * toggle needs to be able to use custom frame style
//
// 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
// a table of options surrounding the button with scroll butons at
// the end and the ability to drag and scroll

View File

@ -32,6 +32,9 @@ elm_table.c \
elm_clock.c \
elm_layout.c \
elm_hover.c \
elm_entry.c \
elm_contact.c \
elm_contactlist.c \
\
els_pan.c \
els_pan.h \
@ -44,8 +47,6 @@ els_table.h \
els_icon.c \
els_icon.h
#... later
#elm_contactlist.c
libelementary_la_CFLAGS =
libelementary_la_LIBADD = @my_libs@ @ELEMENTARY_LIBS@

View File

@ -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);
}

View File

@ -669,7 +669,7 @@ _smart_scrollbar_read(Smart_Data *sd)
static void
_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.hbar", 0.0, 0.0);
@ -880,7 +880,7 @@ _smart_scrollbar_size_adjust(Smart_Data *sd)
}
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.hbar", 1.0, 1.0);