Revision: 4134
          http://vexi.svn.sourceforge.net/vexi/?rev=4134&view=rev
Author:   clrg
Date:     2011-05-13 00:37:42 +0000 (Fri, 13 May 2011)

Log Message:
-----------
Retraction: do not track valuetype - just allow user to set it
Fix. Do not put "today" to value on up/down button presses with empty values

Modified Paths:
--------------
    trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/datefield.t
    trunk/org.vexi-vexi.widgets/src_test/test/widget/datefield.t

Modified: 
trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/datefield.t
===================================================================
--- trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/datefield.t     
2011-05-13 00:26:21 UTC (rev 4133)
+++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/datefield.t     
2011-05-13 00:37:42 UTC (rev 4134)
@@ -88,9 +88,14 @@
         $month.Press1 ++= selectPart;
         $year.Press1  ++= selectPart;
         
+        var setToday = function() {
+            date = vexi.date();
+            value = value;
+        }
+        
         $more.action ++= function(v) {
             if (year == null) {
-                value = "today";
+                setToday();
             } else if (selected == $day) {
                 if (month==null) {
                     month = 1;
@@ -106,7 +111,7 @@
         
         $less.action ++= function(v) {
             if (year == null) {
-                value = "today";
+                setToday();
             } else if (selected == $day) {
                 if (month==null) {
                     month = 12;
@@ -239,9 +244,10 @@
                     break;
                 case "enter":
                     if (value==null) {
-                        date = vexi.date();
+                        setToday();
+                    } else {
+                        value = value;
                     }
-                    value = value;
                     break;
                 case "back_space":
                 case "delete":
@@ -386,7 +392,6 @@
     
     static.valueWrite = function(v) {
         if (v == "") {
-            trapee.valuetype = "string";
             v = null;
         }
         switch (typeof(v)) {
@@ -399,15 +404,12 @@
                 trapee.month = trapee.month;
                 trapee.year = trapee.year;
             }
-            trapee.valuetype = "vexi.util.date";
             break;
         case "date":
             trapee.date = v;
-            trapee.valuetype = "vexi.date";
             break;
         case "number":
             trapee.date = vexi.date(v);
-            trapee.valuetype = "number";
             break;
         case "null":
             trapee.day = null;
@@ -422,7 +424,6 @@
             } else {
                 trapee.parseDate(v, trapee.valueformat, trapee);
             }
-            trapee.valuetype = "string";
             break;
         default:
             throw "unsupported value type for datefield: '"+typeof(v)+"'";

Modified: trunk/org.vexi-vexi.widgets/src_test/test/widget/datefield.t
===================================================================
--- trunk/org.vexi-vexi.widgets/src_test/test/widget/datefield.t        
2011-05-13 00:26:21 UTC (rev 4133)
+++ trunk/org.vexi-vexi.widgets/src_test/test/widget/datefield.t        
2011-05-13 00:37:42 UTC (rev 4134)
@@ -46,8 +46,7 @@
     suite.test_blank_write_on_enter = function() {
         var b = new .datefield();
         var putval;
-        b.value ++= function(v) { cascade = v; 
-        vexi.trace(v); putval = v; }
+        b.value ++= function(v) { cascade = v; putval = v; }
         b.KeyPressed = "enter";
         assertTrue(putval!="today");
         assertNotNull(putval);
@@ -56,10 +55,10 @@
     suite.test_blank_write_on_enter_date_valuetype = function() {
         var b = new .datefield();
         var putval;
-        b.value ++= function(v) { cascade = v; 
-        vexi.trace(v); putval = v; }
+        b.valuetype = "vexi.util.date";
+        b.value ++= function(v) { putval = v; }
         b.KeyPressed = "enter";
-        assertTrue(putval!="today");
+        assertTrue(typeof(putval)!="string");
         assertNotNull(putval);
     };
     


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

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to