hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=425b7e42c38f7420dad3cee981c9cb53cf4703f1

commit 425b7e42c38f7420dad3cee981c9cb53cf4703f1
Author: Bowon Ryu <[email protected]>
Date:   Mon Jul 25 16:31:10 2016 +0900

    templates: updated mouse event example
    
    Test Plan:
    1. enventor
    2. esc -> New
    3. MouseEvent
    
    Reviewers: Jaehyun_Cho, herb, Hermet
    
    Differential Revision: https://phab.enlightenment.org/D4162
---
 data/images/ENVENTOR_EMBEDDED_BUTTON_BG.png       | Bin 0 -> 405 bytes
 data/images/ENVENTOR_EMBEDDED_BUTTON_BG_DOWN.png  | Bin 0 -> 436 bytes
 data/images/ENVENTOR_EMBEDDED_BUTTON_BG_HOVER.png | Bin 0 -> 393 bytes
 data/images/Makefile.am                           |   3 +
 data/templates/Makefile.am                        |   5 ++
 data/templates/MouseEvent.edc                     |  99 ++++++++++++++++++++++
 6 files changed, 107 insertions(+)

diff --git a/data/images/ENVENTOR_EMBEDDED_BUTTON_BG.png 
b/data/images/ENVENTOR_EMBEDDED_BUTTON_BG.png
new file mode 100644
index 0000000..d0e399f
Binary files /dev/null and b/data/images/ENVENTOR_EMBEDDED_BUTTON_BG.png differ
diff --git a/data/images/ENVENTOR_EMBEDDED_BUTTON_BG_DOWN.png 
b/data/images/ENVENTOR_EMBEDDED_BUTTON_BG_DOWN.png
new file mode 100644
index 0000000..d4882af
Binary files /dev/null and b/data/images/ENVENTOR_EMBEDDED_BUTTON_BG_DOWN.png 
differ
diff --git a/data/images/ENVENTOR_EMBEDDED_BUTTON_BG_HOVER.png 
b/data/images/ENVENTOR_EMBEDDED_BUTTON_BG_HOVER.png
new file mode 100644
index 0000000..b83d3c6
Binary files /dev/null and b/data/images/ENVENTOR_EMBEDDED_BUTTON_BG_HOVER.png 
differ
diff --git a/data/images/Makefile.am b/data/images/Makefile.am
index 34f8b90..e8793e0 100644
--- a/data/images/Makefile.am
+++ b/data/images/Makefile.am
@@ -25,6 +25,9 @@ files_DATA = ENVENTOR_EMBEDDED_IMAGE.png \
              ENVENTOR_EMBEDDED_NEEDLE_MINUTE_RECT.png \
              ENVENTOR_EMBEDDED_NEEDLE_SECOND_RECT.png \
              ENVENTOR_EMBEDDED_WATCHFACE_RECT.png \
+             ENVENTOR_EMBEDDED_BUTTON_BG.png \
+             ENVENTOR_EMBEDDED_BUTTON_BG_HOVER.png \
+             ENVENTOR_EMBEDDED_BUTTON_BG_DOWN.png \
              ENVENTOR_EMBEDDED_ICON_ARROW.png \
              ENVENTOR_EMBEDDED_ICON_BADGE.png \
              ENVENTOR_EMBEDDED_ICON_BADGE_DOWN.png \
diff --git a/data/templates/Makefile.am b/data/templates/Makefile.am
index a0c77cc..7599be4 100644
--- a/data/templates/Makefile.am
+++ b/data/templates/Makefile.am
@@ -20,6 +20,8 @@ files_DATA = Basic.edc \
              Map.edj \
              MobileLayout.edc \
              MobileLayout.edj \
+             MouseEvent.edc \
+             MouseEvent.edj \
              Proxy.edc \
              Proxy.edj \
              Rect.edc \
@@ -60,6 +62,9 @@ Map.edj: Makefile Map.edc
 MobileLayout.edj: Makefile MobileLayout.edc
                $(EDJE_CC) $(EDJE_FLAGS) $(srcdir)/MobileLayout.edc 
