Is it possible to make a long menu scrollable with the mouse wheel

I have a cross-platform project which contains non-menubar menus (i.e., they are popped up with a mouse click) which can, in some cases, be longer than the screen height. Is there a way to make the mouse wheel scroll the menu?

This might be OS-specific, as the Mac popupmenus and MenuItem.popup will scroll when the mouse’s scrollwheel is used.

Right. That’s why I posted in the Windows target channel. While popupmenus do scroll on the Windows build, I’m hoping to get the Windows menu to behave the same way as the Windows popupmenu and the Mac menu do.

Sorry didn’t notice that. There has been some discussion about the scrollwheel on windows, as currently it will only scroll for the focused control, and not for the control the mouse pointer is over. If there is a way for the menu to gain actual focus then the scrollwheel should work with it.

That’s an interesting thought. I would have guessed that a menu does have focus when it is popped up, but maybe not.

Thanks.

I just tried a small project on Windows 7. As long as the popup menu has the focus, which it does if the control has been clicked, the scroll wheel seems to scroll the menu just fine. If the menu does not have the focus, you could use the MouseEnter event to give it the focus without the mouse click but that won’t drop the menu; rather it will scroll the menuitems in place.

My test ws compiled on and for Windows. If you are compiling on a different platform but targeted for Windows, the problem might be there.

Thanks so much for taking the time to test it, Dale.

It sounds like your test was with a popupmenu control? I don’t have the problem with a popupmenu (which works as I want), but rather with an instance of the menuItem class (e.g., as in a contextual menu).

My mistake. You’re right, the scrollwheel does not work with contextual menus on Windows.

Unfortunately, I’m using a third party set of classes which I bought specifically so as not to have to re-invent some wheels. The developer uses menus rather than popupmenus. Changing the implementation will take more time than I have right now, so I was hoping for an easy solution. At least typing a character will move the menu to its first occurrence in the list, so getting to “Z” in a very long list can still be reasonably quick…

Thanks again for your time…