From 5ae6c21c2e2537859ff4473b131c4d2f9f2a6e0b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 3 Nov 2016 18:02:53 -0400 Subject: CodeWindow: Eliminate explicit menu item updating from CodeWindow Gets rid of more menu-related code from CodeWindow and puts it back in CFrame where it belongs. This turns the previous menu update function within CodeWindow into one that simply updates the debugger font for its managed controls. It also improves how the font is actually updated. Previously, fonts would change, however this wouldn't actually reflect onto the respective controls until a refresh or update event occurred. Since codeview, callstack, symbols, callers, and calls windows are all managed by a wxAuiManager instance, calling Update() on it after the font has been set will reflect font changes immediately. --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index ae33abc7ed..e4a0b37da7 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -447,6 +447,7 @@ void CCodeWindow::OnChangeFont(wxCommandEvent& event) if (dialog.ShowModal() == wxID_OK) DebuggerFont = dialog.GetFontData().GetChosenFont(); + UpdateFonts(); // TODO: Send event to all panels that tells them to reload the font when it changes. } -- cgit v1.2.3 From 9543b9d20d3a4557ff6112e38e28cd2cdac16ac1 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 4 Nov 2016 22:02:36 -0400 Subject: CodeWindow: Rename GetMenuBar() to GetParentMenuBar() --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index e4a0b37da7..3206721851 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -93,8 +93,8 @@ void CCodeWindow::Save() IniFile::Section* general = ini.GetOrCreateSection("General"); general->Set("DebuggerFont", WxStrToStr(DebuggerFont.GetNativeFontInfoUserDesc())); - general->Set("AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATIC_START)); - general->Set("BootToPause", GetMenuBar()->IsChecked(IDM_BOOT_TO_PAUSE)); + general->Set("AutomaticStart", GetParentMenuBar()->IsChecked(IDM_AUTOMATIC_START)); + general->Set("BootToPause", GetParentMenuBar()->IsChecked(IDM_BOOT_TO_PAUSE)); const char* SettingName[] = {"Log", "LogConfig", "Console", "Registers", "Breakpoints", "Memory", "JIT", "Sound", "Video", "Code"}; @@ -102,7 +102,7 @@ void CCodeWindow::Save() // Save windows settings for (int i = IDM_LOG_WINDOW; i <= IDM_VIDEO_WINDOW; i++) ini.GetOrCreateSection("ShowOnStart") - ->Set(SettingName[i - IDM_LOG_WINDOW], GetMenuBar()->IsChecked(i)); + ->Set(SettingName[i - IDM_LOG_WINDOW], GetParentMenuBar()->IsChecked(i)); // Save notebook affiliations std::string section = "P - " + Parent->Perspectives[Parent->ActivePerspective].Name; @@ -125,7 +125,7 @@ void CCodeWindow::OnProfilerMenu(wxCommandEvent& event) Core::SetState(Core::CORE_PAUSE); if (jit != nullptr) jit->ClearCache(); - Profiler::g_ProfileBlocks = GetMenuBar()->IsChecked(IDM_PROFILE_BLOCKS); + Profiler::g_ProfileBlocks = GetParentMenuBar()->IsChecked(IDM_PROFILE_BLOCKS); Core::SetState(Core::CORE_RUN); break; case IDM_WRITE_PROFILE: @@ -467,7 +467,7 @@ void CCodeWindow::TogglePanel(int id, bool show) wxPanel* panel = GetUntypedPanel(id); // Not all the panels (i.e. CodeWindow) have corresponding menu options. - wxMenuItem* item = GetMenuBar()->FindItem(id); + wxMenuItem* item = GetParentMenuBar()->FindItem(id); if (item) item->Check(show); -- cgit v1.2.3