MexUI stuff

This commit is contained in:
Vortrex
2022-05-15 22:26:31 -05:00
parent c81f511448
commit 4b7f05a482
42 changed files with 423 additions and 398 deletions

View File

@@ -1,7 +1,7 @@
mexui.util.createControlConstructor('RangedNumber', false, function(window, x, y, w, h, min, max, text, styles, callback)
{
mexui.Control.TextInput.call(this, window, x, y, w, h, text, this.linkControlStyles('RangedNumber', styles), callback, false, false);
this.min = min === undefined ? 0.0 : min;
this.max = max === undefined ? 100.0 : max;
});
@@ -18,7 +18,7 @@ mexui.Control.RangedNumber.prototype.validateValueCallback = function(e)
var text = this.getText();
if(!mexui.util.isFloat(text))
return false;
var number = parseFloat(text);
return number >= this.min && number <= this.max;
};