external_elm_panes.edc

This example show EXTERNAL elementary panes in action.

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";
         }
      }
   }
}