legacy/experimental/ecdb/trunk/data/themes/default/macros/check.edc

265 lines
7.7 KiB
Plaintext
Raw Normal View History

2009-01-24 21:00:34 +00:00
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#define CHECK(partname, labeltext, minx, miny, maxx, maxy, rel1xto, rel1yto, rel1x, rel1y, rel2xto, rel2yto, rel2x, rel2y, offset1x, offset1y, offset2x, offset2y, alignx, aligny) \
part { \
name: partname"base"; \
type: RECT; \
scale: 1; \
description { \
state: "default" 0.0; \
min: minx miny; \
max: maxx maxy; \
align: alignx aligny; \
color: 0 0 0 0; \
rel1 { \
to_x: rel1xto; \
to_y: rel1yto; \
relative: rel1x rel1y; \
offset: offset1x offset1y; \
} \
rel2 { \
to_x: rel2xto; \
to_y: rel2yto; \
relative: rel2x rel2y; \
offset: offset2x offset2y; \
} \
} \
} \
part { \
name: partname"check_base"; \
type: IMAGE; \
scale: 1; \
description { \
state: "default" 0.0; \
min: 20 18; \
max: 20 18; \
fixed: 1 1; \
align: 0.0 0.5; \
rel1 { \
to: partname"base"; \
relative: 0.0 0.0; \
offset: 2 2; \
} \
rel2 { \
to: partname"base"; \
relative: 0.0 1.0; \
offset: -1 -3; \
} \
image { \
normal: "check_base.png"; \
} \
} \
description { \
state: "disabled" 0.0; \
inherit: "default" 0.0; \
color: 255 255 255 128; \
} \
} \
part { \
name: partname"check_shadow"; \
type: IMAGE; \
scale: 1; \
description { \
state: "default" 0.0; \
color: 255 255 255 128; \
image.normal: "check_shadow.png"; \
rel1 { \
to: partname; \
relative: 0.0 0.0; \
offset: 0 1; \
} \
rel2 { \
to: partname; \
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: partname; \
relative: 0.0 0.0; \
offset: 0 0; \
} \
rel2 { \
to: partname; \
relative: 1.0 1.0; \
offset: -1 -1; \
} \
} \
description { \
state: "disabled" 0.0; \
inherit: "default" 0.0; \
color: 255 255 255 0; \
} \
} \
part { \
name: partname; \
scale: 1; \
description { \
state: "default" 0.0; \
min: 20 18; \
max: 20 18; \
fixed: 1 1; \
align: 0.0 0.5; \
rel1 { \
to: partname"base"; \
relative: 0.0 0.0; \
offset: 2 2; \
} \
rel2 { \
to: partname"base"; \
relative: 0.0 1.0; \
offset: 2 -3; \
} \
image { \
normal: "check0.png"; \
} \
} \
description { \
state: "on" 0.0; \
inherit: "default" 0.0; \
image { \
normal: "check2.png"; \
} \
} \
description { \
state: "disabled_unsel" 0.0; \
inherit: "default" 0.0; \
color: 255 255 255 128; \
} \
description { \
state: "disabled_sel" 0.0; \
inherit: "default" 0.0; \
image { \
normal: "check2.png"; \
} \
color: 255 255 255 128; \
} \
} \
part { \
name: labeltext; \
type: TEXT; \
scale: 1; \
description { \
state: "default" 0.0; \
color: 60 60 60 255; \
fixed: 1 1; \
rel1 { \
2009-01-24 21:19:10 +00:00
to_x: partname"check_base"; \
to_y: partname; \
relative: 1.0 0.0; \
offset: 5 0; \
2009-01-24 21:00:34 +00:00
} \
rel2 { \
relative: 1.0 1.0; \
to_y: partname; \
offset: -1 0; \
} \
text { \
text: ""; \
font: "ecdb/default"; \
min: 1 1; \
size: 11; \
align: 0.0 0.5; \
} \
} \
}
#define CHECK_PROGS(partname) \
program { \
name: partname"focus_in"; \
signal: "ecdb,focus,in,"partname; \
signal: "mouse,down,1"; \
action: STATE_SET "focused" 0.0; \
source: "*"; \
target: partname"check_shadow"; \
} \
program { \
name: partname"focus_out"; \
signal: "ecdb,focus,out,"partname; \
action: STATE_SET "default" 0.0; \
source: "ecdb"; \
target: partname"check_shadow"; \
} \
program { \
name: partname"clicked"; \
signal: "mouse,clicked,1"; \
source: partname"*"; \
script { \
new str[50]; \
new Float:val; \
get_state(PART:partname, str, 50, val); \
if (!strcmp(str, "on")) \
{ \
emit(partname",toggle,off", partname); \
set_state(PART:partname, "default", 0.0); \
} \
else if (!strcmp(str, "default")) \
{ \
emit(partname",toggle,on", partname); \
set_state(PART:partname, "on", 0.0); \
} \
} \
} \
program { \
name: partname"disabled"; \
signal: "ecdb,disable,"partname; \
source: "ecdb"; \
action: STATE_SET "disabled" 0.0; \
target: partname"check_base"; \
target: partname"check_shadow"; \
} \
program { \
name: partname"disabled_check"; \
signal: "ecdb,disable,"partname; \
source: "ecdb"; \
script { \
new str[50]; \
new Float:val; \
get_state(PART:partname, str, 50, val); \
if (!strcmp(str, "on")) \
set_state(PART:partname, "disabled_sel", 0.0); \
else if (!strcmp(str, "default")) \
set_state(PART:partname, "disabled_unsel", 0.0); \
} \
} \
program { \
name: partname"enabled"; \
signal: "ecdb,enable,"partname; \
source: "ecdb"; \
action: STATE_SET "default" 0.0; \
target: partname"check_base"; \
target: partname"check_shadow"; \
} \
program { \
name: partname"enabled_check"; \
signal: "ecdb,enable,"partname; \
source: "ecdb"; \
script { \
new str[50]; \
new Float:val; \
get_state(PART:partname, str, 50, val); \
if (!strcmp(str, "disabled_sel")) \
set_state(PART:partname, "on", 0.0); \
else if (!strcmp(str, "disabled_unsel")) \
set_state(PART:partname, "default", 0.0); \
} \
} \
program { \
name: partname"check_off"; \
signal: "ecdb,check,off,"partname; \
source: "ecdb"; \
action: STATE_SET "default" 0.0; \
target: partname; \
} \
program { \
name: partname"check_on"; \
signal: "ecdb,check,on,"partname; \
source: "ecdb"; \
action: STATE_SET "on" 0.0; \
target: partname; \
}