Revision: 4549
          http://sourceforge.net/p/vexi/code/4549
Author:   mkpg2
Date:     2013-09-07 00:11:07 +0000 (Sat, 07 Sep 2013)
Log Message:
-----------
Improve Number Field. Do not accept . if fractional values not allowed (i.e. 
scale<=0).

Modified Paths:
--------------
    branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/numfield.t
    branches/vexi3/org.vexi-vexi.widgets/src_main/vexi/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    
    2013-08-30 21:37:49 UTC (rev 4548)
+++ 
branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/widget/numfield.t    
    2013-09-07 00:11:07 UTC (rev 4549)
@@ -125,12 +125,14 @@
             return;
         }
         case ".": {
-            var cpos = e.getCursorCharIndex();
-            cascade = v;
-            // If invalid revert ...        
-            if(e.text.indexOf(".")!=e.text.lastIndexOf(".")){
-                e.text = txt0;
-                e.setCursorCharIndex(cpos);
+            if(t.scale==null || t.scale>0){
+                   var cpos = e.getCursorCharIndex();
+                   cascade = v;
+                   // If invalid revert ...        
+                   if(e.text.indexOf(".")!=e.text.lastIndexOf(".")){
+                       e.text = txt0;
+                       e.setCursorCharIndex(cpos);
+                   }
             }
             return;
         }

Modified: branches/vexi3/org.vexi-vexi.widgets/src_main/vexi/widget/numfield.t
===================================================================
--- branches/vexi3/org.vexi-vexi.widgets/src_main/vexi/widget/numfield.t        
2013-08-30 21:37:49 UTC (rev 4548)
+++ branches/vexi3/org.vexi-vexi.widgets/src_main/vexi/widget/numfield.t        
2013-09-07 00:11:07 UTC (rev 4549)
@@ -2,22 +2,6 @@
 
 <vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns:theme="vexi.theme"
     xmlns="org.vexi.lib.layout">
-    <meta:doc>
-        <author>Charles Goodwin</author>
-        <name>Textfield</name>
-        <desc>An editable single-line textfield</desc>
-        <usage>
-            Has the following specific properties:
-            - enabled   (boolean)
-                If set to false, users can not edit the content
-            - maxlength (int)
-                Prevents the textfield content growing longer than
-                maxlength
-            - password  (boolean)
-                A passworded textfield obscures the input text as *s
-                Read 'value' to get the password from the textfield
-        </usage>
-    </meta:doc>
     
     <margin />
     <theme:numfield />

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       
2013-08-30 21:37:49 UTC (rev 4548)
+++ branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/numfield.t       
2013-09-07 00:11:07 UTC (rev 4549)
@@ -4,14 +4,17 @@
     <w:surface />
     <ui:box orient="vertical">
         <ui:box shrink="true">
-            <w:check id="three_dp" text="3dp"/>
+            <ui:Box text="scale"/>
+            <w:numfield id="scale"  scale="0" width="80"/>            
+        </ui:box>
+        <ui:box shrink="true">
             <w:check id="positive" text="positive"/>
             <w:check id="maximum" text="max==100"/>
         </ui:box>
         <w:numfield id="numfield" />
-        $three_dp.selected ++= function(v) {
+        $scale.value ++= function(v) {
             cascade = v;
-            $numfield.scale = v?3:null;
+            $numfield.scale = v;
         };
         
         $positive.selected ++= function(v) {

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


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to