The daily edje example: EXTERNAL elm Panes.
authordavemds <davemds@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 14 Oct 2010 09:21:12 +0000 (09:21 +0000)
committerdavemds <davemds@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 14 Oct 2010 09:21:12 +0000 (09:21 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@53391 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

doc/edje.dox.in
doc/examples/external_elm_panes.edc [new file with mode: 0644]

index b172c1d..dd6c665 100644 (file)
@@ -487,6 +487,9 @@ This example create some elementary buttons and do some actions on user click.
 @example external_elm_check.edc
 This example show EXTERNAL checkbox in action.
 
+@example external_elm_panes.edc
+This example show EXTERNAL elementary panes in action.
+
 @example external_emotion_elm.edc
 Super-concise video player example using Edje/Emotion/Elementary.
 
diff --git a/doc/examples/external_elm_panes.edc b/doc/examples/external_elm_panes.edc
new file mode 100644 (file)
index 0000000..8833668
--- /dev/null
@@ -0,0 +1,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";
+         }
+      }
+   }
+}