I would like to add one more property called 'stepValue' in this class,
then it would cover the the need of QxSlider and QxProgressBar,
including QxSpinner as from before, I am finishing up right now.
Proposed name changes being more universal:
min -> startValue
max -> endValue
the reason is stepping in both directions with a positive or negative
step value
Attaching proposed changes as a diff.
Kent
Index: QxRangeManager.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/managers/QxRangeManager.js,v
retrieving revision 1.4
diff -u -r1.4 QxRangeManager.js
--- QxRangeManager.js 17 Feb 2006 20:42:45 -0000 1.4
+++ QxRangeManager.js 25 Feb 2006 15:50:34 -0000
@@ -38,13 +38,14 @@
QxRangeManager.extend(QxManager, "QxRangeManager");
QxRangeManager.addProperty({ name : "value", type : QxConst.TYPEOF_NUMBER, defaultValue : 0 });
-QxRangeManager.addProperty({ name : "min", type : QxConst.TYPEOF_NUMBER, defaultValue : 0 });
-QxRangeManager.addProperty({ name : "max", type : QxConst.TYPEOF_NUMBER, defaultValue : 100 });
+QxRangeManager.addProperty({ name : "startValue", type : QxConst.TYPEOF_NUMBER, defaultValue : 0 });
+QxRangeManager.addProperty({ name : "endValue", type : QxConst.TYPEOF_NUMBER, defaultValue : 100 });
+QxRangeManager.addProperty({ name : "stepValue", type : QxConst.TYPEOF_NUMBER, defaultValue : 1 });
QxRangeManager.CHANGE_EVENTTYPE = QxConst.INTERNAL_CHANGE;
proto._checkValue = function(propValue) {
- return Math.max(this.getMin(), Math.min(this.getMax(), Math.floor(propValue)));
+ return Math.max(this.getStartValue(), Math.min(this.getEndValue(), Math.floor(propValue)));
};
proto._modifyValue = function(propValue, propOldValue, propData)
@@ -56,11 +57,11 @@
return true;
};
-proto._checkMax = function(propValue) {
+proto._checkEndValue = function(propValue) {
return Math.floor(propValue);
};
-proto._modifyMax = function(propValue, propOldValue, propData)
+proto._modifyEndValue = function(propValue, propOldValue, propData)
{
this.setValue(Math.min(this.getValue(), propValue));
@@ -71,11 +72,11 @@
return true;
};
-proto._checkMin = function(propValue) {
+proto._checkStartValue = function(propValue) {
return Math.floor(propValue);
};
-proto._modifyMin = function(propValue, propOldValue, propData)
+proto._modifyStartValue = function(propValue, propOldValue, propData)
{
this.setValue(Math.max(this.getValue(), propValue));
@@ -85,3 +86,16 @@
return true;
};
+
+proto._checkStepValue = function(propValue) {
+ return Math.floor(propValue);
+};
+
+proto._modifyStepValue = function(propValue, propOldValue, propData)
+{
+ if (this.hasEventListeners(QxRangeManager.CHANGE_EVENTTYPE)) {
+ this.dispatchEvent(new QxEvent(QxRangeManager.CHANGE_EVENTTYPE), true);
+ };
+
+ return true;
+};