Revision: 4814
          http://sourceforge.net/p/vexi/code/4814
Author:   mkpg2
Date:     2015-09-12 20:20:45 +0000 (Sat, 12 Sep 2015)
Log Message:
-----------
vexi.widget.numfield - support minDP and maxDP properties

Modified Paths:
--------------
    branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/numfield.t
    branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/numfield.t

Modified: 
branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/numfield.t
===================================================================
--- 
branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/numfield.t    
    2015-08-31 22:59:34 UTC (rev 4813)
+++ 
branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/numfield.t    
    2015-09-12 20:20:45 UTC (rev 4814)
@@ -21,8 +21,9 @@
         
         thisbox.scale;     // if positive, number of decimal places
                            // if negative, number of trailing 0s
+        thisbox.minDP;
+        thisbox.maxDP;
         
-        
         KeyPressed ++= static.keypressEvent;
         scale      ++= static.scale;
         maxvalue   ++= static.limitvalueWrite;
@@ -71,7 +72,9 @@
         
         thisbox.decimal2text= function(d) {
                if (d==null) return "";
-               return d.toDecimalString(scale);
+               const minDP = thisbox.minDP==null?scale:thisbox.minDP;
+               const maxDP = thisbox.maxDP==null?scale:thisbox.maxDP;          
+               return d.toDecimalString(minDP, maxDP);
            }
         
     </ui:box>

Modified: branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/numfield.t
===================================================================
--- branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/numfield.t       
2015-08-31 22:59:34 UTC (rev 4813)
+++ branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/numfield.t       
2015-09-12 20:20:45 UTC (rev 4814)
@@ -6,6 +6,10 @@
         <ui:box shrink="true">
             <ui:Box text="scale"/>
             <w:numfield id="scale"  scale="0" width="80"/>            
+            <ui:Box text="minDP"/>
+            <w:numfield id="minDP"  scale="0" width="80"/>            
+            <ui:Box text="maxDP"/>
+            <w:numfield id="maxDP"  scale="0" width="80"/>            
         </ui:box>
         <ui:box shrink="true">
             <w:check id="positive" text="positive"/>
@@ -17,6 +21,16 @@
             $numfield.scale = v;
         };
         
+        $minDP.value ++= function(v) {
+            cascade = v;
+            $numfield.minDP = v;
+        };
+        
+        $maxDP.value ++= function(v) {
+            cascade = v;
+            $numfield.maxDP = v;
+        };
+        
         $positive.selected ++= function(v) {
             cascade = v;
             $numfield.minvalue = v?0:null;

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


------------------------------------------------------------------------------
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to