diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2016-06-24 10:43:46 +0200 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2016-06-24 10:43:46 +0200 |
| commit | 3570c7f03a2aa90aa634f96c0af1969af610f14d (patch) | |
| tree | 4252e03c0e853ba7cffe022937698c854ad0eaa9 /Source/Core/DolphinWX/Debugger/WatchWindow.cpp | |
| parent | 2115e8a4a6814e32107b5205ff5c95bbd3c6e99c (diff) | |
Reformat all the things. Have fun with merge conflicts.
Diffstat (limited to 'Source/Core/DolphinWX/Debugger/WatchWindow.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/Debugger/WatchWindow.cpp | 135 |
1 files changed, 70 insertions, 65 deletions
diff --git a/Source/Core/DolphinWX/Debugger/WatchWindow.cpp b/Source/Core/DolphinWX/Debugger/WatchWindow.cpp index 6e6be9bfde..915a244f48 100644 --- a/Source/Core/DolphinWX/Debugger/WatchWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/WatchWindow.cpp @@ -4,114 +4,119 @@ #include <cstddef> +#include <wx/aui/auibar.h> #include <wx/bitmap.h> #include <wx/panel.h> -#include <wx/aui/auibar.h> #include "Common/FileUtil.h" #include "Common/IniFile.h" #include "Core/ConfigManager.h" #include "Core/PowerPC/PowerPC.h" -#include "DolphinWX/WxUtils.h" #include "DolphinWX/Debugger/WatchView.h" #include "DolphinWX/Debugger/WatchWindow.h" +#include "DolphinWX/WxUtils.h" class CWatchToolbar : public wxAuiToolBar { public: -CWatchToolbar(CWatchWindow* parent, const wxWindowID id) - : wxAuiToolBar(parent, id, wxDefaultPosition, wxDefaultSize, - wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT) -{ - SetToolBitmapSize(wxSize(16, 16)); + CWatchToolbar(CWatchWindow* parent, const wxWindowID id) + : wxAuiToolBar(parent, id, wxDefaultPosition, wxDefaultSize, + wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT) + { + SetToolBitmapSize(wxSize(16, 16)); - m_Bitmaps[Toolbar_File] = WxUtils::LoadResourceBitmap("toolbar_debugger_delete"); + m_Bitmaps[Toolbar_File] = WxUtils::LoadResourceBitmap("toolbar_debugger_delete"); - AddTool(ID_LOAD, _("Load"), m_Bitmaps[Toolbar_File]); - Bind(wxEVT_TOOL, &CWatchWindow::Event_LoadAll, parent, ID_LOAD); + AddTool(ID_LOAD, _("Load"), m_Bitmaps[Toolbar_File]); + Bind(wxEVT_TOOL, &CWatchWindow::Event_LoadAll, parent, ID_LOAD); - AddTool(ID_SAVE, _("Save"), m_Bitmaps[Toolbar_File]); - Bind(wxEVT_TOOL, &CWatchWindow::Event_SaveAll, parent, ID_SAVE); -} + AddTool(ID_SAVE, _("Save"), m_Bitmaps[Toolbar_File]); + Bind(wxEVT_TOOL, &CWatchWindow::Event_SaveAll, parent, ID_SAVE); + } private: - - enum - { - Toolbar_File, - Num_Bitmaps - }; - - enum - { - ID_LOAD, - ID_SAVE - }; - - wxBitmap m_Bitmaps[Num_Bitmaps]; + enum + { + Toolbar_File, + Num_Bitmaps + }; + + enum + { + ID_LOAD, + ID_SAVE + }; + + wxBitmap m_Bitmaps[Num_Bitmaps]; }; -CWatchWindow::CWatchWindow(wxWindow* parent, wxWindowID id, - const wxPoint& position, const wxSize& size, - long style, const wxString& name) - : wxPanel(parent, id, position, size, style, name) - , m_GPRGridView(nullptr) +CWatchWindow::CWatchWindow(wxWindow* parent, wxWindowID id, const wxPoint& position, + const wxSize& size, long style, const wxString& name) + : wxPanel(parent, id, position, size, style, name), m_GPRGridView(nullptr) { - m_mgr.SetManagedWindow(this); - m_mgr.SetFlags(wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE); - - m_GPRGridView = new CWatchView(this); - - m_mgr.AddPane(new CWatchToolbar(this, wxID_ANY), wxAuiPaneInfo().ToolbarPane().Top(). - LeftDockable(true).RightDockable(true).BottomDockable(false).Floatable(false)); - m_mgr.AddPane(m_GPRGridView, wxAuiPaneInfo().CenterPane()); - m_mgr.Update(); + m_mgr.SetManagedWindow(this); + m_mgr.SetFlags(wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE); + + m_GPRGridView = new CWatchView(this); + + m_mgr.AddPane(new CWatchToolbar(this, wxID_ANY), wxAuiPaneInfo() + .ToolbarPane() + .Top() + .LeftDockable(true) + .RightDockable(true) + .BottomDockable(false) + .Floatable(false)); + m_mgr.AddPane(m_GPRGridView, wxAuiPaneInfo().CenterPane()); + m_mgr.Update(); } CWatchWindow::~CWatchWindow() { - m_mgr.UnInit(); + m_mgr.UnInit(); } void CWatchWindow::NotifyUpdate() { - if (m_GPRGridView != nullptr) - m_GPRGridView->Update(); + if (m_GPRGridView != nullptr) + m_GPRGridView->Update(); } void CWatchWindow::Event_SaveAll(wxCommandEvent& WXUNUSED(event)) { - SaveAll(); + SaveAll(); } void CWatchWindow::SaveAll() { - IniFile ini; - ini.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + SConfig::GetInstance().GetUniqueID() + ".ini", false); - ini.SetLines("Watches", PowerPC::watches.GetStrings()); - ini.Save(File::GetUserPath(D_GAMESETTINGS_IDX) + SConfig::GetInstance().GetUniqueID() + ".ini"); + IniFile ini; + ini.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + SConfig::GetInstance().GetUniqueID() + ".ini", + false); + ini.SetLines("Watches", PowerPC::watches.GetStrings()); + ini.Save(File::GetUserPath(D_GAMESETTINGS_IDX) + SConfig::GetInstance().GetUniqueID() + ".ini"); } void CWatchWindow::Event_LoadAll(wxCommandEvent& WXUNUSED(event)) { - LoadAll(); + LoadAll(); } void CWatchWindow::LoadAll() { - IniFile ini; - Watches::TWatchesStr watches; - - if (!ini.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + SConfig::GetInstance().GetUniqueID() + ".ini", false)) - { - return; - } - - if (ini.GetLines("Watches", &watches, false)) - { - PowerPC::watches.Clear(); - PowerPC::watches.AddFromStrings(watches); - } - - NotifyUpdate(); + IniFile ini; + Watches::TWatchesStr watches; + + if (!ini.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + SConfig::GetInstance().GetUniqueID() + + ".ini", + false)) + { + return; + } + + if (ini.GetLines("Watches", &watches, false)) + { + PowerPC::watches.Clear(); + PowerPC::watches.AddFromStrings(watches); + } + + NotifyUpdate(); } |
