Frame: Separate menu creation into individual functions
Keeps related menu items together based on top level menu. This will be more convenient in the future when debugger menu bar item handling is moved to CFrame, as it won't be a huge amount of code in one function. This also makes it easier to locate menu bar code whenever it needs to be changed.
This commit is contained in:
parent
a583d36c7f
commit
6420a1c715
|
@ -401,10 +401,10 @@ CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, wxRect geo
|
||||||
GetStatusBar()->Hide();
|
GetStatusBar()->Hide();
|
||||||
|
|
||||||
// Give it a menu bar
|
// Give it a menu bar
|
||||||
wxMenuBar* menubar_active = CreateMenu();
|
wxMenuBar* menubar_active = CreateMenuBar();
|
||||||
SetMenuBar(menubar_active);
|
SetMenuBar(menubar_active);
|
||||||
// Create a menubar to service requests while the real menubar is hidden from the screen
|
// Create a menubar to service requests while the real menubar is hidden from the screen
|
||||||
m_menubar_shadow = CreateMenu();
|
m_menubar_shadow = CreateMenuBar();
|
||||||
|
|
||||||
// ---------------
|
// ---------------
|
||||||
// Main panel
|
// Main panel
|
||||||
|
@ -1306,7 +1306,7 @@ void CFrame::DoFullscreen(bool enable_fullscreen)
|
||||||
// Recreate the menubar if needed.
|
// Recreate the menubar if needed.
|
||||||
if (wxFrame::GetMenuBar() == nullptr)
|
if (wxFrame::GetMenuBar() == nullptr)
|
||||||
{
|
{
|
||||||
SetMenuBar(CreateMenu());
|
SetMenuBar(CreateMenuBar());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show statusbar if enabled
|
// Show statusbar if enabled
|
||||||
|
|
|
@ -199,7 +199,14 @@ private:
|
||||||
|
|
||||||
void PopulateToolbar(wxToolBar* toolBar);
|
void PopulateToolbar(wxToolBar* toolBar);
|
||||||
void RecreateToolbar();
|
void RecreateToolbar();
|
||||||
wxMenuBar* CreateMenu();
|
wxMenuBar* CreateMenuBar();
|
||||||
|
wxMenu* CreateFileMenu();
|
||||||
|
wxMenu* CreateEmulationMenu();
|
||||||
|
wxMenu* CreateMovieMenu();
|
||||||
|
wxMenu* CreateOptionsMenu();
|
||||||
|
wxMenu* CreateToolsMenu();
|
||||||
|
wxMenu* CreateViewMenu();
|
||||||
|
wxMenu* CreateHelpMenu();
|
||||||
|
|
||||||
// Utility
|
// Utility
|
||||||
wxString GetMenuLabel(int Id);
|
wxString GetMenuLabel(int Id);
|
||||||
|
|
|
@ -101,156 +101,247 @@ const wxSize& CFrame::GetToolbarBitmapSize() const
|
||||||
|
|
||||||
// Create menu items
|
// Create menu items
|
||||||
// ---------------------
|
// ---------------------
|
||||||
wxMenuBar* CFrame::CreateMenu()
|
wxMenuBar* CFrame::CreateMenuBar()
|
||||||
{
|
{
|
||||||
wxMenuBar* menubar = new wxMenuBar();
|
auto* const menu_bar = new wxMenuBar;
|
||||||
|
menu_bar->Append(CreateFileMenu(), _("&File"));
|
||||||
|
menu_bar->Append(CreateEmulationMenu(), _("&Emulation"));
|
||||||
|
menu_bar->Append(CreateMovieMenu(), _("&Movie"));
|
||||||
|
menu_bar->Append(CreateOptionsMenu(), _("&Options"));
|
||||||
|
menu_bar->Append(CreateToolsMenu(), _("&Tools"));
|
||||||
|
menu_bar->Append(CreateViewMenu(), _("&View"));
|
||||||
|
|
||||||
// file menu
|
if (g_pCodeWindow)
|
||||||
wxMenu* fileMenu = new wxMenu;
|
{
|
||||||
fileMenu->Append(wxID_OPEN, GetMenuLabel(HK_OPEN));
|
g_pCodeWindow->CreateMenu(SConfig::GetInstance(), menu_bar);
|
||||||
fileMenu->Append(IDM_CHANGE_DISC, GetMenuLabel(HK_CHANGE_DISC));
|
}
|
||||||
|
|
||||||
wxMenu* externalDrive = new wxMenu;
|
menu_bar->Append(CreateHelpMenu(), _("&Help"));
|
||||||
fileMenu->Append(IDM_DRIVES, _("&Boot from DVD Backup"), externalDrive);
|
|
||||||
|
return menu_bar;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxMenu* CFrame::CreateFileMenu()
|
||||||
|
{
|
||||||
|
auto* const external_drive_menu = new wxMenu;
|
||||||
|
|
||||||
drives = cdio_get_devices();
|
drives = cdio_get_devices();
|
||||||
// Windows Limitation of 24 character drives
|
// Windows Limitation of 24 character drives
|
||||||
for (unsigned int i = 0; i < drives.size() && i < 24; i++)
|
for (unsigned int i = 0; i < drives.size() && i < 24; i++)
|
||||||
{
|
{
|
||||||
externalDrive->Append(IDM_DRIVE1 + i, StrToWxStr(drives[i]));
|
external_drive_menu->Append(IDM_DRIVE1 + i, StrToWxStr(drives[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
fileMenu->AppendSeparator();
|
auto* const file_menu = new wxMenu;
|
||||||
fileMenu->Append(wxID_REFRESH, GetMenuLabel(HK_REFRESH_LIST));
|
file_menu->Append(wxID_OPEN, GetMenuLabel(HK_OPEN));
|
||||||
fileMenu->AppendSeparator();
|
file_menu->Append(IDM_CHANGE_DISC, GetMenuLabel(HK_CHANGE_DISC));
|
||||||
fileMenu->Append(wxID_EXIT, _("E&xit") + wxString("\tAlt+F4"));
|
file_menu->Append(IDM_DRIVES, _("&Boot from DVD Backup"), external_drive_menu);
|
||||||
menubar->Append(fileMenu, _("&File"));
|
file_menu->AppendSeparator();
|
||||||
|
file_menu->Append(wxID_REFRESH, GetMenuLabel(HK_REFRESH_LIST));
|
||||||
|
file_menu->AppendSeparator();
|
||||||
|
file_menu->Append(wxID_EXIT, _("E&xit") + "\tAlt+F4");
|
||||||
|
|
||||||
// Emulation menu
|
return file_menu;
|
||||||
wxMenu* emulationMenu = new wxMenu;
|
}
|
||||||
emulationMenu->Append(IDM_PLAY, GetMenuLabel(HK_PLAY_PAUSE));
|
|
||||||
emulationMenu->Append(IDM_STOP, GetMenuLabel(HK_STOP));
|
|
||||||
emulationMenu->Append(IDM_RESET, GetMenuLabel(HK_RESET));
|
|
||||||
emulationMenu->AppendSeparator();
|
|
||||||
emulationMenu->Append(IDM_TOGGLE_FULLSCREEN, GetMenuLabel(HK_FULLSCREEN));
|
|
||||||
emulationMenu->Append(IDM_FRAMESTEP, GetMenuLabel(HK_FRAME_ADVANCE), wxEmptyString);
|
|
||||||
|
|
||||||
emulationMenu->AppendSeparator();
|
wxMenu* CFrame::CreateEmulationMenu()
|
||||||
emulationMenu->Append(IDM_SCREENSHOT, GetMenuLabel(HK_SCREENSHOT));
|
{
|
||||||
|
auto* const load_state_menu = new wxMenu;
|
||||||
|
load_state_menu->Append(IDM_LOAD_STATE_FILE, GetMenuLabel(HK_LOAD_STATE_FILE));
|
||||||
|
load_state_menu->Append(IDM_LOAD_SELECTED_SLOT, GetMenuLabel(HK_LOAD_STATE_SLOT_SELECTED));
|
||||||
|
load_state_menu->Append(IDM_UNDO_LOAD_STATE, GetMenuLabel(HK_UNDO_LOAD_STATE));
|
||||||
|
load_state_menu->AppendSeparator();
|
||||||
|
|
||||||
emulationMenu->AppendSeparator();
|
auto* const save_state_menu = new wxMenu;
|
||||||
wxMenu* saveMenu = new wxMenu;
|
save_state_menu->Append(IDM_SAVE_STATE_FILE, GetMenuLabel(HK_SAVE_STATE_FILE));
|
||||||
wxMenu* loadMenu = new wxMenu;
|
save_state_menu->Append(IDM_SAVE_SELECTED_SLOT, GetMenuLabel(HK_SAVE_STATE_SLOT_SELECTED));
|
||||||
wxMenu* slotSelectMenu = new wxMenu;
|
save_state_menu->Append(IDM_SAVE_FIRST_STATE, GetMenuLabel(HK_SAVE_FIRST_STATE));
|
||||||
emulationMenu->Append(IDM_LOAD_STATE, _("&Load State"), loadMenu);
|
save_state_menu->Append(IDM_UNDO_SAVE_STATE, GetMenuLabel(HK_UNDO_SAVE_STATE));
|
||||||
emulationMenu->Append(IDM_SAVE_STATE, _("Sa&ve State"), saveMenu);
|
save_state_menu->AppendSeparator();
|
||||||
emulationMenu->Append(IDM_SELECT_SLOT, _("Select State Slot"), slotSelectMenu);
|
|
||||||
|
|
||||||
saveMenu->Append(IDM_SAVE_STATE_FILE, GetMenuLabel(HK_SAVE_STATE_FILE));
|
auto* const slot_select_menu = new wxMenu;
|
||||||
saveMenu->Append(IDM_SAVE_SELECTED_SLOT, GetMenuLabel(HK_SAVE_STATE_SLOT_SELECTED));
|
|
||||||
saveMenu->Append(IDM_SAVE_FIRST_STATE, GetMenuLabel(HK_SAVE_FIRST_STATE));
|
|
||||||
saveMenu->Append(IDM_UNDO_SAVE_STATE, GetMenuLabel(HK_UNDO_SAVE_STATE));
|
|
||||||
saveMenu->AppendSeparator();
|
|
||||||
|
|
||||||
loadMenu->Append(IDM_LOAD_STATE_FILE, GetMenuLabel(HK_LOAD_STATE_FILE));
|
|
||||||
loadMenu->Append(IDM_LOAD_SELECTED_SLOT, GetMenuLabel(HK_LOAD_STATE_SLOT_SELECTED));
|
|
||||||
loadMenu->Append(IDM_UNDO_LOAD_STATE, GetMenuLabel(HK_UNDO_LOAD_STATE));
|
|
||||||
loadMenu->AppendSeparator();
|
|
||||||
|
|
||||||
for (unsigned int i = 0; i < State::NUM_STATES; i++)
|
for (unsigned int i = 0; i < State::NUM_STATES; i++)
|
||||||
{
|
{
|
||||||
loadMenu->Append(IDM_LOAD_SLOT_1 + i, GetMenuLabel(HK_LOAD_STATE_SLOT_1 + i));
|
load_state_menu->Append(IDM_LOAD_SLOT_1 + i, GetMenuLabel(HK_LOAD_STATE_SLOT_1 + i));
|
||||||
saveMenu->Append(IDM_SAVE_SLOT_1 + i, GetMenuLabel(HK_SAVE_STATE_SLOT_1 + i));
|
save_state_menu->Append(IDM_SAVE_SLOT_1 + i, GetMenuLabel(HK_SAVE_STATE_SLOT_1 + i));
|
||||||
slotSelectMenu->Append(IDM_SELECT_SLOT_1 + i, GetMenuLabel(HK_SELECT_STATE_SLOT_1 + i));
|
slot_select_menu->Append(IDM_SELECT_SLOT_1 + i, GetMenuLabel(HK_SELECT_STATE_SLOT_1 + i));
|
||||||
}
|
}
|
||||||
|
|
||||||
loadMenu->AppendSeparator();
|
load_state_menu->AppendSeparator();
|
||||||
for (unsigned int i = 0; i < State::NUM_STATES; i++)
|
for (unsigned int i = 0; i < State::NUM_STATES; i++)
|
||||||
loadMenu->Append(IDM_LOAD_LAST_1 + i, GetMenuLabel(HK_LOAD_LAST_STATE_1 + i));
|
load_state_menu->Append(IDM_LOAD_LAST_1 + i, GetMenuLabel(HK_LOAD_LAST_STATE_1 + i));
|
||||||
|
|
||||||
menubar->Append(emulationMenu, _("&Emulation"));
|
auto* const emulation_menu = new wxMenu;
|
||||||
|
emulation_menu->Append(IDM_PLAY, GetMenuLabel(HK_PLAY_PAUSE));
|
||||||
|
emulation_menu->Append(IDM_STOP, GetMenuLabel(HK_STOP));
|
||||||
|
emulation_menu->Append(IDM_RESET, GetMenuLabel(HK_RESET));
|
||||||
|
emulation_menu->AppendSeparator();
|
||||||
|
emulation_menu->Append(IDM_TOGGLE_FULLSCREEN, GetMenuLabel(HK_FULLSCREEN));
|
||||||
|
emulation_menu->Append(IDM_FRAMESTEP, GetMenuLabel(HK_FRAME_ADVANCE));
|
||||||
|
emulation_menu->AppendSeparator();
|
||||||
|
emulation_menu->Append(IDM_SCREENSHOT, GetMenuLabel(HK_SCREENSHOT));
|
||||||
|
emulation_menu->AppendSeparator();
|
||||||
|
emulation_menu->Append(IDM_LOAD_STATE, _("&Load State"), load_state_menu);
|
||||||
|
emulation_menu->Append(IDM_SAVE_STATE, _("Sa&ve State"), save_state_menu);
|
||||||
|
emulation_menu->Append(IDM_SELECT_SLOT, _("Select State Slot"), slot_select_menu);
|
||||||
|
|
||||||
// Movie menu
|
return emulation_menu;
|
||||||
wxMenu* movieMenu = new wxMenu;
|
}
|
||||||
movieMenu->Append(IDM_RECORD, GetMenuLabel(HK_START_RECORDING));
|
|
||||||
movieMenu->Append(IDM_PLAY_RECORD, GetMenuLabel(HK_PLAY_RECORDING));
|
wxMenu* CFrame::CreateMovieMenu()
|
||||||
movieMenu->Append(IDM_RECORD_EXPORT, GetMenuLabel(HK_EXPORT_RECORDING));
|
{
|
||||||
movieMenu->Append(IDM_RECORD_READ_ONLY, GetMenuLabel(HK_READ_ONLY_MODE), wxEmptyString,
|
auto* const movie_menu = new wxMenu;
|
||||||
wxITEM_CHECK);
|
const auto& config_instance = SConfig::GetInstance();
|
||||||
movieMenu->Append(IDM_TAS_INPUT, _("TAS Input"));
|
|
||||||
movieMenu->AppendSeparator();
|
movie_menu->Append(IDM_RECORD, GetMenuLabel(HK_START_RECORDING));
|
||||||
movieMenu->AppendCheckItem(IDM_TOGGLE_PAUSE_MOVIE, _("Pause at End of Movie"));
|
movie_menu->Append(IDM_PLAY_RECORD, GetMenuLabel(HK_PLAY_RECORDING));
|
||||||
movieMenu->Check(IDM_TOGGLE_PAUSE_MOVIE, SConfig::GetInstance().m_PauseMovie);
|
movie_menu->Append(IDM_RECORD_EXPORT, GetMenuLabel(HK_EXPORT_RECORDING));
|
||||||
movieMenu->AppendCheckItem(IDM_SHOW_LAG, _("Show Lag Counter"));
|
movie_menu->AppendCheckItem(IDM_RECORD_READ_ONLY, GetMenuLabel(HK_READ_ONLY_MODE));
|
||||||
movieMenu->Check(IDM_SHOW_LAG, SConfig::GetInstance().m_ShowLag);
|
movie_menu->Append(IDM_TAS_INPUT, _("TAS Input"));
|
||||||
movieMenu->AppendCheckItem(IDM_SHOW_FRAME_COUNT, _("Show Frame Counter"));
|
movie_menu->AppendSeparator();
|
||||||
movieMenu->Check(IDM_SHOW_FRAME_COUNT, SConfig::GetInstance().m_ShowFrameCount);
|
movie_menu->AppendCheckItem(IDM_TOGGLE_PAUSE_MOVIE, _("Pause at End of Movie"));
|
||||||
movieMenu->Check(IDM_RECORD_READ_ONLY, true);
|
movie_menu->Check(IDM_TOGGLE_PAUSE_MOVIE, config_instance.m_PauseMovie);
|
||||||
movieMenu->AppendCheckItem(IDM_SHOW_INPUT_DISPLAY, _("Show Input Display"));
|
movie_menu->AppendCheckItem(IDM_SHOW_LAG, _("Show Lag Counter"));
|
||||||
movieMenu->Check(IDM_SHOW_INPUT_DISPLAY, SConfig::GetInstance().m_ShowInputDisplay);
|
movie_menu->Check(IDM_SHOW_LAG, config_instance.m_ShowLag);
|
||||||
movieMenu->AppendCheckItem(IDM_SHOW_RTC_DISPLAY, _("Show System Clock"));
|
movie_menu->AppendCheckItem(IDM_SHOW_FRAME_COUNT, _("Show Frame Counter"));
|
||||||
movieMenu->Check(IDM_SHOW_RTC_DISPLAY, SConfig::GetInstance().m_ShowRTC);
|
movie_menu->Check(IDM_SHOW_FRAME_COUNT, config_instance.m_ShowFrameCount);
|
||||||
movieMenu->AppendSeparator();
|
movie_menu->Check(IDM_RECORD_READ_ONLY, true);
|
||||||
movieMenu->AppendCheckItem(IDM_TOGGLE_DUMP_FRAMES, _("Dump Frames"));
|
movie_menu->AppendCheckItem(IDM_SHOW_INPUT_DISPLAY, _("Show Input Display"));
|
||||||
movieMenu->Check(IDM_TOGGLE_DUMP_FRAMES, SConfig::GetInstance().m_DumpFrames);
|
movie_menu->Check(IDM_SHOW_INPUT_DISPLAY, config_instance.m_ShowInputDisplay);
|
||||||
movieMenu->AppendCheckItem(IDM_TOGGLE_DUMP_AUDIO, _("Dump Audio"));
|
movie_menu->AppendCheckItem(IDM_SHOW_RTC_DISPLAY, _("Show System Clock"));
|
||||||
movieMenu->Check(IDM_TOGGLE_DUMP_AUDIO, SConfig::GetInstance().m_DumpAudio);
|
movie_menu->Check(IDM_SHOW_RTC_DISPLAY, config_instance.m_ShowRTC);
|
||||||
menubar->Append(movieMenu, _("&Movie"));
|
movie_menu->AppendSeparator();
|
||||||
|
movie_menu->AppendCheckItem(IDM_TOGGLE_DUMP_FRAMES, _("Dump Frames"));
|
||||||
|
movie_menu->Check(IDM_TOGGLE_DUMP_FRAMES, config_instance.m_DumpFrames);
|
||||||
|
movie_menu->AppendCheckItem(IDM_TOGGLE_DUMP_AUDIO, _("Dump Audio"));
|
||||||
|
movie_menu->Check(IDM_TOGGLE_DUMP_AUDIO, config_instance.m_DumpAudio);
|
||||||
|
|
||||||
|
return movie_menu;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxMenu* CFrame::CreateOptionsMenu()
|
||||||
|
{
|
||||||
|
auto* const options_menu = new wxMenu;
|
||||||
|
options_menu->Append(wxID_PREFERENCES, _("Co&nfigure..."));
|
||||||
|
options_menu->AppendSeparator();
|
||||||
|
options_menu->Append(IDM_CONFIG_GFX_BACKEND, _("&Graphics Settings"));
|
||||||
|
options_menu->Append(IDM_CONFIG_AUDIO, _("&Audio Settings"));
|
||||||
|
options_menu->Append(IDM_CONFIG_CONTROLLERS, _("&Controller Settings"));
|
||||||
|
options_menu->Append(IDM_CONFIG_HOTKEYS, _("&Hotkey Settings"));
|
||||||
|
|
||||||
// Options menu
|
|
||||||
wxMenu* pOptionsMenu = new wxMenu;
|
|
||||||
pOptionsMenu->Append(wxID_PREFERENCES, _("Co&nfigure..."));
|
|
||||||
pOptionsMenu->AppendSeparator();
|
|
||||||
pOptionsMenu->Append(IDM_CONFIG_GFX_BACKEND, _("&Graphics Settings"));
|
|
||||||
pOptionsMenu->Append(IDM_CONFIG_AUDIO, _("&Audio Settings"));
|
|
||||||
pOptionsMenu->Append(IDM_CONFIG_CONTROLLERS, _("&Controller Settings"));
|
|
||||||
pOptionsMenu->Append(IDM_CONFIG_HOTKEYS, _("&Hotkey Settings"));
|
|
||||||
if (g_pCodeWindow)
|
if (g_pCodeWindow)
|
||||||
{
|
{
|
||||||
pOptionsMenu->AppendSeparator();
|
options_menu->AppendSeparator();
|
||||||
g_pCodeWindow->CreateMenuOptions(pOptionsMenu);
|
g_pCodeWindow->CreateMenuOptions(options_menu);
|
||||||
}
|
}
|
||||||
menubar->Append(pOptionsMenu, _("&Options"));
|
|
||||||
|
|
||||||
// Tools menu
|
return options_menu;
|
||||||
wxMenu* toolsMenu = new wxMenu;
|
}
|
||||||
toolsMenu->Append(IDM_MEMCARD, _("&Memcard Manager (GC)"));
|
|
||||||
toolsMenu->Append(IDM_IMPORT_SAVE, _("Import Wii Save..."));
|
|
||||||
toolsMenu->Append(IDM_EXPORT_ALL_SAVE, _("Export All Wii Saves"));
|
|
||||||
toolsMenu->Append(IDM_CHEATS, _("&Cheat Manager"));
|
|
||||||
|
|
||||||
toolsMenu->Append(IDM_NETPLAY, _("Start &NetPlay..."));
|
wxMenu* CFrame::CreateToolsMenu()
|
||||||
|
{
|
||||||
|
auto* const wiimote_menu = new wxMenu;
|
||||||
|
wiimote_menu->AppendCheckItem(IDM_CONNECT_WIIMOTE1, GetMenuLabel(HK_WIIMOTE1_CONNECT));
|
||||||
|
wiimote_menu->AppendCheckItem(IDM_CONNECT_WIIMOTE2, GetMenuLabel(HK_WIIMOTE2_CONNECT));
|
||||||
|
wiimote_menu->AppendCheckItem(IDM_CONNECT_WIIMOTE3, GetMenuLabel(HK_WIIMOTE3_CONNECT));
|
||||||
|
wiimote_menu->AppendCheckItem(IDM_CONNECT_WIIMOTE4, GetMenuLabel(HK_WIIMOTE4_CONNECT));
|
||||||
|
wiimote_menu->AppendSeparator();
|
||||||
|
wiimote_menu->AppendCheckItem(IDM_CONNECT_BALANCEBOARD, GetMenuLabel(HK_BALANCEBOARD_CONNECT));
|
||||||
|
|
||||||
toolsMenu->Append(IDM_MENU_INSTALL_WAD, _("Install WAD..."));
|
auto* const tools_menu = new wxMenu;
|
||||||
UpdateWiiMenuChoice(toolsMenu->Append(IDM_LOAD_WII_MENU, "Dummy string to keep wxw happy"));
|
tools_menu->Append(IDM_MEMCARD, _("&Memcard Manager (GC)"));
|
||||||
|
tools_menu->Append(IDM_IMPORT_SAVE, _("Import Wii Save..."));
|
||||||
|
tools_menu->Append(IDM_EXPORT_ALL_SAVE, _("Export All Wii Saves"));
|
||||||
|
tools_menu->Append(IDM_CHEATS, _("&Cheat Manager"));
|
||||||
|
tools_menu->Append(IDM_NETPLAY, _("Start &NetPlay..."));
|
||||||
|
tools_menu->Append(IDM_MENU_INSTALL_WAD, _("Install WAD..."));
|
||||||
|
|
||||||
toolsMenu->Append(IDM_FIFOPLAYER, _("FIFO Player"));
|
UpdateWiiMenuChoice(tools_menu->Append(IDM_LOAD_WII_MENU, "Dummy string to keep wxw happy"));
|
||||||
|
|
||||||
toolsMenu->AppendSeparator();
|
tools_menu->Append(IDM_FIFOPLAYER, _("FIFO Player"));
|
||||||
wxMenu* wiimoteMenu = new wxMenu;
|
tools_menu->AppendSeparator();
|
||||||
toolsMenu->AppendSubMenu(wiimoteMenu, _("Connect Wiimotes"));
|
tools_menu->AppendSubMenu(wiimote_menu, _("Connect Wiimotes"));
|
||||||
wiimoteMenu->AppendCheckItem(IDM_CONNECT_WIIMOTE1, GetMenuLabel(HK_WIIMOTE1_CONNECT));
|
|
||||||
wiimoteMenu->AppendCheckItem(IDM_CONNECT_WIIMOTE2, GetMenuLabel(HK_WIIMOTE2_CONNECT));
|
|
||||||
wiimoteMenu->AppendCheckItem(IDM_CONNECT_WIIMOTE3, GetMenuLabel(HK_WIIMOTE3_CONNECT));
|
|
||||||
wiimoteMenu->AppendCheckItem(IDM_CONNECT_WIIMOTE4, GetMenuLabel(HK_WIIMOTE4_CONNECT));
|
|
||||||
wiimoteMenu->AppendSeparator();
|
|
||||||
wiimoteMenu->AppendCheckItem(IDM_CONNECT_BALANCEBOARD, GetMenuLabel(HK_BALANCEBOARD_CONNECT));
|
|
||||||
|
|
||||||
menubar->Append(toolsMenu, _("&Tools"));
|
return tools_menu;
|
||||||
|
}
|
||||||
|
|
||||||
wxMenu* viewMenu = new wxMenu;
|
wxMenu* CFrame::CreateViewMenu()
|
||||||
viewMenu->AppendCheckItem(IDM_TOGGLE_TOOLBAR, _("Show &Toolbar"));
|
{
|
||||||
viewMenu->Check(IDM_TOGGLE_TOOLBAR, SConfig::GetInstance().m_InterfaceToolbar);
|
const auto& config_instance = SConfig::GetInstance();
|
||||||
viewMenu->AppendCheckItem(IDM_TOGGLE_STATUSBAR, _("Show &Status Bar"));
|
|
||||||
viewMenu->Check(IDM_TOGGLE_STATUSBAR, SConfig::GetInstance().m_InterfaceStatusbar);
|
auto* const platform_menu = new wxMenu;
|
||||||
viewMenu->AppendSeparator();
|
platform_menu->AppendCheckItem(IDM_LIST_WII, _("Show Wii"));
|
||||||
viewMenu->AppendCheckItem(IDM_LOG_WINDOW, _("Show &Log"));
|
platform_menu->Check(IDM_LIST_WII, config_instance.m_ListWii);
|
||||||
viewMenu->AppendCheckItem(IDM_LOG_CONFIG_WINDOW, _("Show Log &Configuration"));
|
platform_menu->AppendCheckItem(IDM_LIST_GC, _("Show GameCube"));
|
||||||
viewMenu->AppendSeparator();
|
platform_menu->Check(IDM_LIST_GC, config_instance.m_ListGC);
|
||||||
|
platform_menu->AppendCheckItem(IDM_LIST_WAD, _("Show WAD"));
|
||||||
|
platform_menu->Check(IDM_LIST_WAD, config_instance.m_ListWad);
|
||||||
|
platform_menu->AppendCheckItem(IDM_LIST_ELFDOL, _("Show ELF/DOL"));
|
||||||
|
platform_menu->Check(IDM_LIST_ELFDOL, config_instance.m_ListElfDol);
|
||||||
|
|
||||||
|
auto* const region_menu = new wxMenu;
|
||||||
|
region_menu->AppendCheckItem(IDM_LIST_JAP, _("Show JAP"));
|
||||||
|
region_menu->Check(IDM_LIST_JAP, config_instance.m_ListJap);
|
||||||
|
region_menu->AppendCheckItem(IDM_LIST_PAL, _("Show PAL"));
|
||||||
|
region_menu->Check(IDM_LIST_PAL, config_instance.m_ListPal);
|
||||||
|
region_menu->AppendCheckItem(IDM_LIST_USA, _("Show USA"));
|
||||||
|
region_menu->Check(IDM_LIST_USA, config_instance.m_ListUsa);
|
||||||
|
region_menu->AppendSeparator();
|
||||||
|
region_menu->AppendCheckItem(IDM_LIST_AUSTRALIA, _("Show Australia"));
|
||||||
|
region_menu->Check(IDM_LIST_AUSTRALIA, config_instance.m_ListAustralia);
|
||||||
|
region_menu->AppendCheckItem(IDM_LIST_FRANCE, _("Show France"));
|
||||||
|
region_menu->Check(IDM_LIST_FRANCE, config_instance.m_ListFrance);
|
||||||
|
region_menu->AppendCheckItem(IDM_LIST_GERMANY, _("Show Germany"));
|
||||||
|
region_menu->Check(IDM_LIST_GERMANY, config_instance.m_ListGermany);
|
||||||
|
region_menu->AppendCheckItem(IDM_LIST_ITALY, _("Show Italy"));
|
||||||
|
region_menu->Check(IDM_LIST_ITALY, config_instance.m_ListItaly);
|
||||||
|
region_menu->AppendCheckItem(IDM_LIST_KOREA, _("Show Korea"));
|
||||||
|
region_menu->Check(IDM_LIST_KOREA, config_instance.m_ListKorea);
|
||||||
|
region_menu->AppendCheckItem(IDM_LIST_NETHERLANDS, _("Show Netherlands"));
|
||||||
|
region_menu->Check(IDM_LIST_NETHERLANDS, config_instance.m_ListNetherlands);
|
||||||
|
region_menu->AppendCheckItem(IDM_LIST_RUSSIA, _("Show Russia"));
|
||||||
|
region_menu->Check(IDM_LIST_RUSSIA, config_instance.m_ListRussia);
|
||||||
|
region_menu->AppendCheckItem(IDM_LIST_SPAIN, _("Show Spain"));
|
||||||
|
region_menu->Check(IDM_LIST_SPAIN, config_instance.m_ListSpain);
|
||||||
|
region_menu->AppendCheckItem(IDM_LIST_TAIWAN, _("Show Taiwan"));
|
||||||
|
region_menu->Check(IDM_LIST_TAIWAN, config_instance.m_ListTaiwan);
|
||||||
|
region_menu->AppendCheckItem(IDM_LIST_WORLD, _("Show World"));
|
||||||
|
region_menu->Check(IDM_LIST_WORLD, config_instance.m_ListWorld);
|
||||||
|
region_menu->AppendCheckItem(IDM_LIST_UNKNOWN, _("Show Unknown"));
|
||||||
|
region_menu->Check(IDM_LIST_UNKNOWN, config_instance.m_ListUnknown);
|
||||||
|
|
||||||
|
auto* const columns_menu = new wxMenu;
|
||||||
|
columns_menu->AppendCheckItem(IDM_SHOW_SYSTEM, _("Platform"));
|
||||||
|
columns_menu->Check(IDM_SHOW_SYSTEM, config_instance.m_showSystemColumn);
|
||||||
|
columns_menu->AppendCheckItem(IDM_SHOW_BANNER, _("Banner"));
|
||||||
|
columns_menu->Check(IDM_SHOW_BANNER, config_instance.m_showBannerColumn);
|
||||||
|
columns_menu->AppendCheckItem(IDM_SHOW_MAKER, _("Maker"));
|
||||||
|
columns_menu->Check(IDM_SHOW_MAKER, config_instance.m_showMakerColumn);
|
||||||
|
columns_menu->AppendCheckItem(IDM_SHOW_FILENAME, _("File Name"));
|
||||||
|
columns_menu->Check(IDM_SHOW_FILENAME, config_instance.m_showFileNameColumn);
|
||||||
|
columns_menu->AppendCheckItem(IDM_SHOW_ID, _("Game ID"));
|
||||||
|
columns_menu->Check(IDM_SHOW_ID, config_instance.m_showIDColumn);
|
||||||
|
columns_menu->AppendCheckItem(IDM_SHOW_REGION, _("Region"));
|
||||||
|
columns_menu->Check(IDM_SHOW_REGION, config_instance.m_showRegionColumn);
|
||||||
|
columns_menu->AppendCheckItem(IDM_SHOW_SIZE, _("File Size"));
|
||||||
|
columns_menu->Check(IDM_SHOW_SIZE, config_instance.m_showSizeColumn);
|
||||||
|
columns_menu->AppendCheckItem(IDM_SHOW_STATE, _("State"));
|
||||||
|
columns_menu->Check(IDM_SHOW_STATE, config_instance.m_showStateColumn);
|
||||||
|
|
||||||
|
auto* const view_menu = new wxMenu;
|
||||||
|
view_menu->AppendCheckItem(IDM_TOGGLE_TOOLBAR, _("Show &Toolbar"));
|
||||||
|
view_menu->Check(IDM_TOGGLE_TOOLBAR, config_instance.m_InterfaceToolbar);
|
||||||
|
view_menu->AppendCheckItem(IDM_TOGGLE_STATUSBAR, _("Show &Status Bar"));
|
||||||
|
view_menu->Check(IDM_TOGGLE_STATUSBAR, config_instance.m_InterfaceStatusbar);
|
||||||
|
view_menu->AppendSeparator();
|
||||||
|
view_menu->AppendCheckItem(IDM_LOG_WINDOW, _("Show &Log"));
|
||||||
|
view_menu->AppendCheckItem(IDM_LOG_CONFIG_WINDOW, _("Show Log &Configuration"));
|
||||||
|
view_menu->AppendSeparator();
|
||||||
|
|
||||||
if (g_pCodeWindow)
|
if (g_pCodeWindow)
|
||||||
{
|
{
|
||||||
viewMenu->Check(IDM_LOG_WINDOW, g_pCodeWindow->bShowOnStart[0]);
|
view_menu->Check(IDM_LOG_WINDOW, g_pCodeWindow->bShowOnStart[0]);
|
||||||
|
|
||||||
static const wxString menu_text[] = {_("&Registers"), _("&Watch"), _("&Breakpoints"),
|
static const wxString menu_text[] = {_("&Registers"), _("&Watch"), _("&Breakpoints"),
|
||||||
_("&Memory"), _("&JIT"), _("&Sound"),
|
_("&Memory"), _("&JIT"), _("&Sound"),
|
||||||
|
@ -258,103 +349,40 @@ wxMenuBar* CFrame::CreateMenu()
|
||||||
|
|
||||||
for (int i = IDM_REGISTER_WINDOW; i <= IDM_VIDEO_WINDOW; i++)
|
for (int i = IDM_REGISTER_WINDOW; i <= IDM_VIDEO_WINDOW; i++)
|
||||||
{
|
{
|
||||||
viewMenu->AppendCheckItem(i, menu_text[i - IDM_REGISTER_WINDOW]);
|
view_menu->AppendCheckItem(i, menu_text[i - IDM_REGISTER_WINDOW]);
|
||||||
viewMenu->Check(i, g_pCodeWindow->bShowOnStart[i - IDM_LOG_WINDOW]);
|
view_menu->Check(i, g_pCodeWindow->bShowOnStart[i - IDM_LOG_WINDOW]);
|
||||||
}
|
}
|
||||||
|
|
||||||
viewMenu->AppendSeparator();
|
view_menu->AppendSeparator();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
viewMenu->Check(IDM_LOG_WINDOW, SConfig::GetInstance().m_InterfaceLogWindow);
|
view_menu->Check(IDM_LOG_WINDOW, config_instance.m_InterfaceLogWindow);
|
||||||
viewMenu->Check(IDM_LOG_CONFIG_WINDOW, SConfig::GetInstance().m_InterfaceLogConfigWindow);
|
view_menu->Check(IDM_LOG_CONFIG_WINDOW, config_instance.m_InterfaceLogConfigWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMenu* platformMenu = new wxMenu;
|
view_menu->AppendSubMenu(platform_menu, _("Show Platforms"));
|
||||||
viewMenu->AppendSubMenu(platformMenu, _("Show Platforms"));
|
view_menu->AppendSubMenu(region_menu, _("Show Regions"));
|
||||||
platformMenu->AppendCheckItem(IDM_LIST_WII, _("Show Wii"));
|
|
||||||
platformMenu->Check(IDM_LIST_WII, SConfig::GetInstance().m_ListWii);
|
|
||||||
platformMenu->AppendCheckItem(IDM_LIST_GC, _("Show GameCube"));
|
|
||||||
platformMenu->Check(IDM_LIST_GC, SConfig::GetInstance().m_ListGC);
|
|
||||||
platformMenu->AppendCheckItem(IDM_LIST_WAD, _("Show WAD"));
|
|
||||||
platformMenu->Check(IDM_LIST_WAD, SConfig::GetInstance().m_ListWad);
|
|
||||||
platformMenu->AppendCheckItem(IDM_LIST_ELFDOL, _("Show ELF/DOL"));
|
|
||||||
platformMenu->Check(IDM_LIST_ELFDOL, SConfig::GetInstance().m_ListElfDol);
|
|
||||||
|
|
||||||
wxMenu* regionMenu = new wxMenu;
|
view_menu->AppendCheckItem(IDM_LIST_DRIVES, _("Show Drives"));
|
||||||
viewMenu->AppendSubMenu(regionMenu, _("Show Regions"));
|
view_menu->Check(IDM_LIST_DRIVES, config_instance.m_ListDrives);
|
||||||
regionMenu->AppendCheckItem(IDM_LIST_JAP, _("Show JAP"));
|
|
||||||
regionMenu->Check(IDM_LIST_JAP, SConfig::GetInstance().m_ListJap);
|
|
||||||
regionMenu->AppendCheckItem(IDM_LIST_PAL, _("Show PAL"));
|
|
||||||
regionMenu->Check(IDM_LIST_PAL, SConfig::GetInstance().m_ListPal);
|
|
||||||
regionMenu->AppendCheckItem(IDM_LIST_USA, _("Show USA"));
|
|
||||||
regionMenu->Check(IDM_LIST_USA, SConfig::GetInstance().m_ListUsa);
|
|
||||||
regionMenu->AppendSeparator();
|
|
||||||
regionMenu->AppendCheckItem(IDM_LIST_AUSTRALIA, _("Show Australia"));
|
|
||||||
regionMenu->Check(IDM_LIST_AUSTRALIA, SConfig::GetInstance().m_ListAustralia);
|
|
||||||
regionMenu->AppendCheckItem(IDM_LIST_FRANCE, _("Show France"));
|
|
||||||
regionMenu->Check(IDM_LIST_FRANCE, SConfig::GetInstance().m_ListFrance);
|
|
||||||
regionMenu->AppendCheckItem(IDM_LIST_GERMANY, _("Show Germany"));
|
|
||||||
regionMenu->Check(IDM_LIST_GERMANY, SConfig::GetInstance().m_ListGermany);
|
|
||||||
regionMenu->AppendCheckItem(IDM_LIST_ITALY, _("Show Italy"));
|
|
||||||
regionMenu->Check(IDM_LIST_ITALY, SConfig::GetInstance().m_ListItaly);
|
|
||||||
regionMenu->AppendCheckItem(IDM_LIST_KOREA, _("Show Korea"));
|
|
||||||
regionMenu->Check(IDM_LIST_KOREA, SConfig::GetInstance().m_ListKorea);
|
|
||||||
regionMenu->AppendCheckItem(IDM_LIST_NETHERLANDS, _("Show Netherlands"));
|
|
||||||
regionMenu->Check(IDM_LIST_NETHERLANDS, SConfig::GetInstance().m_ListNetherlands);
|
|
||||||
regionMenu->AppendCheckItem(IDM_LIST_RUSSIA, _("Show Russia"));
|
|
||||||
regionMenu->Check(IDM_LIST_RUSSIA, SConfig::GetInstance().m_ListRussia);
|
|
||||||
regionMenu->AppendCheckItem(IDM_LIST_SPAIN, _("Show Spain"));
|
|
||||||
regionMenu->Check(IDM_LIST_SPAIN, SConfig::GetInstance().m_ListSpain);
|
|
||||||
regionMenu->AppendCheckItem(IDM_LIST_TAIWAN, _("Show Taiwan"));
|
|
||||||
regionMenu->Check(IDM_LIST_TAIWAN, SConfig::GetInstance().m_ListTaiwan);
|
|
||||||
regionMenu->AppendCheckItem(IDM_LIST_WORLD, _("Show World"));
|
|
||||||
regionMenu->Check(IDM_LIST_WORLD, SConfig::GetInstance().m_ListWorld);
|
|
||||||
regionMenu->AppendCheckItem(IDM_LIST_UNKNOWN, _("Show Unknown"));
|
|
||||||
regionMenu->Check(IDM_LIST_UNKNOWN, SConfig::GetInstance().m_ListUnknown);
|
|
||||||
|
|
||||||
viewMenu->AppendCheckItem(IDM_LIST_DRIVES, _("Show Drives"));
|
view_menu->Append(IDM_PURGE_GAME_LIST_CACHE, _("Purge Game List Cache"));
|
||||||
viewMenu->Check(IDM_LIST_DRIVES, SConfig::GetInstance().m_ListDrives);
|
view_menu->AppendSubMenu(columns_menu, _("Select Columns"));
|
||||||
viewMenu->Append(IDM_PURGE_GAME_LIST_CACHE, _("Purge Game List Cache"));
|
|
||||||
|
|
||||||
wxMenu* columnsMenu = new wxMenu;
|
return view_menu;
|
||||||
viewMenu->AppendSubMenu(columnsMenu, _("Select Columns"));
|
}
|
||||||
columnsMenu->AppendCheckItem(IDM_SHOW_SYSTEM, _("Platform"));
|
|
||||||
columnsMenu->Check(IDM_SHOW_SYSTEM, SConfig::GetInstance().m_showSystemColumn);
|
|
||||||
columnsMenu->AppendCheckItem(IDM_SHOW_BANNER, _("Banner"));
|
|
||||||
columnsMenu->Check(IDM_SHOW_BANNER, SConfig::GetInstance().m_showBannerColumn);
|
|
||||||
columnsMenu->AppendCheckItem(IDM_SHOW_MAKER, _("Maker"));
|
|
||||||
columnsMenu->Check(IDM_SHOW_MAKER, SConfig::GetInstance().m_showMakerColumn);
|
|
||||||
columnsMenu->AppendCheckItem(IDM_SHOW_FILENAME, _("File Name"));
|
|
||||||
columnsMenu->Check(IDM_SHOW_FILENAME, SConfig::GetInstance().m_showFileNameColumn);
|
|
||||||
columnsMenu->AppendCheckItem(IDM_SHOW_ID, _("Game ID"));
|
|
||||||
columnsMenu->Check(IDM_SHOW_ID, SConfig::GetInstance().m_showIDColumn);
|
|
||||||
columnsMenu->AppendCheckItem(IDM_SHOW_REGION, _("Region"));
|
|
||||||
columnsMenu->Check(IDM_SHOW_REGION, SConfig::GetInstance().m_showRegionColumn);
|
|
||||||
columnsMenu->AppendCheckItem(IDM_SHOW_SIZE, _("File Size"));
|
|
||||||
columnsMenu->Check(IDM_SHOW_SIZE, SConfig::GetInstance().m_showSizeColumn);
|
|
||||||
columnsMenu->AppendCheckItem(IDM_SHOW_STATE, _("State"));
|
|
||||||
columnsMenu->Check(IDM_SHOW_STATE, SConfig::GetInstance().m_showStateColumn);
|
|
||||||
|
|
||||||
menubar->Append(viewMenu, _("&View"));
|
wxMenu* CFrame::CreateHelpMenu()
|
||||||
|
{
|
||||||
|
auto* const help_menu = new wxMenu;
|
||||||
|
help_menu->Append(IDM_HELP_WEBSITE, _("&Website"));
|
||||||
|
help_menu->Append(IDM_HELP_ONLINE_DOCS, _("Online &Documentation"));
|
||||||
|
help_menu->Append(IDM_HELP_GITHUB, _("&GitHub Repository"));
|
||||||
|
help_menu->AppendSeparator();
|
||||||
|
help_menu->Append(wxID_ABOUT, _("&About"));
|
||||||
|
|
||||||
if (g_pCodeWindow)
|
return help_menu;
|
||||||
{
|
|
||||||
g_pCodeWindow->CreateMenu(SConfig::GetInstance(), menubar);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Help menu
|
|
||||||
wxMenu* helpMenu = new wxMenu;
|
|
||||||
// Re-enable when there's something useful to display */
|
|
||||||
// helpMenu->Append(wxID_HELP, _("&Help"));
|
|
||||||
helpMenu->Append(IDM_HELP_WEBSITE, _("&Website"));
|
|
||||||
helpMenu->Append(IDM_HELP_ONLINE_DOCS, _("Online &Documentation"));
|
|
||||||
helpMenu->Append(IDM_HELP_GITHUB, _("&GitHub Repository"));
|
|
||||||
helpMenu->AppendSeparator();
|
|
||||||
helpMenu->Append(wxID_ABOUT, _("&About"));
|
|
||||||
menubar->Append(helpMenu, _("&Help"));
|
|
||||||
|
|
||||||
return menubar;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString CFrame::GetMenuLabel(int Id)
|
wxString CFrame::GetMenuLabel(int Id)
|
||||||
|
|
Loading…
Reference in New Issue