Bit more work on combo

This commit is contained in:
Jaime Thomas 2008-12-19 21:38:57 +00:00
parent 32e53aee64
commit 43dcb1820f
2 changed files with 55 additions and 9 deletions

View File

@ -9,7 +9,8 @@ group {
description {
state: "default" 0.0;
color: 255 255 255 0;
color: 0 0 0 0;
min: 20 20;
rel1 {
relative: 0.0 0.0;
@ -17,7 +18,7 @@ group {
}
rel2 {
relative: 0.0 0.0;
relative: 1.0 1.0;
offset: -1 -1;
}
}
@ -25,7 +26,7 @@ group {
description {
state: "active" 0.0;
inherit: "default" 0.0;
color: 255 255 255 128;
color: 0 0 0 128;
}
}
}
@ -34,9 +35,10 @@ group {
program {
name: "set_active";
signal: "ecdb,combo,back,show";
source: "ecbd";
source: "ecdb";
action: STATE_SET "active" 0.0;
target: "base";
transition: DECELERATE 0.2;
}
program {
@ -45,8 +47,16 @@ group {
source: "ecdb";
action: STATE_SET "default" 0.0;
target: "base";
transition: DECELERATE 0.2;
}
}
program {
name: "clicked_send";
signal: "mouse,clicked,*";
source: "*";
action: SIGNAL_EMIT "ecdb,combo,back,dismiss" "ecdb";
}
}
group {
@ -224,13 +234,28 @@ group {
}
program {
name: "unclick1";
name: "clicked_send";
signal: "mouse,clicked,1";
source: "*";
action: SIGNAL_EMIT "ecdb,combo,clicked" "ecdb";
}
program {
name: "collapse";
signal: "ecdb,combo,collapse";
source: "ecdb";
action: STATE_SET "default" 0.0;
target: "combo_button";
}
program {
name: "expand";
signal: "ecdb,combo,expand";
source: "ecdb";
action: STATE_SET "clicked" 0.0;
target: "combo_button";
}
program {
name: "unclick2";
signal: "mouse,up,1";

View File

@ -328,6 +328,21 @@ _combo_clicked(void *data, Evas_Object *obj, void *event_info)
ecdb_combo_collapse(data);
}
void
_combo_click_cb(void *data, Evas_Object *obj, const char *emission,
const char *source)
{
evas_object_smart_callback_call(obj, "clicked", NULL);
ecdb_combo_expand(obj);
}
void
_combo_back_clicked_cb(void *data, Evas_Object *obj, const char *emission,
const char *source)
{
ecdb_combo_collapse(data);
}
Evas_Object *
ecdb_combo_add(Evas_Object *parent, const char *name)
{
@ -338,11 +353,15 @@ ecdb_combo_add(Evas_Object *parent, const char *name)
evas_object_event_callback_add(parent, EVAS_CALLBACK_RESIZE, _combo_resize,
c);
evas_object_event_callback_add(parent, EVAS_CALLBACK_HIDE, _combo_hide, c);
evas_object_event_callback_add(parent, EVAS_CALLBACK_HIDE, _combo_hide, c);
edje_object_signal_callback_add(c, "ecdb,combo,clicked", "ecdb",
_combo_click_cb, c);
back = edje_object_add(evas_object_evas_get(parent));
edje_object_file_set(back, em->theme_path, "ecdb/combo/background");
edje_object_signal_callback_add(back, "ecdb,combo,back,dismiss", "ecdb",
_combo_back_clicked_cb, c);
evas_object_data_set(c, "back", back);
evas_object_pass_events_set(back, 1);
evas_object_show(back);
return c;
@ -366,17 +385,18 @@ ecdb_combo_expand(Evas_Object *c)
{
Evas_Object *back;
const char *location;
char buf[1024];
//char buf[1024];
int w, h;
location = _combo_best_location(c);
snprintf(buf, sizeof(buf), "ecdb,combo,expand,%s", location);
edje_object_signal_emit(c, buf, "ecdb");
edje_object_signal_emit(c, "ecdb,combo,expand", "ecdb");
back = evas_object_data_get(c, "back");
evas_object_move(back, 0, 0);
ecore_evas_geometry_get(em->main_win_ee, NULL, NULL, &w, &h);
evas_object_resize(back, w, h);
evas_object_pass_events_set(back, 0);
evas_object_layer_set(back, evas_object_layer_get(c) + 1);
edje_object_signal_emit(back, "ecdb,combo,back,show", "ecdb");
}
@ -387,6 +407,7 @@ ecdb_combo_collapse(Evas_Object *c)
back = evas_object_data_get(c, "back");
edje_object_signal_emit(back, "ecdb,combo,back,hide", "ecdb");
evas_object_pass_events_set(back, 1);
edje_object_signal_emit(c, "ecdb,combo,collapse", "ecdb");
}