So I am going down a rabbithole and I know there must be a better way.
I am trying to combine a SpinBox with a HSlider, I basically want to be able to drag left and right to change the value and I want to change the background of the SpinBox to show where the value is much like with a HSlider. I also want drag and the buttons to round to a certain step size but to be able to type in numbers with more precision. Is there a way to do that without essentially rewriting the spinbox control? Also the step size should change dynamically but I can just have a listener update it on each value change.
To make the progress bar look work I'd have to override draw right and then draw the whole thing? Setting the step size dynamicaly while draging is easy enough, but how do I make that work with the buttons? I am sure there must be an easier solution I am not thinking off, and that someone has run into the same problem before me.
Also I'd like it to be smart about units which I can handle with a suffix (like kg, ton, g etc) but how to handle user entry of the suffix if they change it? At the moment the suffix disapears while editing, and I'd have to do some clamping of values and some trickery to change the display sensibly like switching from 1000kg to 1 ton, the internal value would still be 1000, so I'd need to fully divorce the displayed value from the actual internal game value. So while I am at is is there an easier way to handle that or is the maintaining a game value and a displayed value the best approach?