summaryrefslogtreecommitdiff
path: root/legacy/edje/doc
diff options
context:
space:
mode:
authorDavide Andreoli <dave@gurumeditation.it>2010-11-11 01:20:36 +0000
committerDavide Andreoli <dave@gurumeditation.it>2010-11-11 01:20:36 +0000
commitec49cb2f00247207befdafb87a1b28fb07baca0f (patch)
treee8d97d44b3f104421c8241c25f191ad1b34e1aea /legacy/edje/doc
parent759d4efaec3b8cee82dc7fa2113a489ae9b16dc6 (diff)
New edje example
This example show how to toggle the state of a part using the 'filter' param in edje programs. SVN revision: 54448
Diffstat (limited to 'legacy/edje/doc')
-rw-r--r--legacy/edje/doc/edje.dox.in3
-rw-r--r--legacy/edje/doc/examples/toggle_using_filter.edc66
2 files changed, 69 insertions, 0 deletions
diff --git a/legacy/edje/doc/edje.dox.in b/legacy/edje/doc/edje.dox.in
index dd6c665ce4..fecec266fc 100644
--- a/legacy/edje/doc/edje.dox.in
+++ b/legacy/edje/doc/edje.dox.in
@@ -497,5 +497,8 @@ Super-concise video player example using Edje/Emotion/Elementary.
497This example show the usage of lua scripting to create and animate some 497This example show the usage of lua scripting to create and animate some
498objects in the canvas. 498objects in the canvas.
499 499
500@example toggle_using_filter.edc
501This example show how to toggle the state of a part using the 'filter'
502param in edje programs
500 503
501*/ 504*/
diff --git a/legacy/edje/doc/examples/toggle_using_filter.edc b/legacy/edje/doc/examples/toggle_using_filter.edc
new file mode 100644
index 0000000000..9971fc0b50
--- /dev/null
+++ b/legacy/edje/doc/examples/toggle_using_filter.edc
@@ -0,0 +1,66 @@
1collections {
2 group { name: "main";
3 parts {
4 /* white background */
5 part { name: "bg";
6 type: RECT;
7 description { state: "default" 0.0;
8 color: 255 255 255 255;
9 }
10 }
11 /* title label */
12 part { name: "title";
13 type: TEXT;
14 description { state: "default" 0.0;
15 color: 0 0 0 255;
16 text {
17 text: "Toggle using filter";
18 font: "Sans";
19 size: 12;
20 align: 0.5 0.0;
21 }
22 }
23 }
24 /* the rectangle, will toggle color on click */
25 part { name: "rect";
26 type: RECT;
27 mouse_events: 1;
28 description { state: "default" 0.0;
29 color: 255 0 0 150;
30 max: 150 150;
31 align: 0.5 0.5;
32 map {
33 on: 1;
34 perspective_on: 1;
35 smooth: 1;
36 alpha: 1;
37 }
38 }
39 description { state: "blue" 0.0;
40 inherit: "default" 0.0;
41 color: 0 0 255 255;
42 }
43 }
44 }
45 programs {
46 /* on mouse click set the blue state, if we are in the default state */
47 program {
48 signal: "mouse,down,1";
49 source: "rect";
50 filter: "rect" "default";
51 action: STATE_SET "blue" 0.0;
52 transition: SINUSOIDAL 0.4;
53 target: "rect";
54 }
55 /* or back to the default state if we are in the blue state */
56 program {
57 signal: "mouse,down,1";
58 source: "rect";
59 filter: "rect" "blue";
60 action: STATE_SET "default" 0.0;
61 transition: SINUSOIDAL 0.4;
62 target: "rect";
63 }
64 }
65 }
66}