Closed Elius94 closed 1 year ago
Yes, the change of every widget constructor with only one props configuration object is in my plans and it should increment the version to a new major release because of the incompatibility that it will cause. I'm considerin go do it in the next weeks. For now, you can ad the increment value as a class property with setter and getter methods. So if you want to change the default increment you have to use theese methods.
And, just to be clear what function will the increment property serve? For example, if I create a new ProgressBar
and set the *increment value to 10. So, calling some kind of incrementValue
method would change the progress percentage by 10 and render it to the screen?
It will be usefull for interactions with the mouse wheel
if (event.name === "MOUSE_WHEEL_DOWN") {
if (this.value > this.min + 1) {
this.value -= 1 // this is the hardcoded increment
} else {
this.value = this.min
}
this.emit("valueChanged", this.value)
this.update()
}
if (event.name === "MOUSE_WHEEL_UP") {
if (this.value < this.max - 1) {
this.value += 1 // this is the hardcoded increment
} else {
this.value = this.max
}
this.emit("valueChanged", this.value)
this.update()
}
This also when will be developed the arrows, on the key listeners. Thanks man
Thanks to @h-sifat 🙏
@h-sifat feel Thank you for your help! Feel free to propose changes for other things as well. I saw that you use nice and correct syntax, if you feel like, you can for example check for flaws or errors in my code and propose stylistic changes. Thank you, best regards
Sir, sorry to bother you again. Could you kindly elaborate the feature a little bit? What do you mean by at every input change specifically? Is it just an invocation of the
setValue(value)
method? Do we need to add newincrementValue()/decrementValue()
method?IMHO, despite good documentation, the constructor signature already seems complex enough with multiple optional parameters. Why don't we just use a single object as the argument. For example:
The previous one is much more clean and scalable than the current implementation. But if you don't want to change the API then should I just add the increment parameter at the end as an optional one?
Thank you.