osci-render/Source/components/MainMenuBarModel.cpp

49 wiersze
1.2 KiB
C++
Czysty Zwykły widok Historia

#include "MainMenuBarModel.h"
#include "../PluginEditor.h"
juce::StringArray MainMenuBarModel::getMenuBarNames() {
2023-12-20 20:58:08 +00:00
return juce::StringArray("File", "Options");
}
juce::PopupMenu MainMenuBarModel::getMenuForIndex(int topLevelMenuIndex, const juce::String& menuName) {
juce::PopupMenu menu;
2023-12-20 20:58:08 +00:00
if (topLevelMenuIndex == 0) {
menu.addItem(1, "Open");
menu.addItem(2, "Save");
menu.addItem(3, "Save As");
} else if (topLevelMenuIndex == 1) {
menu.addItem(1, "Audio Settings");
}
return menu;
}
void MainMenuBarModel::menuItemSelected(int menuItemID, int topLevelMenuIndex) {
2023-12-20 20:58:08 +00:00
switch (topLevelMenuIndex) {
case 0:
switch (menuItemID) {
case 1:
editor.openProject();
break;
case 2:
editor.saveProject();
break;
case 3:
editor.saveProjectAs();
break;
default:
break;
}
break;
2023-12-20 20:58:08 +00:00
case 1:
editor.openAudioSettings();
break;
default:
break;
}
2023-12-20 20:58:08 +00:00
}
void MainMenuBarModel::menuBarActivated(bool isActive) {}