Quote from: Kvaz1r on 10 September 2019, 18:21:35Quote from: Ahnne Cognita on 10 September 2019, 14:49:44There isn't any way to set custom validator to the control and check anything before changing. At least now, because it's really useful.
In my project, there's a situation where I need to do some validation before allowing the scrollbar's value to actually change. Currently, I'm using the Value Changed signal to begin the validation, but I haven't been able to find a way to force the scrollbar back to it's old value without triggering another Value Changed event.
But I think you can bind your check to something else and make scrollbar disabled so one can't change it while state will not state as correct.
Is it possible to bind to the underlying up/down button presses? I'm unable to disable the scrollbar entirely since the validation may only prevent one direction ie, still able to click/drag in the opposite. I could just use regular buttons and avoid the problem altogether.
Quote from: texus on 10 September 2019, 18:33:09
I actually added a way to temporarily disable a signal some time ago just for this kind of situation.Code (cpp) Selectscrollbar->onValueChange.setEnabled(false);
scrollbar->setValue(...);
scrollbar->onValueChange.setEnabled(true);
Oh. Well that sounds wonderful. Thanks!