DirectScrolledFrame scrollbar and mouse wheel

I have two things I need to port to Panda3d from a game. One is being able to scroll in a DirectScrolledFrame (where horizontal buttons and scrollbar are disabled). I could of course use base.accept and change the ‘verticalScroll_value’, but how can I tell Panda to use the keys for scrolling only when the mouse cursor is inside the frame’s canvas?

Another thing I need to do is to not be able to move the scrollbar in any location I want, but only to allow it to be in for example one of this locations only: (0.0,0.2,0.4,0.6,0.8,1.0)
I hope you understand, I can’t explain this very well. Think of it like this: in some GUIs you have scrollbars which when clicked, don’t smoothly slide, after you move it a certain amount they quickly “jump” to a new position.

Here is an example of what I mean.

(left mouse button held down)

I don’t think the DirectScrollBar object supports this kind of interaction at the moment.

This means you have two choices: (a) extend the DirectScrollBar to have the required interfaces (this means modifying the underlying C++ PGSliderBar object), or (b) implement a new kind of scroll bar yourself, entirely in Python, by hiding the existing scroll bars and creating the appropriate geometry yourself.


I suppose I could try to make one myself. I’m not entirely sure how though. Thoughts?
The main problem are our GUI canvas images. They cannot be scrolled. When you click up or down the buttons assigned to the canvas move in such amount that the top ones appear in the exact same place as the bottom ones before, so it gives the illusion that the canvas has moved as well, but if I’ll allow scrollbars to move it in any amount you specify, then you will see the buttons moving, but the background canvas staying in the same place, which will look weird.
Unfortunately I cannot change the original art, we are just porting the game, and the “canvas” in the image is part of other things (changing texture wrap mode won’t work).