Button and check can now be disabled.

This commit is contained in:
Jaime Thomas 2008-11-06 19:04:00 +00:00
parent 3e109996d3
commit 5e1e073521
6 changed files with 116 additions and 7 deletions

View File

@ -126,6 +126,16 @@ group {
border: 7 7 7 7;
}
}
description {
state: "disabled" 0.0;
inherit: "default" 0.0;
image {
normal: "button_disabled.png";
border: 11 11 10 10;
}
}
}
part {
@ -305,6 +315,22 @@ group {
target: "focus_clip";
transition: DECELERATE 0.5;
}
program {
name: "disable";
signal: "ecdb,disable";
action: STATE_SET "disabled" 0.0;
source: "ecdb";
target: "button";
}
program {
name: "enable";
signal: "ecdb,enable";
action: STATE_SET "default" 0.0;
source: "ecdb";
target: "button";
}
}
}

View File

@ -137,10 +137,16 @@ group {
}
description {
state: "disabled" 0.0;
state: "disabled_unsel" 0.0;
inherit: "default" 0.0;
color: 255 255 255 128;
}
description {
state: "disabled_sel" 0.0;
inherit: "active" 0.0;
color: 255 255 255 128;
}
}
part {
@ -201,5 +207,51 @@ group {
toggle_state();
}
}
program {
name: "disabled";
signal: "ecdb,disable";
source: "ecdb";
action: STATE_SET "disabled" 0.0;
target: "check_base";
target: "check_shadow";
}
program {
name: "disabled_check";
signal: "ecdb,disable";
source: "ecdb";
script {
if (get_int(s) == 1)
set_state(PART:"check", "disabled_sel",
0.0);
else
set_state(PART:"check",
"disabled_unsel", 0.0);
}
}
program {
name: "enabled";
signal: "ecdb,enable";
source: "ecdb";
action: STATE_SET "default" 0.0;
target: "check_base";
target: "check_shadow";
}
program {
name: "enabled_check";
signal: "ecdb,enable";
source: "ecdb";
script {
if (get_int(s) == 1)
set_state(PART:"check", "active", 0.0);
else
set_state(PART:"check", "default", 0.0);
}
}
}
}

View File

@ -210,7 +210,7 @@ group {
description {
state: "visible" 0.0;
inherit: "default" 0.0;
color: 255 255 255 160;
color: 255 255 255 0;
visible: 1;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 817 B

View File

@ -17,4 +17,5 @@ images {
image: "check_base.png" COMP;
image: "check_focus.png" COMP;
image: "check_shadow.png" COMP;
image: "button_disabled.png" COMP;
}

View File

@ -9,6 +9,8 @@ static void ecdb_cb_erase_page_buttons_clicked(void *data, Evas_Object *o,
const char *emission, const char *source);
static void ecdb_cb_page_hide_finished(void *data, Evas_Object *o,
const char *emission, const char *source);
static void ecdb_gui_controls_disable(const char **ids, int n);
static void ecdb_gui_controls_enable(const char **ids, int n);
static void ecdb_filelist_show(void);
static void ecdb_welcome_page_show(void);
static void ecdb_erase_page_show(void);
@ -387,13 +389,13 @@ ecdb_cb_erase_page_buttons_clicked(void *data, Evas_Object *o,
proj->quick = speed;
/* I need to find a better way to do this...
* Its pretty easy, but a lot more theming work
*/
edje_object_signal_emit(swallow, "ecdb,erase,start", "ecdb");
const char *ids[] = {"ecdb/erase/return", "ecdb/erase/begin",
"ecdb/erase/speed"};
ecdb_gui_controls_disable(ids, 3);
/* 1) Disable buttons...
* 2) Start erase
/* 2) Start erase
* 3) Grab a drive
* 4) Start burn
* 5) Set up progress callback
@ -640,3 +642,31 @@ ecdb_cb_page_hide_finished(void *data, Evas_Object *o, const char *emission,
ecdb_page_hide(source);
}
static void
ecdb_gui_controls_disable(const char **ids, int n)
{
Evas_Object *obj;
int i;
for (i = 0; i < n; i++)
{
obj = evas_object_name_find(ecore_evas_get(em->main_win_ee),
ids[i]);
edje_object_signal_emit(obj, "ecdb,disable", "ecdb");
}
}
static void
ecdb_gui_controls_enable(const char **ids, int n)
{
Evas_Object *obj;
int i;
for (i = 0; i < n; i++)
{
obj = evas_object_name_find(ecore_evas_get(em->main_win_ee),
ids[i]);
edje_object_signal_emit(obj, "ecdb,enable", "ecdb");
}
}