summaryrefslogtreecommitdiff
path: root/legacy/edje/doc/examples/external_elm_panes.edc
blob: 8833668f7c634fb57c9bd37aeac7f084b762d263 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
collections {
   /* tell edje that we are going to use elementary external parts */
   externals {
      external: "elm";
   }
   
   /* those groups are the buttons used as content for the panes */
   group { name: "button1";
      parts {
         part { name: "btn";
            type: EXTERNAL;
            source: "elm/button";
            description { state: "default" 0.0;
               params.string: "label" "Left";
            }
         }
      }
   }
   group { name: "button2";
      parts {
         part { name: "btn";
            type: EXTERNAL;
            source: "elm/button";
            description { state: "default" 0.0;
               params.string: "label" "Top";
            }
         }
      }
   }
   group { name: "button3";
      parts {
         part { name: "btn";
            type: EXTERNAL;
            source: "elm/button";
            description { state: "default" 0.0;
               params.string: "label" "Right";
            }
         }
      }
   }

   /* this is the vertical panes */
   group { name: "panes2";
      parts {
         part { name: "panes";
            type: EXTERNAL;
            source: "elm/panes";
            description { state: "default" 0.0;
               params {
                  bool: "horizontal" 1;
                  string: "content left" "button2";
                  string: "content right" "button3";
               }
            }
         }
      }
   }
   
   group { name: "main";
      /* set a min window size */
      min: 300 400;

      parts {
         part { name: "bg";
            type: RECT;
            description { state: "default" 0.0;
               color: 255 255 255 255;
            }
         }

         part { name: "title";
            type: TEXT;
            effect: SOFT_SHADOW;
            description { state: "default" 0.0;
               color: 255 255 255 255;
               color3: 70 70 70 70;
               text {
                  text: "Elementary Panes";
                  font: "Sans";
                  size: 16;
                  align: 0.5 0.0;
               }
            }
         }

         /* first panes (horiz) */
         part { name: "panes1";
            type: EXTERNAL;
            source: "elm/panes";
            description { state: "default" 0.0;
               rel1.offset: 0 35;
               rel2.offset: 0 -45;
               params {
                  string: "content left" "button1";
                  string: "content right" "panes2";
               }
            }
            description { state: "swapped" 0.0;
               inherit: "default" 0.0;
               params {
                  string: "content left" "panes2";
                  string: "content right" "button1";
               }
            }
         }

         /* button used to swap the content of the panes1 */
         part { name: "swap_button";
            type: EXTERNAL;
            source: "elm/button";
            description { state: "default" 0.0;
               rel1 {
                  relative: 0.0 1.0;
                  offset: 0 -40;
               }
               params {
                  string: "label" "Swap & back";
               }
            }
         }
      }

      programs {
         /* when button is pressed set the 'swapped' state */
         program { name: "swap";
            signal: "clicked";
            source: "swap_button";
            action: STATE_SET "swapped" 0.0;
            target: "panes1";
            after: "go_back";
         }
         /* after 1 second return to the 'default' state */
         program { name: "go_back";
            in: 1.0 0.0;
            action: STATE_SET "default" 0.0;
            target: "panes1";
         }
      }
   }
}