Changeset 196:9930e7d487d8 for source
- Timestamp:
- Feb 2, 2011, 8:02:47 PM (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/class/pf/ui/TextField.js
r146 r196 4 4 extend: qx.ui.form.TextField, 5 5 6 construct: function(v) { 7 this.base(arguments, pf.util.Format.numPrint(v)); 6 construct: function(v, f) { 7 if (typeof f != "undefined" && (f = parseFloat(f)) != 0.0) { 8 this._f = f; 9 } 10 11 this.base(arguments, pf.util.Format.numPrint(this._f*v)); 8 12 }, 9 13 10 14 members: 11 15 { 16 _f : 1.0, 17 18 setNumConvFactor: function(f) 19 { 20 this._f = parseFloat(f); 21 }, 22 12 23 setNumValue: function(v) 13 24 { 14 this.setValue(pf.util.Format.numPrint(v)); 25 if (typeof v != "undefined") { 26 this.setValue(pf.util.Format.numPrint(this._f*v)); 27 } else { 28 this.setValue(""); 29 } 15 30 }, 16 31 17 32 getNumValue: function() 18 33 { 19 return parseFloat(this.getValue()) ;34 return parseFloat(this.getValue())/this._f; 20 35 } 21 36 }
Note: See TracChangeset
for help on using the changeset viewer.