Revision: 4449
          http://vexi.svn.sourceforge.net/vexi/?rev=4449&view=rev
Author:   clrg
Date:     2012-10-11 17:39:54 +0000 (Thu, 11 Oct 2012)
Log Message:
-----------
Feature - option/combo.textalign affects their items

Modified Paths:
--------------
    trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/option.t

Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/option.t
===================================================================
--- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/option.t   
2012-10-11 15:56:37 UTC (rev 4448)
+++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/option.t   
2012-10-11 17:39:54 UTC (rev 4449)
@@ -31,6 +31,7 @@
         thisbox.selecteditem ++= static.selecteditemRead;
         
         // assign event traps
+        Children   ++= static.childrenWrite;
         KeyPressed ++= static.keypressEvent;
         Press1     ++= static.pressEvent;
         
@@ -39,6 +40,7 @@
         popdown ++= static.popdownWrite;
         enabled ++= static.enableWrite;
         value   ++= static.valueWrite;
+        textalign ++= static.textalignWrite;
         v_listgroup ++= static.listgroupWrite;
         
         // assign theme traps
@@ -47,21 +49,6 @@
         
     </ui:box>
     
-    static.selecteditemRead = function() {
-        return trapee.v_listgroup?.selected;
-    }
-    
-    static.listgroupWrite = function(v) {
-        var g = trapee.v_listgroup;
-        if (g) {
-            g.selected --= trapee.selectWrite;
-        }
-        cascade = v;
-        if (v) {
-            v.selected ++= trapee.selectWrite;
-        }
-    }
-    
     /** pop up or down depending on whether option is open */
     static.buttonActionWrite = function(v) {
         var p_opt = trapee.v_option;
@@ -83,6 +70,12 @@
         cascade = v;
     }
     
+    /** match item align to option textalign */
+    static.childrenWrite = function(v) {
+        cascade = v;
+        if (v) v.align = trapee.textalign?:trapee.align;
+    }
+    
     /** applied to list container */
     static.contentLeaveEvent = function(v) {
         cascade = v;
@@ -124,6 +117,18 @@
         }
     }
     
+    /** listen to listgroup.selected */
+    static.listgroupWrite = function(v) {
+        var g = trapee.v_listgroup;
+        if (g) {
+            g.selected --= trapee.selectWrite;
+        }
+        cascade = v;
+        if (v) {
+            v.selected ++= trapee.selectWrite;
+        }
+    }
+    
     /** set value on popdown to selected item */
     static.popdownWrite = function(v) {
         var t = trapee;
@@ -152,6 +157,19 @@
         }
     }
     
+    /** direct access to the selected item */
+    static.selecteditemRead = function() {
+        return trapee.v_listgroup?.selected;
+    }
+    
+    /** cause items to match option textalign */
+    static.textalignWrite = function(v) {
+        trapee.align = v;
+        for (var i,item in trapee) {
+            item.align = v;
+        }
+    }
+    
     /** set display text on value write */
     static.valueWrite = function(v) {
         var t = trapee;

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


------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to