Revision: 4419
          http://vexi.svn.sourceforge.net/vexi/?rev=4419&view=rev
Author:   clrg
Date:     2012-07-16 19:38:51 +0000 (Mon, 16 Jul 2012)
Log Message:
-----------
Table refactoring / fixes

Modified Paths:
--------------
    trunk/org.vexi-vexi.demo/src_main/org/vexi/demo/feature/table_dynamic.t
    trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/util/date.t
    trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/body.t
    trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/cell.t
    trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/column.t
    trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/head.t
    trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/row.t
    trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/table.t
    trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/cell.t
    trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/column.t
    trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/foot.t
    trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/row.t

Added Paths:
-----------
    trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/foot.t

Modified: 
trunk/org.vexi-vexi.demo/src_main/org/vexi/demo/feature/table_dynamic.t
===================================================================
--- trunk/org.vexi-vexi.demo/src_main/org/vexi/demo/feature/table_dynamic.t     
2012-07-16 03:22:26 UTC (rev 4418)
+++ trunk/org.vexi-vexi.demo/src_main/org/vexi/demo/feature/table_dynamic.t     
2012-07-16 19:38:51 UTC (rev 4419)
@@ -1,7 +1,11 @@
-<!-- Copyright 2007 - see COPYING for details [LGPL] -->
+<!-- Copyright 2012 - see COPYING for details [LGPL] -->
 
-<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="vexi.widget.table"
-    xmlns:wi="vexi.widget" xmlns:lay="vexi.layout">
+<vexi xmlns:ui="vexi://ui"
+      xmlns:meta="vexi://meta"
+      xmlns:wi="vexi.widget"
+      xmlns:lay="vexi.layout"
+      xmlns="vexi.widget.table">
+    
     <meta:doc>
         <author>Michael Goodwin</author>
         <desc>An example of a table where the data is fetched on request</desc>
@@ -78,9 +82,7 @@
                     </row>
                 </foot>
             </table>
-
         </wi:bevel>
-        $foot.v_head = $head;
         
         const max = vexi.math.max;
         var requested = 0;
