Subversion Repositories Applications.papyrus

Rev

Rev 1372 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1318 alexandre_ 1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
4
 
5
	Licensed under the Academic Free License version 2.1 or above OR the
6
	modified BSD license. For more information on Dojo licensing, see:
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
10
 
1422 alexandre_ 11
 
12
 
1318 alexandre_ 13
dojo.provide("dojo.widget.RealNumberTextbox");
14
dojo.require("dojo.widget.IntegerTextbox");
15
dojo.require("dojo.validate.common");
16
dojo.widget.defineWidget("dojo.widget.RealNumberTextbox", dojo.widget.IntegerTextbox, {mixInProperties:function (localProperties, frag) {
17
	dojo.widget.RealNumberTextbox.superclass.mixInProperties.apply(this, arguments);
18
	if (localProperties.places) {
19
		this.flags.places = Number(localProperties.places);
20
	}
21
	if ((localProperties.exponent == "true") || (localProperties.exponent == "always")) {
22
		this.flags.exponent = true;
23
	} else {
24
		if ((localProperties.exponent == "false") || (localProperties.exponent == "never")) {
25
			this.flags.exponent = false;
26
		} else {
27
			this.flags.exponent = [true, false];
28
		}
29
	}
30
	if ((localProperties.esigned == "true") || (localProperties.esigned == "always")) {
31
		this.flags.eSigned = true;
32
	} else {
33
		if ((localProperties.esigned == "false") || (localProperties.esigned == "never")) {
34
			this.flags.eSigned = false;
35
		} else {
36
			this.flags.eSigned = [true, false];
37
		}
38
	}
39
	if (localProperties.min) {
40
		this.flags.min = parseFloat(localProperties.min);
41
	}
42
	if (localProperties.max) {
43
		this.flags.max = parseFloat(localProperties.max);
44
	}
45
}, isValid:function () {
46
	return dojo.validate.isRealNumber(this.textbox.value, this.flags);
47
}, isInRange:function () {
48
	return dojo.validate.isInRange(this.textbox.value, this.flags);
49
}});
50