PopupMenu, MenuBar, and Menus, oh my!

  1. It seems that changing the appearance of popup menus by changing colors in the LookAndFeel also changes the MenuBarComponent if it is attached

  2. drawPopupMenuBackground() hard codes the stripe color (Colour (0x2badd8e6)) so no way to change it via setColour()?

  3. Is there a way to get native menus, similar to native title bars? I don’t see it…

  4. How do I get the Windows accelerators to work for example “File” underlining the ‘F’ and having the menu pop when I press ALT+F ?

  5. When I press ALT the menu bar doesn’t get the keyboard focus so I can navigate using keys?

Just want to make sure this is by design so I don’t keep searching

These aren’t Windows menus - I’ve not tried to copy any of that alt-key/underlining stuff, and no, there aren’t any native menus except on the mac, where it’s kind of essential.

As for the lookandfeel, at the moment it kind of does whatever it does. I’ve got plans to revamp the whole thing, so don’t really want to spend any time tweaking it in its current state.

TheVinn just asked a question I’d planned to post some time ago (but more urgent stuff had to be fixed first)

I know absolutely nothing about MAC and MAC Gui so the juce-menu look and feel might very well be right here, but for both Windows and Linux (ubuntu) I think especially the “feel” is a bit awkward. In general I tend to make my programs so I can operate it using only the keyboard. I haven’t found the right path yet with juce - unless of course you remember all the shortcuts added to the menu items.

So Jules her from me a call to put focus at this topic (you asked yourself in some other thread for improvement areas :smiley: )

A bit off-topic:
Have you ever thought of adding some kind of feature vote page. See e.g http://feedback.codecollab.com/forums/4652-code-collaborator-features

There are two ways of doing this, one is to emulate the native menus under Windows, adding all the code for giving the menu bar keyboard focus and what not.

The other way is to have native menu bar support, the way that Juce offers native title bars.

Both of the solutions would require considerable effort. In theory you might be able to subclass the win32 ComponentPeer and create your derived version, overriding Component:createNewPeer(), to get a native menu working.

I doubt there is a tremendous amount of interest in native title bar support but if we could get some of the member access qualifiers (public, private, protected) adjusted, put the Win32 ComponentPeer in its own header file for subclassing, and refactor the routines that perform the window creation, then that would be a nice compromise since this way we could roll our own native menus cleanly and Jules doesn’t have to get his hands dirty with a bunch of windows-specific crap.

Sorry, I can’t task-switch to think about this (or a lot of the issues you’ve been raising in the last couple of days)… I’m deep into coding the the new jucer at the moment, which is so complicated that I can’t quite fit it all in my brain at once, and have no room for distractions. Important bugs: ok, let me know, but feature-requests will have to wait!

The most recent check-in has a new function DocumentWindow::setMenuBarComponent() so if you want to write your own menu bar that closely resembles the Windows or Linux menu bars, you can write your own Component or MenuBarComponent-derived class and set that on the DocumentWindow.

If you do end up writing something that looks and feels like Windows menus…feel free to share!