@@ -91,8 +93,8 @@
         var primes = static.newPrimeCalculator();      
 
         var newPrimeCell = function(row) {
-            var r = new .cell();
-            r.value ++= function(v) {
+            var cell = new .cell();
+            cell.value ++= function(v) {
                 var ind = row.value?[0];
                 if (ind==null) return;
                 $requested.text = requested = max(requested, ind);
@@ -100,28 +102,28 @@
                 if (v==null) {
                     // REMARK creating potentially a lot of threads ... only a 
demo
                     vexi.thread = function() {
-                        r.value = primes.get(ind);
+                        cell.value = primes.get(ind);
                         $calculated.text = calculated = max(calculated, ind);
                     };
                 }
                 cascade = v;
                 if (v==null) {
-                    r.text = "calculating";
+                    cell.text = "calculating";
                 }
             };
-            return r;
+            return cell;
         };
         
-        var newCellLabelFunc =  function(colhead) {
-            if (colhead.primes ) {
+        var newCellLabelFunc = function(col) {
+            if (col.primes) {
                 return newPrimeCell(this);
             }
-            return new .cell(colhead.datatype);
+            return new .cell(col.datatype);
         };
         
-        var newCellEditorFunc = function(colhead) {
-            if (colhead.editable) {
-                switch (colhead.datatype) {
+        var newCellEditorFunc = function(col) {
+            if (col.editable) {
+                switch (col.datatype) {
                 case "bool": 
                     var r = new wi.check();
                     r.selected = false;
@@ -129,7 +131,7 @@
                 default:
                     return new wi.textfield();
                 }    
-            } else if (colhead.primes) {
+            } else if (col.primes) {
                 return newPrimeCell(this);
             }
             return null;

Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/util/date.t
===================================================================
--- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/util/date.t       
2012-07-16 03:22:26 UTC (rev 4418)
+++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/util/date.t       
2012-07-16 19:38:51 UTC (rev 4419)
@@ -312,9 +312,11 @@
     var day = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
     var month = 
["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
     
-    /** parse incoming date and display nicely */
+    /** parse incoming date and return a nicely formatted string */
     static.formatDate = function(d) {
         cascade = v;
+        if (typeof(d) == "date")
+            return d.getDate()+" "+month[d.getMonth()]+" "+d.getFullYear();
         return d.day+" "+month[d.month-1]+" "+d.year;
     }
     

Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/body.t
===================================================================
--- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/body.t     
2012-07-16 03:22:26 UTC (rev 4418)
+++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/body.t     
2012-07-16 19:38:51 UTC (rev 4419)
@@ -23,7 +23,7 @@
         
         /** customizable effect on rows */
         thisbox.fillEffect = function(row, index) {
-            row.rowfill = index%2 ? null : "#11000000";
+            row.fill = index%2 ? null : "#11000000";
         }
         
         /** update alternating row colors */

Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/cell.t
===================================================================
--- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/cell.t     
2012-07-16 03:22:26 UTC (rev 4418)
+++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/cell.t     
2012-07-16 19:38:51 UTC (rev 4419)
@@ -1,18 +1,57 @@
-<!-- Copyright 2009 - see COPYING for details [LGPL] -->
+<!-- Copyright 2012 - see COPYING for details [LGPL] -->
 
-<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="org.vexi.lib.role"
-    xmlns:theme="vexi.theme" xmlns:util="vexi.util">
-    <meta:doc>
-        <author>Charles Goodwin</author>
-        <desc>A very basic table cell implementation</desc>
-    </meta:doc>
+<vexi xmlns:ui="vexi://ui"
+      xmlns:theme="vexi.theme"
+      xmlns:util="vexi.util"
+      xmlns="org.vexi.lib.role">
     
     <tooltipable />
     <ui:box>
+        
+        // performed before trap assignment because by this
+        // point the widget is not fully constructed, which
+        // means we must wait until container assignment
         thisbox.datatype = arguments[0];
-        thisbox.v_container ++= static.containerWrite;
+        if (arguments[1]) {
+            thisbox.value = arguments[1];
+        }
+        
+        thisbox.datatype ++= static.datatypeWrite;
+        thisbox.selected ++= static.selectWrite;
+        thisbox.v_ready ++= static.readyWrite;
+        
     </ui:box>
     
+    /** force value put once ready */
+    static.readyWrite = function(v) {
+        cascade = v;
+        // see notes for template arguments
+        trapee.datatype = trapee.datatype;
+        if (trapee.value)
+            trapee.value = trapee.value;
+        trapee.v_settextcolor = true;
+        trapee.textcolor ++= textcolorWrite;
+    }
+    
+    /** set an arbitrary fill for this row */
+    static.textcolorWrite = function(v) {
+        cascade = v;
+        if (trapee.v_settextcolor)
+            trapee.curtextcolor = v;
+    }
+    
+    /** give appropriate visual feedback on selection and focus */
+    static.selectWrite = function(v) {
+        cascade = v;
+        if (v) {
+            trapee.v_settextcolor = false;
+            trapee.textcolor = theme.settings..textcolor_selected;
+            trapee.v_settextcolor = true;
+        } else {
+            trapee.textcolor = trapee.curtextcolor;
+        }
+    }
+    
     /** used to forward properties to v_content[0] */
     static.forwardToInner = function(v) {
         cascade = v;
@@ -26,59 +65,33 @@
         t.minheight = t.paddingtop + t.paddingbottom
             + vexi.ui.font.height(t.font, t.fontsize, "dy");
         t.padding = 2;
-        // we use an inner box for content because
-        // content may be too wide to display
-        var c = t.v_content;
-        c[0] = vexi.box;
-        c[0].shrink = true;
-        t.v_textbox = c[0];
-        c.layout = "place";
-        c.orient = "vertical";
-        c.align ++= static.forwardToInner;
-        c.orient ++= static.forwardToInner;
-        switch (t.datatype) {
+    }
+    
+    /** set up cell to handle incoming type */
+    static.datatypeWrite = function(v) {
+        cascade = v;
+        switch (trapee.datatype) {
         case "bool":
         case "boolean":
-            c.align = "center";
-            t[0].fill = theme.image.check;
-            t.selected ++= static.toggleSelectWrite;
-            t.text ++= static.toggleTextRead;
-            t.value ++= static.toggleValueWrite;
+        case "integer":
+        case "number":
+        case "numeric":
+            trapee.value ++= static.valueWrite;
             break;
         case "date":
-            c.align = "left";
-            t.selected ++= static.selectedWrite;
-            t.value ++= static.dateValueWrite;
+            trapee.value ++= static.dateValueWrite;
             break;
-        case "text":
-            c.align = "left";
-            t.selected ++= static.selectedWrite;
-            t.value ++= static.textValueWrite;
-            break;
         case "time":
-            c.align = "left";
-            t.selected ++= static.selectedWrite;
-            t.value ++= static.timeValueWrite;
+            trapee.value ++= static.timeValueWrite;
             break;
-        case "integer":
-        case "number":
-        case "numeric":
-            c.align = "right";
-            t.align = "right";
-            t.selected ++= static.selectedWrite;
-            t.value ++= static.valueWrite;
-            break;
+        case "string":
+        case "text":
         default:
-            c.align = "left";
-            t.selected ++= static.selectedWrite;
-            t.value ++= static.textValueWrite;
+            trapee.value ++= static.textValueWrite;
             break;
         }
     }
     
-    var day = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
-    var month = 
["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
-    
     /** parse incoming date and display nicely */
     static.dateValueWrite = function(v) {
         cascade = v;
@@ -87,10 +100,9 @@
             trapee.text = "";
             return;
         }
-        vexi.trace(typeof(v));
         switch (typeof(v)) {
         case "date":
-            trapee.text = v.getDate()+" "+month[v.getMonth()]+" 
"+v.getFullYear();
+            trapee.text = util.date..formatDate(v);
             break;
         case "string":
             var d = util.date..parseDate(v, "YYYYMMDD");
@@ -101,12 +113,6 @@
         }
     }
     
-    /** apply suitable effects when selected */
-    static.selectedWrite = function(v) {
-        cascade = v;
-        trapee.textcolor = v ? theme.settings..textcolor_selected : 
theme.settings..textcolor;
-    }
-    
     /** only display the first line */
     static.textValueWrite = function(v) {
         cascade = v;
@@ -128,12 +134,17 @@
     /** for time as a value */
     static.timeValueWrite = function(v) {
         cascade = v;
+        // clear empty times
+        if (!v) {
+            trapee.text = "";
+            return;
+        }
         switch (typeof(v)) {
         case "date":
             var h = v.getHours();
             var m = v.getMinutes();
             var s = v.getSeconds();
-            trapee.text = 
(10>h?"0":"")+h+":"+(10>m?"0":"")+m+":"+(10>s?"0":"")+s;
+            trapee.text = 
(10>h?"0":"")+h+":"+(10>m?"0":"")+m;//+":"+(10>s?"0":"")+s;
             break;
         case "string":
             trapee.text = v.substring(0, 5);
@@ -141,18 +152,6 @@
         }
     }
     
-    /** use highlighted check when selected */
-    static.toggleSelectWrite = function(v) {
-        cascade = v;
-        trapee[0].fill = v ? theme.image.check_highlighted : theme.image.check;
-    }
-    
-    /** return value as substitute for text */
-    static.toggleTextRead = function() { return trapee.value; }
-    
-    /** set check display to match incoming boolean */
-    static.toggleValueWrite = function(v) { cascade = v; trapee[0].display = 
v; }
-    
     /** generic value write to forward value on as text */
     static.valueWrite = function(v) { cascade = v; trapee.text = v; }
     

Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/column.t
===================================================================
--- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/column.t   
2012-07-16 03:22:26 UTC (rev 4418)
+++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/column.t   
2012-07-16 19:38:51 UTC (rev 4419)
@@ -10,24 +10,51 @@
     <tooltipable />
     <ui:box>
         
-        thisbox.holdButton = 1;
+        thisbox.pressEvent;     // from draggable
+        thisbox.holdButton = 1; // cancels normal draggable
         
         thisbox.datatype ++= static.datatypeWrite;
+        thisbox.hshrink  ++= static.hshrinkWrite;
         thisbox.size     ++= static.sizeWrite;
         thisbox.value    ++= static.valueRead;
-        thisbox.th_resizeLeft ++= static.initResize;
-        thisbox.th_resizeRight ++= static.initResize;
+        thisbox.leftResize ++= static.leftResizeWrite;
+        thisbox.rightResize ++= static.rightResizeWrite;
         
     </ui:box>
     
     static.blockPress = function(v) { return; }
     
-    static.initResize = function(v) {
+    var setTraps = function(col, tab, set) {
+        if (set) {
+            tab.cursor = "east";
+            tab.Press1 ++= static.blockPress;
+            tab.Press1 ++= col.pressEvent;
+        } else {
+            tab.cursor = null;
+            tab.Press1 --= static.blockPress;
+            tab.Press1 --= col.pressEvent;
+        }
+    }
+    
+    /** initiate resize to the left */
+    static.leftResizeWrite = function(v) {
         cascade = v;
-        trapee.Press1 ++= static.blockPress;
-        trapee.Press1 ++= trapee.pressEvent;
+        setTraps(trapee, trapee.th_resizeLeft, v);
     }
     
+    /** initiate resize to the right */
+    static.rightResizeWrite = function(v) {
+        cascade = v;
+        setTraps(trapee, trapee.th_resizeRight, v);
+    }
+    
+    /** keep resize setting in sync with hshrink */
+    static.hshrinkWrite = function(v) {
+        cascade = v;
+        if (trapee.v_head)
+            trapee.v_head.checkResize(trapee);
+    }
+    
     static.datatypeWrite = function(v) {
         cascade = v;
         switch (v) {

Added: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/foot.t
===================================================================
--- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/foot.t             
                (rev 0)
+++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/foot.t     
2012-07-16 19:38:51 UTC (rev 4419)
@@ -0,0 +1,5 @@
+<!-- Copyright 2012 - see COPYING for details [LGPL] -->
+
+<vexi xmlns:ui="vexi://ui">
+    <ui:box v_table_type="foot" />
+</vexi>

Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/head.t
===================================================================
--- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/head.t     
2012-07-16 03:22:26 UTC (rev 4418)
+++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/head.t     
2012-07-16 19:38:51 UTC (rev 4419)
@@ -7,6 +7,19 @@
     
     <ui:box>
         
+        var syncResizeTabs = function() {
+            var resizePrev = false;
+            for (var i,col in thisbox) {
+                col.resizeLeft = resizePrev;
+                col.resizeRight = !col.hshrink;
+                resizePrev = col.resizeRight;
+            }
+        }
+        
+        thisbox.checkResize = function(col) {
+            syncResizeTabs();
+        }
+        
         thisbox.Children ++= function(c) {
             if (c) {
                 c.dragStart ++= function(v) {
@@ -14,36 +27,21 @@
                     var widthL, widthR;
                     var i = indexof(c);
                     var m = c.mouse;
-                    if (3 > m.x) {
-                        if (i == 0) return;
+                    if (c.th_resizeLeft.mouse.inside) {
                         colL = thisbox[i-1];
-                        if (i != numchildren-1)
-                            colR = c;
                     }
-                    if (m.x > c.width-3) {
-                        if (i == numchildren-1) return;
+                    if (c.th_resizeRight.mouse.inside) {
                         colL = c;
-                        if (i != numchildren-2)
-                            colR = thisbox[i+1];
                     }
-                    if (colL == null) return;
                     colL.width = colL.width;
                     widthL = colL.width;
-                    if (colR) {
-                        colR.width = colR.width;
-                        widthR = colR.width;
-                    }
                     c.dragUpdate ++= function(d) {
-                        colL.width = widthL + d.x;
-                        if (colR) {
-                            colR.width = widthR - d.x;
-                        }
+                        colL.maxwidth = vexi.math.max(colL.contentwidth, 
widthL + d.x);
                     }
                 }
             }
-            if (c == null) {
-            }
             cascade = c;
+            syncResizeTabs();
         }
         
     </ui:box>

Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/row.t
===================================================================
--- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/row.t      
2012-07-16 03:22:26 UTC (rev 4418)
+++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/row.t      
2012-07-16 19:38:51 UTC (rev 4419)
@@ -1,9 +1,8 @@
-<!-- Copyright 2011 - see COPYING for details [LGPL] -->
+<!-- Copyright 2012 - see COPYING for details [LGPL] -->
 
-<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="vexi.widget.table">
-    <meta:doc>
-        <author>Charles Goodwin</author>
-    </meta:doc>
+<vexi xmlns:ui="vexi://ui"
+      xmlns:theme="vexi.theme"
+      xmlns="vexi.widget.table">
 
     <ui:box>
         
@@ -14,7 +13,7 @@
 
         thisbox.Children ++= static.childrenWrite;
         thisbox.fill     ++= static.fillWrite;
-        thisbox.rowfill  ++= static.rowfillWrite;
+        thisbox.selected ++= static.selectWrite;
         thisbox.value    ++= static.valueWrite;
         thisbox.v_head   ++= static.v_headWrite;
         
@@ -63,36 +62,38 @@
     
     /** set an arbitrary fill for this row */
     static.fillWrite = function(v) {
-        cascade = v ? v : trapee.rowfill;
-        if (trapee.v_setfill) {
+        cascade = v;
+        if (trapee.v_setfill)
             trapee.curfill = v;
-            if (trapee.selected) {
-                // selected usually alters fill
-                trapee.selected = true;
-            }
-        }
     }
     
-    /** set the default fill for this row */
-    static.rowfillWrite = function(v) {
+    /** give appropriate visual feedback on selection and focus */
+    static.selectWrite = function(v) {
         cascade = v;
-        if (!trapee.curfill and !trapee.selected) {
+        if (v) {
             trapee.v_setfill = false;
-            trapee.fill = v;
+            trapee.fill = trapee.focused
+                ? theme.settings..fill_selected
+                : theme.settings..fill_selected_unfocused;
             trapee.v_setfill = true;
+        } else {
+            trapee.fill = trapee.curfill;
         }
+        // forward selected effect to cells
+        for (var i,cell in trapee) {
+            cell.selected = v;
+        }
     }
 
 
-       static.newCellLabelFunc = function(colhead){
-               return new .cell(colhead.datatype);
+       static.newCellLabelFunc = function(col) {
+               return new .cell(col.datatype);
        };
-  
 
     /** default row value write trap */
     static.valueWrite = function(v) {
         var h = trapee.v_head;
-        if (!h) {
+        if (h == null) {
             throw "v_head must be set on a row before the row value is written 
to";
         }
         
@@ -103,10 +104,12 @@
        // assign new cells
         var n = h.numchildren;
         for (var j=0; n>j; j++) {
-            if (!trapee[j]) {
-                trapee[j] = trapee.newCellLabel(h[j]);
+            var cell = trapee[j];
+            if (cell == null) {
+                cell = trapee.newCellLabel(h[j]);
+                trapee[j] = cell;
             }
-            trapee[j].value = v?[j];
+            cell.value = v?[j];
         }
     };
     

Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/table.t
===================================================================
--- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/table.t    
2012-07-16 03:22:26 UTC (rev 4418)
+++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/table.t    
2012-07-16 19:38:51 UTC (rev 4419)
@@ -487,7 +487,6 @@
                 }
                 cascade = r;
             };
-        
         };
         
         

Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/cell.t
===================================================================
--- trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/cell.t  
2012-07-16 03:22:26 UTC (rev 4418)
+++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/cell.t  
2012-07-16 19:38:51 UTC (rev 4419)
@@ -1,10 +1,73 @@
-<!-- Copyright 2011 - see COPYING for details [LGPL] -->
+<!-- Copyright 2012 - see COPYING for details [LGPL] -->
 
-<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="org.vexi.lib.widget"
-    xmlns:theme="vexi.theme">
-    <meta:doc>
-        <author>Charles Goodwin</author>
-    </meta:doc>
+<vexi xmlns:ui="vexi://ui"
+      xmlns:theme="vexi.theme"
+      xmlns="org.vexi.lib.widget">
     
-    <cell />
+    <cell>
+        
+        thisbox.v_ready  ++= static.readyWrite;
+        thisbox.datatype ++= static.datatypeWrite;
+        
+    </cell>
+    
+    /** set up cell to handle incoming type */
+    static.readyWrite = function(v) {
+        cascade = v;
+        var t = trapee;
+        t.v_content.minheight = vexi.ui.font.height(t.font, t.fontsize, "dy");
+        t.padding = 2;
+    }
+    
+    /** set up cell to handle incoming type */
+    static.datatypeWrite = function(v) {
+        cascade = v;
+        var t = trapee;
+        var c = t.v_content;
+        // we use an inner box for content because
+        // content may be too wide to display
+        switch (t.datatype) {
+        case "bool":
+        case "boolean":
+            if (c[0] == null) {
+                c[0] = vexi.box;
+                c[0].fill = theme.image.check;
+                c[0].shrink = true;
+                c[0].display = false;
+            }
+            c.align = "center";
+            t.selected ++= static.toggleSelectWrite;
+            t.text ++= static.toggleTextRead;
+            t.text ++= static.toggleTextWrite;
+            break;
+        case "integer":
+        case "number":
+        case "numeric":
+            c.align = "right";
+            break;
+        case "date":
+        case "string":
+        case "text":
+        case "time":
+        default:
+            c.align = "left";
+            break;
+        }
+    }
+    
+    /** return value as substitute for text */
+    static.toggleTextRead = function() { return trapee.value; }
+    
+    /** set check display to match incoming boolean */
+    static.toggleTextWrite = function(v) {
+        // no cascade
+        trapee[0].display = v.toLowerCase() != "false" or v > 0;
+    }
+    
+    /** use highlighted check when selected */
+    static.toggleSelectWrite = function(v) {
+        cascade = v;
+        trapee[0].fill = v ? theme.image.check_highlighted : theme.image.check;
+    }
+    
 </vexi>

Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/column.t
===================================================================
--- trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/column.t        
2012-07-16 03:22:26 UTC (rev 4418)
+++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/column.t        
2012-07-16 19:38:51 UTC (rev 4419)
@@ -19,12 +19,12 @@
             <ui:box>
                 <ui:box id="resizeleft" width="4" cursor="east" />
                 <ui:box />
-                <ui:box id="resizeRight" width="4" cursor="east" />
+                <ui:box id="resizeright" width="4" cursor="east" />
             </ui:box>
         </ui:box>
         
-        thisbox.th_resizeLeft = $resizeLeft;
-        thisbox.th_resizeRight = $resizeRight;
+        thisbox.th_resizeLeft = $resizeleft;
+        thisbox.th_resizeRight = $resizeright;
         thisbox.th_bevel = $bevel;
         thisbox.v_init = static.init;
         

Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/foot.t
===================================================================
--- trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/foot.t  
2012-07-16 03:22:26 UTC (rev 4418)
+++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/foot.t  
2012-07-16 19:38:51 UTC (rev 4419)
@@ -1,10 +1,5 @@
-<!-- Copyright 2009 - see COPYING for details [LGPL] -->
+<!-- Copyright 2012 - see COPYING for details [LGPL] -->
 
-<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" 
xmlns="org.vexi.lib.widget">
-    <meta:doc>
-        <author>Charles Goodwin</author>
-    </meta:doc>
-    
-    <ui:box v_table_type="foot"  orient="vertical"/>
-    
+<vexi xmlns="org.vexi.lib.widget">
+    <foot orient="vertical" />
 </vexi>

Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/row.t
===================================================================
--- trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/row.t   
2012-07-16 03:22:26 UTC (rev 4418)
+++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/row.t   
2012-07-16 19:38:51 UTC (rev 4419)
@@ -1,15 +1,12 @@
-<!-- Copyright 2011 - see COPYING for details [LGPL] -->
+<!-- Copyright 2012 - see COPYING for details [LGPL] -->
 
-<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="vexi.theme"
-    xmlns:lib="org.vexi.lib.widget">
-    <meta:doc>
-        <author>Charles Goodwin</author>
-    </meta:doc>
+<vexi xmlns:ui="vexi://ui"
+      xmlns:lib="org.vexi.lib.widget"
+      xmlns="vexi.theme">
     
     <lib:row vshrink="true">
         
         thisbox.focused ++= static.focusWrite;
-        thisbox.selected ++= static.selectWrite;
         
         minheight = static.rowheight;
         
@@ -18,29 +15,10 @@
     /** let selected trap handle focused effect */
     static.focusWrite = function(v) {
         cascade = v;
-        if (trapee.selected) {
+        if (trapee.selected)
             trapee.selected = true;
-        }
     }
     
-    /** give appropriate visual feedback on selection and focus */
-    static.selectWrite = function(v) {
-        cascade = v;
-        if (v) {
-            trapee.v_setfill = false;
-            trapee.fill = trapee.focused
-                ? .settings..fill_selected
-                : .settings..fill_selected_unfocused;
-            trapee.v_setfill = true;
-        } else {
-            trapee.fill = trapee.curfill;
-        }
-        // forward selected effect to cells
-        for (var i,cell in trapee) {
-            cell.selected = v;
-        }
-    }
-    
     // the rowheight is required for dynamic tables
     static.rowheight = 6 +
         vexi.ui.font.height(vexi.ui.font.defaultstream, 
vexi.ui.fontsize.medium, "dy");

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


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to