diff options
| author | shuffle2 <godisgovernment@gmail.com> | 2016-10-03 20:06:08 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-03 20:06:08 -0700 |
| commit | b8731eb8180d76b4663eaf4188f985b9c5fa6fb2 (patch) | |
| tree | 40f57e85be3073d528e9e5a5776a905170a3a7ac /Source/Core/DolphinWX/Debugger/DebuggerPanel.cpp | |
| parent | 4573cc89fa65a867f991c1e592ad47382f1ee0a5 (diff) | |
| parent | c4f5ced37ca9eff6a5c62c08f1cc7a9e6dc47f7d (diff) | |
Merge pull request #4068 from EmptyChaos/wx-hidpi
WX: Comprehensive HiDPI Patch
Diffstat (limited to 'Source/Core/DolphinWX/Debugger/DebuggerPanel.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/Debugger/DebuggerPanel.cpp | 125 |
1 files changed, 38 insertions, 87 deletions
diff --git a/Source/Core/DolphinWX/Debugger/DebuggerPanel.cpp b/Source/Core/DolphinWX/Debugger/DebuggerPanel.cpp index c1a6a90eca..b8a909bf85 100644 --- a/Source/Core/DolphinWX/Debugger/DebuggerPanel.cpp +++ b/Source/Core/DolphinWX/Debugger/DebuggerPanel.cpp @@ -11,6 +11,7 @@ #include <wx/sizer.h> #include <wx/textctrl.h> +#include "Common/CommonFuncs.h" #include "Common/FileUtil.h" #include "Common/IniFile.h" #include "Core/ConfigManager.h" @@ -26,10 +27,6 @@ GFXDebuggerPanel::GFXDebuggerPanel(wxWindow* parent, wxWindowID id, const wxPoin g_pdebugger = this; CreateGUIControls(); - - Bind(wxEVT_CLOSE_WINDOW, &GFXDebuggerPanel::OnClose, this); - - LoadSettings(); } GFXDebuggerPanel::~GFXDebuggerPanel() @@ -38,55 +35,6 @@ GFXDebuggerPanel::~GFXDebuggerPanel() GFXDebuggerPauseFlag = false; } -void GFXDebuggerPanel::OnClose(wxCloseEvent& event) -{ - // save the window position when we hide the window - SaveSettings(); - - event.Skip(); -} - -void GFXDebuggerPanel::SaveSettings() const -{ - IniFile file; - file.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX)); - - // TODO: make this work when we close the entire program too, currently on total close we get - // weird values, perhaps because of some conflict with the rendering window - - // TODO: get the screen resolution and make limits from that - if (GetPosition().x < 1000 && GetPosition().y < 1000 && GetSize().GetWidth() < 1000 && - GetSize().GetHeight() < 1000) - { - IniFile::Section* video_window = file.GetOrCreateSection("VideoWindow"); - video_window->Set("x", GetPosition().x); - video_window->Set("y", GetPosition().y); - video_window->Set("w", GetSize().GetWidth()); - video_window->Set("h", GetSize().GetHeight()); - } - - file.Save(File::GetUserPath(F_DEBUGGERCONFIG_IDX)); -} - -void GFXDebuggerPanel::LoadSettings() -{ - IniFile file; - file.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX)); - - int x = 100; - int y = 100; - int w = 100; - int h = 100; - - IniFile::Section* video_window = file.GetOrCreateSection("VideoWindow"); - video_window->Get("x", &x, GetPosition().x); - video_window->Get("y", &y, GetPosition().y); - video_window->Get("w", &w, GetSize().GetWidth()); - video_window->Get("h", &h, GetSize().GetHeight()); - - SetSize(x, y, w, h); -} - struct PauseEventMap { PauseEvent event; @@ -118,10 +66,9 @@ void GFXDebuggerPanel::CreateGUIControls() {NEXT_ERROR, _("Error")}}; pauseEventMap = map; - const int numPauseEventMap = sizeof(map) / sizeof(PauseEventMap); + static constexpr int numPauseEventMap = ArraySize(map); - // Basic settings - CenterOnParent(); + const int space3 = FromDIP(3); m_pButtonPause = new wxButton(this, wxID_ANY, _("Pause"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _("Pause")); @@ -139,10 +86,11 @@ void GFXDebuggerPanel::CreateGUIControls() wxDefaultValidator, _("Continue")); m_pButtonCont->Bind(wxEVT_BUTTON, &GFXDebuggerPanel::OnContButton, this); - m_pCount = new wxTextCtrl(this, wxID_ANY, "1", wxDefaultPosition, wxSize(50, 25), wxTE_RIGHT, + m_pCount = new wxTextCtrl(this, wxID_ANY, "1", wxDefaultPosition, wxDefaultSize, wxTE_RIGHT, wxDefaultValidator, _("Count")); + m_pCount->SetMinSize(WxUtils::GetTextWidgetMinSize(m_pCount, 10000)); - m_pPauseAtList = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxSize(100, 25), 0, nullptr, 0, + m_pPauseAtList = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr, 0, wxDefaultValidator, _("PauseAtList")); for (int i = 0; i < numPauseEventMap; i++) { @@ -180,7 +128,7 @@ void GFXDebuggerPanel::CreateGUIControls() m_pButtonClearPixelShaderCache->Bind(wxEVT_BUTTON, &GFXDebuggerPanel::OnClearPixelShaderCacheButton, this); - m_pDumpList = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxSize(120, 25), 0, nullptr, 0, + m_pDumpList = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr, 0, wxDefaultValidator, _("DumpList")); m_pDumpList->Insert(_("Pixel Shader"), 0); m_pDumpList->Append(_("Vertex Shader")); @@ -196,31 +144,40 @@ void GFXDebuggerPanel::CreateGUIControls() wxBoxSizer* sMain = new wxBoxSizer(wxVERTICAL); - wxStaticBoxSizer* const pFlowCtrlBox = new wxStaticBoxSizer(wxVERTICAL, this, _("Flow Control")); wxBoxSizer* const pPauseAtNextSzr = new wxBoxSizer(wxHORIZONTAL); - pFlowCtrlBox->Add(m_pButtonPause); - pPauseAtNextSzr->Add(m_pButtonPauseAtNext); - pPauseAtNextSzr->Add(m_pCount); - pPauseAtNextSzr->Add(m_pPauseAtList); - pFlowCtrlBox->Add(pPauseAtNextSzr); - pFlowCtrlBox->Add(m_pButtonPauseAtNextFrame); - pFlowCtrlBox->Add(m_pButtonCont); + pPauseAtNextSzr->Add(m_pCount, 0, wxALIGN_CENTER_VERTICAL); + pPauseAtNextSzr->Add(m_pPauseAtList, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, space3); + + wxFlexGridSizer* const flow_szr = new wxFlexGridSizer(2, space3, space3); + flow_szr->Add(m_pButtonPause, 0, wxEXPAND); + flow_szr->AddSpacer(1); + flow_szr->Add(m_pButtonPauseAtNext, 0, wxEXPAND); + flow_szr->Add(pPauseAtNextSzr, 0, wxEXPAND); + flow_szr->Add(m_pButtonPauseAtNextFrame, 0, wxEXPAND); + flow_szr->AddSpacer(1); + flow_szr->Add(m_pButtonCont, 0, wxEXPAND); + flow_szr->AddSpacer(1); + + wxStaticBoxSizer* const pFlowCtrlBox = new wxStaticBoxSizer(wxVERTICAL, this, _("Flow Control")); + pFlowCtrlBox->Add(flow_szr, 1, wxEXPAND); - wxStaticBoxSizer* const pDebugBox = new wxStaticBoxSizer(wxVERTICAL, this, _("Debugging")); wxBoxSizer* const pDumpSzr = new wxBoxSizer(wxHORIZONTAL); - pDumpSzr->Add(m_pButtonDump); - pDumpSzr->Add(m_pDumpList); - pDebugBox->Add(pDumpSzr); - wxGridSizer* const pDbgGrid = new wxGridSizer(2, 5, 5); - pDbgGrid->Add(m_pButtonUpdateScreen); - pDbgGrid->Add(m_pButtonClearScreen); - pDbgGrid->Add(m_pButtonClearTextureCache); - pDbgGrid->Add(m_pButtonClearVertexShaderCache); - pDbgGrid->Add(m_pButtonClearPixelShaderCache); - pDebugBox->Add(pDbgGrid); - - sMain->Add(pFlowCtrlBox, 0, 0, 5); - sMain->Add(pDebugBox, 0, 0, 5); + pDumpSzr->Add(m_pButtonDump, 0, wxALIGN_CENTER_VERTICAL); + pDumpSzr->Add(m_pDumpList, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, space3); + + wxGridSizer* const pDbgGrid = new wxGridSizer(2, space3, space3); + pDbgGrid->Add(m_pButtonUpdateScreen, 0, wxEXPAND); + pDbgGrid->Add(m_pButtonClearScreen, 0, wxEXPAND); + pDbgGrid->Add(m_pButtonClearTextureCache, 0, wxEXPAND); + pDbgGrid->Add(m_pButtonClearVertexShaderCache, 0, wxEXPAND); + pDbgGrid->Add(m_pButtonClearPixelShaderCache, 0, wxEXPAND); + + wxStaticBoxSizer* const pDebugBox = new wxStaticBoxSizer(wxVERTICAL, this, _("Debugging")); + pDebugBox->Add(pDumpSzr, 0, wxEXPAND); + pDebugBox->Add(pDbgGrid, 1, wxTOP, space3); + + sMain->Add(pFlowCtrlBox); + sMain->Add(pDebugBox); SetSizerAndFit(sMain); OnContinue(); @@ -248,12 +205,6 @@ void GFXDebuggerPanel::OnContinue() m_pButtonClearPixelShaderCache->Disable(); } -// General settings -void GFXDebuggerPanel::GeneralSettings(wxCommandEvent& event) -{ - SaveSettings(); -} - void GFXDebuggerPanel::OnPauseButton(wxCommandEvent& event) { GFXDebuggerPauseFlag = true; |
