Add a check button

This commit is contained in:
Jaime Thomas 2008-11-05 14:54:58 +00:00
parent 3069596f20
commit 20c6c541a2
11 changed files with 233 additions and 9 deletions

View File

@ -11,4 +11,5 @@ collections {
#include "groups/button.edc"
#include "groups/icons.edc"
#include "groups/erase_disc.edc"
#include "groups/check.edc"
}

View File

@ -278,7 +278,7 @@ group {
program {
name: "focus_in";
signal: "ecdb,button,focus,in";
signal: "ecdb,button,in";
signal: "mouse,down,1";
action: STATE_SET "visible" 0.0;
source: "*";
@ -299,7 +299,7 @@ group {
program {
name: "focus_out";
signal: "ecdb,button,focus,out";
signal: "ecdb,focus,out";
action: STATE_SET "default" 0.0;
source: "ecdb";
target: "focus_clip";

View File

@ -0,0 +1,205 @@
group {
name: "ecdb/check";
script {
public s;
public toggle_state() {
if (get_int(s) == 0)
{
set_state(PART:"check", "active", 0.0);
emit("ecdb,check,checked", "ecdb/check");
set_int(s, 1);
}
else
{
set_state(PART:"check", "default", 0.0);
emit("ecdb,check,unchecked", "ecdb/check");
set_int(s, 0);
}
}
}
parts {
part {
name: "check_base";
type: IMAGE;
description {
state: "default" 0.0;
min: 20 18;
max: 20 18;
fixed: 1 1;
align: 0.0 0.5;
rel1 {
relative: 0.0 0.0;
offset: 2 2;
}
rel2 {
relative: 0.0 1.0;
offset: 2 -3;
}
image {
normal: "check_base.png";
}
}
description {
state: "disabled" 0.0;
inherit: "default" 0.0;
color: 255 255 255 128;
}
}
part {
name: "check_shadow";
type: IMAGE;
description {
state: "default" 0.0;
color: 255 255 255 128;
image.normal: "check_shadow.png";
rel1 {
to: "check";
relative: 0.0 0.0;
offset: 0 1;
}
rel2 {
to: "check";
relative: 1.0 1.0;
offset: -1 -1;
}
}
description {
state: "focused" 0.0;
inherit: "default" 0.0;
color: 255 255 255 255;
image.normal: "check_focus.png";
rel1 {
to: "check";
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
to: "check";
relative: 1.0 1.0;
offset: -1 -1;
}
}
description {
state: "disabled" 0.0;
inherit: "default" 0.0;
color: 255 255 255 0;
}
}
part {
name: "check";
description {
state: "default" 0.0;
min: 20 18;
max: 20 18;
fixed: 1 1;
align: 0.0 0.5;
rel1 {
relative: 0.0 0.0;
offset: 2 2;
}
rel2 {
relative: 0.0 1.0;
offset: 2 -3;
}
image {
normal: "check0.png";
}
}
description {
state: "active" 0.0;
inherit: "default" 0.0;
image {
normal: "check2.png";
}
}
description {
state: "disabled" 0.0;
inherit: "default" 0.0;
color: 255 255 255 128;
}
}
part {
name: "label";
type: TEXT;
description {
state: "default" 0.0;
color: 60 60 60 255;
fixed: 1 1;
rel1 {
to: "check";
offset: 25 0;
}
rel2 {
relative: 1.0 1.0;
to_y: "check";
offset: -1 0;
}
text {
text: "Change Burn Speed";
font: "ecdb/default";
min: 1 1;
size: 11;
align: 0.0 0.5;
}
}
}
}
programs {
program {
name: "focus_in";
signal: "ecdb,focus,in";
signal: "mouse,down,1";
action: STATE_SET "focused" 0.0;
source: "*";
target: "check_shadow";
}
program {
name: "focus_out";
signal: "ecdb,focus,out";
action: STATE_SET "default" 0.0;
source: "ecdb";
target: "check_shadow";
}
program {
name: "clicked";
signal: "mouse,down,1";
source: "*";
script {
toggle_state();
}
}
}
}

View File

@ -175,6 +175,14 @@ group {
after: "hide,finished";
}
program {
name: "erase_page,controls_disable";
signal: "ecdb,erase,start";
source: "ecdb";
action: STATE_SET "disabled" 0.0;
target: "ecdb/erase/return";
}
program {
name: "hide,finished";
action: SIGNAL_EMIT "hide,finished" "erase_page";

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

View File

@ -12,4 +12,9 @@ images {
image: "clear.png" COMP;
image: "iso.png" COMP;
image: "frame_outline.png" COMP;
image: "check0.png" COMP;
image: "check2.png" COMP;
image: "check_base.png" COMP;
image: "check_focus.png" COMP;
image: "check_shadow.png" COMP;
}

View File

@ -1,7 +1,7 @@
#include "ecdb.h"
static void ecdb_handle_typebuf(Evas_Object *gui);
static void ecdb_cb_buttons_focused(void *data, Evas_Object *o,
static void ecdb_cb_controls_focused(void *data, Evas_Object *o,
const char *emission, const char *source);
static void ecdb_cb_welcome_page_buttons_clicked(void *data, Evas_Object *o,
const char *emission, const char *source);
@ -293,7 +293,7 @@ ecdb_handle_typebuf(Evas_Object *gui)
static void
ecdb_cb_buttons_focused(void *data, Evas_Object *o,
ecdb_cb_controls_focused(void *data, Evas_Object *o,
const char *emission, const char *source)
{
static char *old_source;
@ -303,7 +303,7 @@ ecdb_cb_buttons_focused(void *data, Evas_Object *o,
{
unsel = evas_object_name_find(ecore_evas_get(em->main_win_ee),
old_source);
edje_object_signal_emit(unsel, "ecdb,button,focus,out", "ecdb");
edje_object_signal_emit(unsel, "ecdb,focus,out", "ecdb");
free(old_source);
old_source = strdup(source);
}
@ -345,6 +345,7 @@ ecdb_cb_erase_page_buttons_clicked(void *data, Evas_Object *o,
const char *emission, const char *source)
{
Evas_Object *swallow, *gui;
static int speed;
gui = evas_object_name_find(ecore_evas_get(em->main_win_ee), "gui");
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
@ -375,6 +376,9 @@ ecdb_cb_erase_page_buttons_clicked(void *data, Evas_Object *o,
ecdb_erase_project_destroy(proj);
}
proj->speed = speed;
speed = 0;
/* 1) Disable buttons...
* 2) Start erase
* 3) Grab a drive
@ -384,9 +388,10 @@ ecdb_cb_erase_page_buttons_clicked(void *data, Evas_Object *o,
}
else if (!strcmp(source, "ecdb/erage/speed"))
else if (!strcmp(source, "ecdb/erase/speed"))
{
speed = !speed;
printf("Burn speed: %d\n", speed);
}
printf("Action: %s\n", source);
@ -415,7 +420,7 @@ ecdb_welcome_page_show(void)
evas_object_resize(swallow, w, h);
edje_object_part_swallow(gui, "action_area", swallow);
edje_object_signal_callback_add(swallow, "mouse,down,1",
"ecdb/*", ecdb_cb_buttons_focused,
"ecdb/*", ecdb_cb_controls_focused,
NULL);
edje_object_signal_callback_add(swallow, "mouse,clicked,1",
"ecdb/*", ecdb_cb_welcome_page_buttons_clicked,
@ -567,7 +572,7 @@ ecdb_erase_page_show(void)
edje_object_part_swallow(gui, "action_area", swallow);
evas_object_show(swallow);
edje_object_signal_callback_add(swallow, "mouse,down,1",
"ecdb/*", ecdb_cb_buttons_focused,
"ecdb/*", ecdb_cb_controls_focused,
NULL);
edje_object_signal_callback_add(swallow, "mouse,clicked,1",
"ecdb/erase/*",