I noticed that the look and feel isn’t set on the PopupMenu in MenuBarComponent::showMenu method. Shouldn’t this be just like the ComboBox::showPopup() method?
[code]PopupMenu menu;
menu.setLookAndFeel (&getLookAndFeel());[/code]
or are we supposed to set this ourselves in our version of
MenuBarModel::getMenuForIndex when creating the menu?
I guess setting this in MainEditorComponent::getMenuForIndex is more flexible because you can have different looks for different top level indices. Don’t know why I would need that, but it might come in handy one day I suppose.
I think you’re right - it should inherit from the menubar. But I guess you might want to override it too, so it could do this, in juce_MenuBarComponent.cpp, 223:
[code] PopupMenu m (model->getMenuForIndex (itemUnderMouse,
menuNames [itemUnderMouse]));
if (m.lookAndFeel == 0)
m.setLookAndFeel (&getLookAndFeel());
I think I found another one that might need this in TableHeaderComponent::showColumnChooserMenu.
[code]void TableHeaderComponent::showColumnChooserMenu (const int columnIdClicked)
{
PopupMenu m;
addMenuItems (m, columnIdClicked);
if (m.getNumItems() > 0)
{
if (m.lookAndFeel == 0)
m.setLookAndFeel (&getLookAndFeel());
const int result = m.show();
if (result != 0)
reactToMenuItem (result, columnIdClicked);
}
Doesn’t really feel like something that belongs in the Label… I don’t want to fill the label class with copies of all of TextEditor’s methods. Not sure of a better suggestion for you though…