wxScrollbar with label over scroll component

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
gasko
In need of some credit
In need of some credit
Posts: 6
Joined: Mon Apr 13, 2020 11:14 am

wxScrollbar with label over scroll component

Post by gasko » Wed Oct 14, 2020 12:24 pm

I would like to use a wxScrollbar similar to a wxSlider, except that I would like to display the "value" of the scrollbar on top of the actual grey rectangle that the user clicks on and drags to scroll left and right. The text value will most likely be a simple number such as "15".

Are there any built-in functions/controls capable of this? If not, how can I implement it in wxWidgets?

On a side note, how would I make this component handle floating pointing values instead of integers? Is that possible or would I have to do that manually?

Thanks!

User avatar
doublemax
Moderator
Moderator
Posts: 15283
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxScrollbar with label over scroll component

Post by doublemax » Wed Oct 14, 2020 3:43 pm

Are there any built-in functions/controls capable of this?
No.
If not, how can I implement it in wxWidgets?
As wxWidgets uses native controls where ever possible, scollbars are native, too. It's not easily possible to draw anything on top of a native control.

The only option i see is to write a 100% custom drawn component that does the same as a scrollbar.
Use the source, Luke!

Post Reply