Revision: 4341
          http://vexi.svn.sourceforge.net/vexi/?rev=4341&view=rev
Author:   clrg
Date:     2012-01-25 14:44:41 +0000 (Wed, 25 Jan 2012)
Log Message:
-----------
Example of focus management

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

Added: trunk/org.vexi-vexi.demo/src_main/org/vexi/demo/feature/focusing.t
===================================================================
--- trunk/org.vexi-vexi.demo/src_main/org/vexi/demo/feature/focusing.t          
                (rev 0)
+++ trunk/org.vexi-vexi.demo/src_main/org/vexi/demo/feature/focusing.t  
2012-01-25 14:44:41 UTC (rev 4341)
@@ -0,0 +1,58 @@
+<!-- Copyright 2007 - see COPYING for details [LGPL] -->
+
+<vexi xmlns:ui="vexi://ui" xmlns:lay="vexi.layout" xmlns="vexi.widget">
+    
+    static.name = "Focusing";
+    static.category = "Widgets";
+    
+    <lay:pad orient="vertical" padding="10">
+        <ui:box />
+        <ui:box vshrink="true">
+            <ui:box />
+            <ui:box orient="vertical" shrink="true">
+                <button id="b1" margin="10 5 0 5" text="Button A (focuses 
Check A)" />
+                <button id="b2" margin="10 5 0 5" text="Button B (focuses 
Check D)" />
+                <button id="b3" margin="10 5 0 5" text="Button C (focuses 
Check B)" />
+                <button id="b4" margin="10 5 0 5" text="Button D (focuses 
Check C)" />
+            </ui:box>
+            <ui:box id="checks" align="left" orient="vertical" hshrink="true">
+                <check id="c1" margin="10 5 0 5" text="Check A (focuses Button 
C)" />
+                <check id="c2" margin="10 5 0 5" text="Check B (focuses Button 
D)" />
+                <check id="c3" margin="10 5 0 5" text="Check C (focuses the 
link below)" />
+                <check id="c4" margin="10 5 0 5" text="Check D (focuses Button 
B)" />
+            </ui:box>
+            <ui:box />
+        </ui:box>
+        <link id="link" margin="10" text="Press Enter to focus Button A" 
icon="arrowright" shrink="true" />
+        <ui:box />
+        
+        const getNext = function(b) {
+            switch (b) {
+            case $b1: return $c1;
+            case $b2: return $c4;
+            case $b3: return $c2;
+            case $b4: return $c3;
+            case $c1: return $b3;
+            case $c2: return $b4;
+            case $c3: return $link;
+            case $c4: return $b2;
+            case $link: return $b1;
+            }
+        }
+        const moveFocus = function(v) {
+            cascade = v;
+            getNext(trapee).focused = true;
+        }
+        
+        $b1.action ++= moveFocus;
+        $b2.action ++= moveFocus;
+        $b3.action ++= moveFocus;
+        $b4.action ++= moveFocus;
+        $c1.selected ++= moveFocus;
+        $c2.selected ++= moveFocus;
+        $c3.selected ++= moveFocus;
+        $c4.selected ++= moveFocus;
+        $link.action ++= moveFocus;
+        
+    </lay:pad>
+</vexi>

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


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to