diff options
| author | Shawn Hoffman <godisgovernment@gmail.com> | 2009-02-06 18:18:20 +0000 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2009-02-06 18:18:20 +0000 |
| commit | 60b25def1819e34e8bd0a285da5c09271b64fade (patch) | |
| tree | cef5dac5f6319b28deff06fe4d35a188235087b4 /Source/Core/DebuggerWX/Src/CodeWindow.cpp | |
| parent | 81631d8452477d4e3cbf5ac7ae180bc5da768fae (diff) | |
Allow changing of the debugger font and some cleanup
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2127 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DebuggerWX/Src/CodeWindow.cpp')
| -rw-r--r-- | Source/Core/DebuggerWX/Src/CodeWindow.cpp | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.cpp b/Source/Core/DebuggerWX/Src/CodeWindow.cpp index 18d50db5cf..9c6ee31c9f 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindow.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindow.cpp @@ -32,7 +32,6 @@ // ugly that this lib included code from the main #include "../../DolphinWX/Src/Globals.h" -#include "IniFile.h" #include "Host.h" #include "Debugger.h" @@ -75,20 +74,16 @@ extern "C" // Bitmaps #include "../resources/toolbar_delete.c" #include "../resources/toolbar_add_breakpoint.c" } -/////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////////////////// -// Declarations and definitions -// ŻŻŻŻŻŻŻŻŻŻ -// and here are the classes +////////////////////////////////////////////////////////////////////////// class CPluginInfo; class CPluginManager; -//extern DynamicLibrary Common::CPlugin; -//extern CPluginManager CPluginManager::m_Instance; static const long TOOLBAR_STYLE = wxTB_FLAT | wxTB_DOCKABLE | wxTB_TEXT; +// The default font +wxFont DebuggerFont = wxFont(9, wxMODERN, wxNORMAL, wxNORMAL, false, wxT("monospace")); + #define wxGetBitmapFromMemory(name) _wxGetBitmapFromMemory(name, sizeof(name)) inline wxBitmap _wxGetBitmapFromMemory(const unsigned char* data, int length) @@ -96,12 +91,8 @@ inline wxBitmap _wxGetBitmapFromMemory(const unsigned char* data, int length) wxMemoryInputStream is(data, length); return(wxBitmap(wxImage(is, wxBITMAP_TYPE_ANY, -1), -1)); } -/////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////////////////// -// Event table -// ŻŻŻŻŻŻŻŻŻŻ +////////////////////////////////////////////////////////////////////////// BEGIN_EVENT_TABLE(CCodeWindow, wxFrame) EVT_LISTBOX(ID_SYMBOLLIST, CCodeWindow::OnSymbolListChange) EVT_LISTBOX(ID_CALLSTACKLIST, CCodeWindow::OnCallstackListChange) @@ -130,13 +121,14 @@ BEGIN_EVENT_TABLE(CCodeWindow, wxFrame) EVT_MENU(IDM_JITPOFF, CCodeWindow::OnCPUMode) EVT_MENU(IDM_JITSROFF, CCodeWindow::OnCPUMode) - EVT_MENU(IDM_LOGWINDOW, CCodeWindow::OnToggleLogWindow) // Views + EVT_MENU(IDM_LOGWINDOW, CCodeWindow::OnToggleLogWindow) // Views EVT_MENU(IDM_REGISTERWINDOW, CCodeWindow::OnToggleRegisterWindow) EVT_MENU(IDM_BREAKPOINTWINDOW, CCodeWindow::OnToggleBreakPointWindow) EVT_MENU(IDM_MEMORYWINDOW, CCodeWindow::OnToggleMemoryWindow) EVT_MENU(IDM_JITWINDOW, CCodeWindow::OnToggleJitWindow) EVT_MENU(IDM_SOUNDWINDOW, CCodeWindow::OnToggleSoundWindow) EVT_MENU(IDM_VIDEOWINDOW, CCodeWindow::OnToggleVideoWindow) + EVT_MENU(IDM_FONTPICKER, CCodeWindow::OnChangeFont) EVT_MENU(IDM_CLEARSYMBOLS, CCodeWindow::OnSymbolsMenu) EVT_MENU(IDM_LOADMAPFILE, CCodeWindow::OnSymbolsMenu) @@ -164,12 +156,10 @@ BEGIN_EVENT_TABLE(CCodeWindow, wxFrame) EVT_COMMAND(ID_CODEVIEW, wxEVT_CODEVIEW_CHANGE, CCodeWindow::OnCodeViewChange) END_EVENT_TABLE() -/////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// // Class, input event handler and host message handler -// ŻŻŻŻŻŻŻŻŻŻ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxFrame(parent, id, title, pos, size, style) @@ -297,6 +287,11 @@ void CCodeWindow::OnHostMessage(wxCommandEvent& event) // -------------- void CCodeWindow::Load_( IniFile &ini ) { + // The font to override DebuggerFont with + std::string fontDesc; + ini.Get("ShowOnStart", "DebuggerFont", &fontDesc); + if (!fontDesc.empty()) + DebuggerFont.SetNativeFontInfoUserDesc(wxString(fontDesc.c_str(), wxConvUTF8)); // Decide what windows to use ini.Get("ShowOnStart", "LogWindow", &bLogWindow, true); @@ -332,6 +327,8 @@ void CCodeWindow::Save(IniFile &ini) const ini.Set("CodeWindow", "w", GetSize().GetWidth()); ini.Set("CodeWindow", "h", GetSize().GetHeight()); + ini.Set("ShowOnStart", "DebuggerFont", std::string(DebuggerFont.GetNativeFontInfoUserDesc().mb_str())); + // Boot to pause or not ini.Set("ShowOnStart", "AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART)); ini.Set("ShowOnStart", "BootToPause", GetMenuBar()->IsChecked(IDM_BOOTTOPAUSE)); @@ -346,7 +343,6 @@ void CCodeWindow::Save(IniFile &ini) const ini.Set("ShowOnStart", "VideoWindow", GetMenuBar()->IsChecked(IDM_VIDEOWINDOW)); } - void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStartupParameter) { CreateMenu(_LocalCoreStartupParameter); @@ -531,6 +527,9 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam wxMenuItem* pVideo = pDebugDialogs->Append(IDM_VIDEOWINDOW, _T("&Video"), wxEmptyString, wxITEM_CHECK); pVideo->Check(bVideoWindow); + pDebugDialogs->AppendSeparator(); + wxMenuItem* pFontPicker = pDebugDialogs->Append(IDM_FONTPICKER, _T("&Font..."), wxEmptyString, wxITEM_NORMAL); + pMenuBar->Append(pDebugDialogs, _T("&Views")); // ----------------- @@ -919,6 +918,12 @@ void CCodeWindow::UpdateButtonStates() GetMenuBar()->Enable(IDM_JITSROFF, Pause); GetMenuBar()->Enable(IDM_CLEARCODECACHE, Pause); // JIT Menu + + // Update Fonts + callstack->SetFont(DebuggerFont); + symbols->SetFont(DebuggerFont); + callers->SetFont(DebuggerFont); + calls->SetFont(DebuggerFont); } void CCodeWindow::RecreateToolbar() |
