Closed damiensellier closed 1 week ago
SEE CtrlrEditorApplicationCommandsMenus.cpp L232
https://github.com/damiensellier/CtrlrX/blob/d1052344ce5a9768e9d3ea75e3a15b8203920ce9/Source/UIComponents/CtrlrApplicationWindow/CtrlrEditorApplicationCommandsMenus.cpp#L232 :
else if ((!isRestricted() && (topLevelMenuIndex == MenuTools)) || (isRestricted() && (topLevelMenuIndex == (hideProgramsMenu ? (MenuRestrictedTools - 1) : MenuRestrictedTools)))) // Tools
{
menu.addCommandItem (commandManager, showMidiMonitor);
menu.addCommandItem (commandManager, showMidiCalculator);
menu.addCommandItem (commandManager, showLogViewer);
menu.addCommandItem (commandManager, showComparatorTables);
if(!isRestricted())
{
menu.addCommandItem(commandManager, doRegisterExtension);
menu.addCommandItem(commandManager, doKeyGenerator);
}
}
CtrlrEditor.cpp L134 :
hideProgramsMenu
if (isRestricted() && owner.getActivePanel())
{
hideProgramsMenu = owner.getActivePanel()->getEditor()->getProperty(Ids::uiPanelProgramsMenuHideOnExport);
hideMidiControllerMenu = owner.getActivePanel()->getEditor()->getProperty(Ids::uiPanelMidiControllerMenuHideOnExport);
hideMidiThruMenu = owner.getActivePanel()->getEditor()->getProperty(Ids::uiPanelMidiThruMenuHideOnExport);
hideMidiChannelMenu = owner.getActivePanel()->getEditor()->getProperty(Ids::uiPanelMidiChannelMenuHideOnExport);
}
SEE : CtrlrMidiMon.cpp
StringArray CtrlrMIDIMon::getMenuBarNames()
{
const char* const names[] = { "File", "View", "Filter", nullptr };
return StringArray (names);
}
PopupMenu CtrlrMIDIMon::getMenuForIndex(int topLevelMenuIndex, const String &menuName)
{
PopupMenu menu;
int opts = (int)owner.getProperty (Ids::ctrlrLogOptions);
if (topLevelMenuIndex == 0)
{
menu.addItem (1, "Close");
}
else if (topLevelMenuIndex == 1)
{
menu.addItem (12, "Show name", true, getBitOption(opts,midiLogName));
menu.addItem (14, "Show channel", true, getBitOption(opts,midiLogChannel));
menu.addItem (18, "Show number", true, getBitOption(opts,midiLogNumber));
menu.addItem (26, "Show value", true, getBitOption(opts,midiLogValue));
menu.addItem (42, "Show RAW data", true, getBitOption(opts,midiLogRawData));
menu.addItem (74, "Show timestamp", true, getBitOption(opts,midiLogTimestamp));
menu.addItem (138, "RAW data in decimal", true, getBitOption(opts,midiLogRawDecimal));
menu.addItem (1034, "Show device name", true, getBitOption(opts,midiLogDevice));
menu.addItem (4096+10, "Show RAW data size", true, getBitOption(opts,midiLogDataSize));
menu.addSeparator();
menu.addColouredItem (266, "Monitor input", Colour(0xff21c630), true, getBitOption(opts,midiLogInput));
menu.addColouredItem (522, "Monitor output", Colour(0xffc62121), true, getBitOption(opts,midiLogOutput));
}
else if (topLevelMenuIndex == 2)
{
menu.addItem (8192, "Create new");
menu.addSectionHeader ("Active filters");
}
return (menu);
}
CHECK :
CtrlrChildWindow.cpp CtrlrChildWindow.h
CtrlrChildWindowContainer.cpp CtrlrChildWindowContainer.h
CtrlrChildWindowContent.cpp CtrlrChildWindowContent.h
Could be related to the 24px offset issue on export. The menuBar is probably there but hidden behind the Native tittle bar. CHECK : try changing y position value to +24px to see if it shows up.
void CtrlrChildWindowContainer::resized()
{
menuBar->setBounds (0, 0, getWidth() - 0, owner.managerOwner.getProperty(Ids::ctrlrMenuBarHeight));
//[UserResized] Add your own custom resize handling here..
if (content)
{
content->setBounds (0, owner.managerOwner.getProperty(Ids::ctrlrMenuBarHeight), getWidth(), getHeight() - (int)owner.managerOwner.getProperty(Ids::ctrlrMenuBarHeight));
}
//[/UserResized]
}
Add setBounds for menuBar to constructor :
CtrlrChildWindowContainer::CtrlrChildWindowContainer (CtrlrWindowManager &_owner)
: content(nullptr), owner(_owner),
menuBar (0)
{
addAndMakeVisible (menuBar = new MenuBarComponent (this));
//[UserPreSize]
//[/UserPreSize]
setSize (600, 400);
//[Constructor] You can add your own custom stuff here..
//[/Constructor]
}
FIX :
void CtrlrChildWindowContainer::resized()
{
menuBar->setBounds (0, 0, getWidth(), (int)(owner.managerOwner.getProperty(Ids::ctrlrMenuBarHeight), 24)); // added v5.6.31. Fallback 24px value added to fix for hidden menuBar on exported instance
addAndMakeVisible (menuBar);
//[UserResized] Add your own custom resize handling here..
if (content)
{
content->setBounds (0, (int)(owner.managerOwner.getProperty(Ids::ctrlrMenuBarHeight), 24), getWidth(), getHeight() - (int)(owner.managerOwner.getProperty(Ids::ctrlrMenuBarHeight), 24)); // added v5.6.31. Fallback 24px value added to fix for hidden menuBar on exported instance
}
//[/UserResized]
}
Log viewer's and Midi Monitor's Menu bars are not showing up in Exported Instance mode (both unrestricted and restricted).