Subversion Repositories Applications.papyrus

Rev

Go to most recent revision | Details | 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
 
11
dojo.provide("dojo.widget.IntegerTextbox");
12
dojo.require("dojo.widget.ValidationTextbox");
13
dojo.require("dojo.validate.common");
14
dojo.widget.defineWidget("dojo.widget.IntegerTextbox", dojo.widget.ValidationTextbox, {mixInProperties:function (localProperties, frag) {
15
	dojo.widget.IntegerTextbox.superclass.mixInProperties.apply(this, arguments);
16
	if ((localProperties.signed == "true") || (localProperties.signed == "always")) {
17
		this.flags.signed = true;
18
	} else {
19
		if ((localProperties.signed == "false") || (localProperties.signed == "never")) {
20
			this.flags.signed = false;
21
			this.flags.min = 0;
22
		} else {
23
			this.flags.signed = [true, false];
24
		}
25
	}
26
	if (localProperties.separator) {
27
		this.flags.separator = localProperties.separator;
28
	}
29
	if (localProperties.min) {
30
		this.flags.min = parseInt(localProperties.min);
31
	}
32
	if (localProperties.max) {
33
		this.flags.max = parseInt(localProperties.max);
34
	}
35
}, isValid:function () {
36
	return dojo.validate.isInteger(this.textbox.value, this.flags);
37
}, isInRange:function () {
38
	return dojo.validate.isInRange(this.textbox.value, this.flags);
39
}});
40