$(builddir)/MobileLayout.edj
 
+MouseEvent.edj: Makefile MouseEvent.edc
+               $(EDJE_CC) $(EDJE_FLAGS) $(srcdir)/MouseEvent.edc 
$(builddir)/MouseEvent.edj
+
 Textblock.edj: Makefile Textblock.edc
        $(EDJE_CC) $(EDJE_FLAGS) $(srcdir)/Textblock.edc 
$(builddir)/Textblock.edj
 
diff --git a/data/templates/MouseEvent.edc b/data/templates/MouseEvent.edc
new file mode 100644
index 0000000..053f000
--- /dev/null
+++ b/data/templates/MouseEvent.edc
@@ -0,0 +1,99 @@
+collections {
+   base_scale: 1.0;
+   group { "main";
+      /* TODO: Please replace embedded image files to your application image 
files. */
+      images {
+         image: "ENVENTOR_EMBEDDED_BUTTON_BG.png" COMP;
+         image: "ENVENTOR_EMBEDDED_BUTTON_BG_HOVER.png" COMP;
+         image: "ENVENTOR_EMBEDDED_BUTTON_BG_DOWN.png" COMP;
+      }
+      parts {
+         rect { "button_shadow";
+            scale: 1;
+            desc { "default";
+               color: 0 0 0 155;
+               visible: 1;
+               align: 0.5 0.5;
+               rel1.to: "button_bg";
+               rel1.relative: 0.0 0.0;
+               rel2.to: "button_bg";
+               rel2.relative: 1.0 1.0;
+               rel2.offset: 5 5;
+               min: 50 20;
+               max: 200 50;
+               fixed: 1 1;
+            }
+         }
+         image { "button_bg";
+            scale: 1;
+            desc { "default";
+               visible: 1;
+               /* TODO: Please replace embedded image files to your 
application image files. */
+               image.normal: "ENVENTOR_EMBEDDED_BUTTON_BG.png";
+               //aspect: 1 1;
+               image.border: 3 3 3 3;
+               align: 0.5 0.5;
+               align: 0.5 0.5;
+               rel1.relative: 0.0 0.0;
+               rel2.relative: 1.0 1.0;
+               min: 50 20;
+               max: 200 50;
+               fixed: 1 1;
+            }
+            desc { "hovered";
+               inherit: "default";
+               image.normal: "ENVENTOR_EMBEDDED_BUTTON_BG_HOVER.png";
+            }
+            desc { "clicked";
+               inherit: "default";
+               image.normal: "ENVENTOR_EMBEDDED_BUTTON_BG_DOWN.png";
+            }
+         }
+         text { "button_text";
+            scale: 1;
+            mouse_events: 0;
+            desc { "default";
+               color: 70 70 70 255;
+               visible: 1;
+               text {
+                  size: 15;
+                  font: "Mono";
+                  text: "Mouse Event Example";
+                  align: 0.5 0.5;
+                  min: 0 0;
+               }
+               min: 50 20;
+               align: 0.5 0.5;
+               rel1.relative: 0.0 0.0;
+               rel2.relative: 1.0 1.0;
+            }
+         }
+      }
+      programs {
+         program { "mouse_down";
+            signal: "mouse,down,1";
+            source: "button_bg";
+            action: STATE_SET "clicked";
+            target: "button_bg";
+         }
+         program { "mouse_up";
+            signal: "mouse,up,1";
+            source: "button_bg";
+            action: STATE_SET "hovered";
+            target: "button_bg";
+         }
+         program { "mouse_in";
+            signal: "mouse,in";
+            source: "button_bg";
+            action: STATE_SET "hovered";
+            target: "button_bg";
+         }
+         program { "mouse_out";
+            signal: "mouse,out";
+            source: "button_bg";
+            action: STATE_SET "default";
+            target: "button_bg";
+         }
+      }
+   }
+}
\ No newline at end of file

-- 


Reply via email to