Scrollbar's thumb start position & lenght

Scrollbar class has its own methods to get those values respect its range limits. But I need to know their start position and lenght in the component, that’s the private variables thumbStart and thumbSize. How could I know them?

The reason I’m asking about this is that I need that once MouseUp get called it must return the mouse cursor to the original position in the thumb, where it was clicked before move it.


The lookandfeel class is probably the place to look.

Uhmmm I’m still unable to see it. My LookAndFeel class is a singleton instance and I have multiple (and inherited) scrollbars.

  • If I create an struct with scrollbar data in my LookAndFeel class, all the scrollbars that call to the drawScrollbar function would share the same member variable - it could be dangerous because all of them would overwrite the struct’s data.

  • If I make the struct in the inherited scroll bar class I must call an updateData(…) method from the drawScrollbar, unfortunately updateData() isn’t a funcion of ScrollBar, so I cannot do something like: scrollbar.updateData(x, y, witdht…)

Please, any extra tip?