Revision: 4261
          http://vexi.svn.sourceforge.net/vexi/?rev=4261&view=rev
Author:   mkpg2
Date:     2011-09-30 03:15:47 +0000 (Fri, 30 Sep 2011)
Log Message:
-----------
Fix. Reeinstate horizontal scrolling for tables.

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/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/table.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     
2011-09-26 02:42:19 UTC (rev 4260)
+++ trunk/org.vexi-vexi.demo/src_main/org/vexi/demo/feature/table_dynamic.t     
2011-09-30 03:15:47 UTC (rev 4261)
@@ -62,16 +62,30 @@
         <lay:pad padding="10" text="A table populated dynamically with data - 
p(i) is the 'i'th prime" vshrink="true" />
         <wi:bevel form="down">
             <table id="table" dynamic="true">
-                <head>
-                    <column text="Index" minwidth="75"/>
-                    <column text="0 - i" minwidth="75"/>
-                    <column text="i + 1" minwidth="75"/>
-                    <column text="p(i)"  minwidth="75" primes="true"/>
+                <head id="head">
+                    <column text="Index" minwidth="150"/>
+                    <column text="0 - i" minwidth="150"/>
+                    <column text="i + 1" minwidth="150"/>
+                    <column text="p(i)"  minwidth="150" primes="true"/>
                 </head>
                 <body id="body" />
+                <foot>
+                    <row id="foot">
+                        <cell text="Requested"/>
+                        <cell id="requested"/>
+                        <cell text="Calculated"/>
+                        <cell id="calculated"/>
+                    </row>
+                </foot>
             </table>
+
         </wi:bevel>
+        $foot.v_head = $head;
         
+        const max = vexi.math.max;
+        var requested = 0;
+        var calculated = 0;
+        
         var N_ROWS = 20000;
             
         var primes = static.newPrimeCalculator();      
@@ -81,12 +95,13 @@
             r.value ++= function(v) {
                 var ind = row.value?[0];
                 if (ind==null) return;
-                
+                $requested.text = requested = max(requested, ind);
                 v = primes.getImmediate(ind);
                 if (v==null) {
-                    //v = "calculating";
+                    // REMARK creating potentially a lot of threads ... only a 
demo
                     vexi.thread = function() {
                         r.value = primes.get(ind);
+                        $calculated.text = calculated = max(calculated, ind);
                     };
                 }
                 cascade = v;
@@ -130,10 +145,10 @@
         $table.fetchData = function(start, count, sortcol, sortasc) {
             var data = [count];
             var update = false;
-            /* this only works because all columns obey same order
-             * i.e. this is a cheap example since typical usage of
-             * dynamic tables will be to grab data from a source
-             * that will handle any sorting */
+            //  this only works because all columns obey same order
+            //  i.e. this is a cheap example since typical usage of
+            //  dynamic tables will be to grab data from a source
+            //  that will handle any sorting 
             if (sortcol == 1) sortasc = !sortasc;
             if (sortcol == null) sortasc = true;
             for (var i=0; count>i; i++) {

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      
2011-09-26 02:42:19 UTC (rev 4260)
+++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/row.t      
2011-09-30 03:15:47 UTC (rev 4261)
@@ -55,7 +55,7 @@
             c.v_head = h;
             c.hshrink = h?.hshrink;
             c.display = h?.display;
-            c.minwidth = h?.contentwidth;
+            c.minwidth = h?.minwidth; //h?.contentwidth;
             c.maxwidth = h?.maxwidth;
         }
     }

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    
2011-09-26 02:42:19 UTC (rev 4260)
+++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/table.t    
2011-09-30 03:15:47 UTC (rev 4261)
@@ -308,7 +308,12 @@
             fakeviewport = static.new_fakeviewport();
             realviewport = th_bodyport;
             realviewport.shrink = false;
-            realviewport[0].shrink = false;
+            
+            fakeviewport[0].x  ++= function(v){
+                cascade = v;
+                realviewport[0].x = v;
+            };
+            
             th_viewport = fakeviewport;
             th_bodyport = fakeviewport;
             th_bodyview = fakeviewport[0];

Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/table.t
===================================================================
--- trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/table.t 
2011-09-26 02:42:19 UTC (rev 4260)
+++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/table.t 
2011-09-30 03:15:47 UTC (rev 4261)
@@ -27,7 +27,7 @@
             <scrollbar id="vscroll" orient="vertical" />
         </ui:box>
         
-        <ui:box vshrink="true">
+        <ui:box id="footpart" vshrink="true">
             <ui:box id="footport" align="topleft" height="0" layout="place">
                 <ui:box id="footview" vshrink="true" />
                 $footview.height ++= function(v) { height = v; cascade = v; }
@@ -43,6 +43,15 @@
         // HACK really should be controlled by existence of body element 
         thisbox.displayBodyPart ++= function(v){
             $bodypart.display = v;
+            if(!v){
+                // HACK force body dimensions for scroll bar
+                   $footport.width ++= function(v){
+                       cascade = v;
+                       $bodyport.width = v; 
+                       $bodyview.width = $footview.width; 
+                };
+                   
+            }
             vshrink = !v;
         };
         
@@ -70,12 +79,18 @@
             $bodyport.width ++= function(w) {               
                 cascade = w;
                 th_bodyport.width = w;
-                th_bodyview.width = w; // do we need this?
             }
             // fakeview port created during cascade
             cascade = f;
             $vscroll.viewport = th_bodyport;
             $hscroll.viewport = th_bodyport;
+            
+            
+            th_bodyview.width = $headview.width;
+            $headview.width ++= function(w){
+                cascade = v;
+                th_bodyview.width = w;
+            };
         };
         
         // init fetchData==null

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


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to