Revision: 4016
          http://vexi.svn.sourceforge.net/vexi/?rev=4016&view=rev
Author:   clrg
Date:     2011-02-04 00:12:10 +0000 (Fri, 04 Feb 2011)

Log Message:
-----------
A bit of fun for the demo :D pixel art ftw!

Added Paths:
-----------
    trunk/org.vexi-vexi.demo/src_main/org/vexi/demo/feature/colorboxes.t

Added: trunk/org.vexi-vexi.demo/src_main/org/vexi/demo/feature/colorboxes.t
===================================================================
--- trunk/org.vexi-vexi.demo/src_main/org/vexi/demo/feature/colorboxes.t        
                        (rev 0)
+++ trunk/org.vexi-vexi.demo/src_main/org/vexi/demo/feature/colorboxes.t        
2011-02-04 00:12:10 UTC (rev 4016)
@@ -0,0 +1,79 @@
+<!-- Copyright 2007 - see COPYING for details [LGPL] -->
+
+<vexi xmlns:ui="vexi://ui" xmlns:lay="vexi.layout" xmlns="vexi.widget"
+    xmlns:demo="org.vexi.demo">
+    
+    static.name = "Color Boxes";
+    static.category = "Contributed";
+    
+    <lay:pad orient="vertical" padding="4">
+        <ui:box shrink="true" text="Box Coloring Application!" />
+        <ui:box shrink="true">
+            <ui:box text="Color:" />
+            <option id="color">
+                <item text="red" value="#ff0000" selected="true" />
+                <item text="blue" value="#0000ff" />
+                <item text="green" value="#00ff00" />
+            </option>
+            <separator hshrink="true" />
+            <ui:box text="Box size:" />
+            <option id="zoom">
+               <item text="auto" selected="true" />
+               <!--item text="25px" />
+               <item text="50px" />
+               <item text="100px" />
+               <item text="200px" /-->
+            </option>
+            <separator hshrink="true" />
+            <button id="reset" text="Reset" />
+        </ui:box>
+        <bevel id="bvl" form="down" fill="white" margin="3 6 6 6">
+            <scrollpane autohide="true">
+                <ui:box id="content" />
+            </scrollpane>
+        </bevel>
+        
+        var clearfill;
+        
+        var enterWrite = function(v) {
+            cascade = v;
+            if (vexi.ui.mouse.button==1) {
+                trapee.fill = clearfill ? null : $color.value;
+            }
+        }
+        
+        var pressWrite = function(v) {
+            cascade = v;
+            clearfill = trapee.fill==$color.value;
+            trapee.fill = clearfill ? null : $color.value;
+        }
+        
+        var iterate = function(func) {
+            for (var i=0; 10>i; i++) {
+                for (var j=0; 20>j; j++) {
+                    func(i, j);
+                }
+            }
+        }
+        
+        iterate(function(x, y) {
+            var r = $content[y];
+            if (r == null) {
+                r = vexi.box;
+                r.orient = "vertical";
+                $content.add(r);
+            }
+            var b = vexi.box;
+            r.add(b);
+            b.Enter ++= enterWrite;
+            b.Press1 ++= pressWrite;
+        });
+        
+        $reset.action ++= function(v) {
+            iterate(function(x, y) {
+                $content[y][x].fill = null;
+            });
+        }
+        
+    </lay:pad>
+</vexi>


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to