Skip to content
Permalink
Browse files

Merge pull request #4068 from EmptyChaos/wx-hidpi

WX: Comprehensive HiDPI Patch
  • Loading branch information...
shuffle2 committed Oct 4, 2016
2 parents 4573cc8 + c4f5ced commit b8731eb8180d76b4663eaf4188f985b9c5fa6fb2
Showing with 4,419 additions and 3,167 deletions.
  1. +3 −0 Externals/wxWidgets3/src/generic/tipwin.cpp
  2. +11 −10 Source/Core/Core/ConfigManager.cpp
  3. +5 −2 Source/Core/Core/ConfigManager.h
  4. +17 −11 Source/Core/DolphinWX/AboutDolphin.cpp
  5. +1 −0 Source/Core/DolphinWX/CMakeLists.txt
  6. +82 −43 Source/Core/DolphinWX/Cheats/CheatSearchTab.cpp
  7. +8 −1 Source/Core/DolphinWX/Cheats/CheatSearchTab.h
  8. +41 −24 Source/Core/DolphinWX/Cheats/CheatsWindow.cpp
  9. +3 −2 Source/Core/DolphinWX/Cheats/CheatsWindow.h
  10. +25 −25 Source/Core/DolphinWX/Cheats/CreateCodeDialog.cpp
  11. +0 −2 Source/Core/DolphinWX/Cheats/CreateCodeDialog.h
  12. +29 −27 Source/Core/DolphinWX/Cheats/GeckoCodeDiag.cpp
  13. +31 −32 Source/Core/DolphinWX/Config/AdvancedConfigPane.cpp
  14. +2 −2 Source/Core/DolphinWX/Config/AdvancedConfigPane.h
  15. +38 −21 Source/Core/DolphinWX/Config/AudioConfigPane.cpp
  16. +2 −2 Source/Core/DolphinWX/Config/AudioConfigPane.h
  17. +10 −3 Source/Core/DolphinWX/Config/ConfigMain.cpp
  18. +7 −5 Source/Core/DolphinWX/Config/GCAdapterConfigDiag.cpp
  19. +27 −18 Source/Core/DolphinWX/Config/GameCubeConfigPane.cpp
  20. +31 −12 Source/Core/DolphinWX/Config/GeneralConfigPane.cpp
  21. +28 −15 Source/Core/DolphinWX/Config/InterfaceConfigPane.cpp
  22. +27 −23 Source/Core/DolphinWX/Config/PathConfigPane.cpp
  23. +46 −38 Source/Core/DolphinWX/Config/WiiConfigPane.cpp
  24. +3 −2 Source/Core/DolphinWX/Config/WiiConfigPane.h
  25. +97 −79 Source/Core/DolphinWX/ControllerConfigDiag.cpp
  26. +4 −5 Source/Core/DolphinWX/ControllerConfigDiag.h
  27. +9 −5 Source/Core/DolphinWX/Debugger/BreakpointDlg.cpp
  28. +2 −2 Source/Core/DolphinWX/Debugger/BreakpointView.cpp
  29. +1 −1 Source/Core/DolphinWX/Debugger/BreakpointView.h
  30. +11 −13 Source/Core/DolphinWX/Debugger/BreakpointWindow.cpp
  31. +6 −6 Source/Core/DolphinWX/Debugger/BreakpointWindow.h
  32. +127 −105 Source/Core/DolphinWX/Debugger/CodeView.cpp
  33. +3 −11 Source/Core/DolphinWX/Debugger/CodeView.h
  34. +72 −71 Source/Core/DolphinWX/Debugger/CodeWindow.cpp
  35. +81 −26 Source/Core/DolphinWX/Debugger/CodeWindow.h
  36. +78 −136 Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp
  37. +20 −26 Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp
  38. +2 −2 Source/Core/DolphinWX/Debugger/DSPDebugWindow.h
  39. +2 −2 Source/Core/DolphinWX/Debugger/DSPRegisterView.cpp
  40. +1 −1 Source/Core/DolphinWX/Debugger/DSPRegisterView.h
  41. +38 −87 Source/Core/DolphinWX/Debugger/DebuggerPanel.cpp
  42. +0 −6 Source/Core/DolphinWX/Debugger/DebuggerPanel.h
  43. +6 −8 Source/Core/DolphinWX/Debugger/JitWindow.cpp
  44. +2 −2 Source/Core/DolphinWX/Debugger/JitWindow.h
  45. +27 −10 Source/Core/DolphinWX/Debugger/MemoryCheckDlg.cpp
  46. +187 −166 Source/Core/DolphinWX/Debugger/MemoryView.cpp
  47. +19 −19 Source/Core/DolphinWX/Debugger/MemoryView.h
  48. +169 −241 Source/Core/DolphinWX/Debugger/MemoryWindow.cpp
  49. +20 −23 Source/Core/DolphinWX/Debugger/MemoryWindow.h
  50. +7 −5 Source/Core/DolphinWX/Debugger/RegisterView.cpp
  51. +2 −2 Source/Core/DolphinWX/Debugger/RegisterView.h
  52. +2 −2 Source/Core/DolphinWX/Debugger/RegisterWindow.cpp
  53. +8 −6 Source/Core/DolphinWX/Debugger/WatchView.cpp
  54. +1 −1 Source/Core/DolphinWX/Debugger/WatchView.h
  55. +6 −3 Source/Core/DolphinWX/Debugger/WatchWindow.cpp
  56. +126 −0 Source/Core/DolphinWX/DolphinSlider.cpp
  57. +51 −0 Source/Core/DolphinWX/DolphinSlider.h
  58. +2 −0 Source/Core/DolphinWX/DolphinWX.vcxproj
  59. +10 −1 Source/Core/DolphinWX/DolphinWX.vcxproj.filters
  60. +146 −157 Source/Core/DolphinWX/FifoPlayerDlg.cpp
  61. +0 −1 Source/Core/DolphinWX/FifoPlayerDlg.h
  62. +46 −48 Source/Core/DolphinWX/Frame.cpp
  63. +9 −8 Source/Core/DolphinWX/Frame.h
  64. +110 −89 Source/Core/DolphinWX/FrameAui.cpp
  65. +51 −86 Source/Core/DolphinWX/FrameTools.cpp
  66. +80 −47 Source/Core/DolphinWX/GameListCtrl.cpp
  67. +2 −1 Source/Core/DolphinWX/GameListCtrl.h
  68. +6 −2 Source/Core/DolphinWX/Globals.h
  69. +8 −26 Source/Core/DolphinWX/ISOFile.cpp
  70. +4 −4 Source/Core/DolphinWX/ISOFile.h
  71. +129 −96 Source/Core/DolphinWX/ISOProperties.cpp
  72. +2 −2 Source/Core/DolphinWX/ISOProperties.h
  73. +250 −141 Source/Core/DolphinWX/InputConfigDiag.cpp
  74. +20 −12 Source/Core/DolphinWX/InputConfigDiag.h
  75. +219 −174 Source/Core/DolphinWX/InputConfigDiagBitmaps.cpp
  76. +12 −16 Source/Core/DolphinWX/LogConfigWindow.cpp
  77. +0 −1 Source/Core/DolphinWX/LogConfigWindow.h
  78. +11 −7 Source/Core/DolphinWX/LogWindow.cpp
  79. +5 −2 Source/Core/DolphinWX/LogWindow.h
  80. +6 −42 Source/Core/DolphinWX/Main.cpp
  81. +106 −92 Source/Core/DolphinWX/MemcardManager.cpp
  82. +1 −0 Source/Core/DolphinWX/MemcardManager.h
  83. +7 −2 Source/Core/DolphinWX/NetPlay/ChangeGameDialog.cpp
  84. +38 −24 Source/Core/DolphinWX/NetPlay/MD5Dialog.cpp
  85. +168 −133 Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp
  86. +5 −2 Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.h
  87. +131 −63 Source/Core/DolphinWX/NetPlay/NetWindow.cpp
  88. +9 −1 Source/Core/DolphinWX/NetPlay/NetWindow.h
  89. +37 −52 Source/Core/DolphinWX/NetPlay/PadMapDialog.cpp
  90. +2 −0 Source/Core/DolphinWX/NetPlay/PadMapDialog.h
  91. +26 −19 Source/Core/DolphinWX/PatchAddEdit.cpp
  92. +64 −52 Source/Core/DolphinWX/PostProcessingConfigDiag.cpp
  93. +13 −10 Source/Core/DolphinWX/PostProcessingConfigDiag.h
  94. +42 −23 Source/Core/DolphinWX/SoftwareVideoConfigDialog.cpp
  95. +174 −133 Source/Core/DolphinWX/TASInputDlg.cpp
  96. +20 −23 Source/Core/DolphinWX/TASInputDlg.h
  97. +221 −142 Source/Core/DolphinWX/VideoConfigDiag.cpp
  98. +4 −5 Source/Core/DolphinWX/VideoConfigDiag.h
  99. +447 −33 Source/Core/DolphinWX/WxUtils.cpp
  100. +112 −3 Source/Core/DolphinWX/WxUtils.h
@@ -218,6 +218,9 @@ void wxTipWindow::Close()
*m_windowPtr = NULL;
m_windowPtr = NULL;
}
// XXX: Dolphin: Prevents an assertion failure due to Close being called multiple times.
if (!IsShown())
return;

#if wxUSE_POPUPWIN
Show(false);
@@ -3,6 +3,7 @@
// Refer to the license.txt file included.

#include <cinttypes>
#include <climits>
#include <memory>

#include "Common/CDUtils.h"
@@ -138,8 +139,8 @@ void SConfig::SaveInterfaceSettings(IniFile& ini)
interface->Set("OnScreenDisplayMessages", bOnScreenDisplayMessages);
interface->Set("HideCursor", bHideCursor);
interface->Set("AutoHideCursor", bAutoHideCursor);
interface->Set("MainWindowPosX", (iPosX == -32000) ? 0 : iPosX); // TODO - HAX
interface->Set("MainWindowPosY", (iPosY == -32000) ? 0 : iPosY); // TODO - HAX
interface->Set("MainWindowPosX", iPosX);
interface->Set("MainWindowPosY", iPosY);
interface->Set("MainWindowWidth", iWidth);
interface->Set("MainWindowHeight", iHeight);
interface->Set("LanguageCode", m_InterfaceLanguage);
@@ -402,10 +403,10 @@ void SConfig::LoadInterfaceSettings(IniFile& ini)
interface->Get("OnScreenDisplayMessages", &bOnScreenDisplayMessages, true);
interface->Get("HideCursor", &bHideCursor, false);
interface->Get("AutoHideCursor", &bAutoHideCursor, false);
interface->Get("MainWindowPosX", &iPosX, 100);
interface->Get("MainWindowPosY", &iPosY, 100);
interface->Get("MainWindowWidth", &iWidth, 800);
interface->Get("MainWindowHeight", &iHeight, 600);
interface->Get("MainWindowPosX", &iPosX, INT_MIN);
interface->Get("MainWindowPosY", &iPosY, INT_MIN);
interface->Get("MainWindowWidth", &iWidth, -1);
interface->Get("MainWindowHeight", &iHeight, -1);
interface->Get("LanguageCode", &m_InterfaceLanguage, "");
interface->Get("ShowToolbar", &m_InterfaceToolbar, true);
interface->Get("ShowStatusbar", &m_InterfaceStatusbar, true);
@@ -663,10 +664,10 @@ void SConfig::LoadDefaults()
bDPL2Decoder = false;
iLatency = 14;

iPosX = 100;
iPosY = 100;
iWidth = 800;
iHeight = 600;
iPosX = INT_MIN;
iPosY = INT_MIN;
iWidth = -1;
iHeight = -1;

m_analytics_id = "";
m_analytics_enabled = false;
@@ -4,6 +4,7 @@

#pragma once

#include <limits>
#include <string>
#include <vector>

@@ -129,8 +130,10 @@ struct SConfig : NonCopyable

// Display settings
std::string strFullscreenResolution;
int iRenderWindowXPos = -1, iRenderWindowYPos = -1;
int iRenderWindowWidth = 640, iRenderWindowHeight = 480;
int iRenderWindowXPos = std::numeric_limits<int>::min();
int iRenderWindowYPos = std::numeric_limits<int>::min();
int iRenderWindowWidth = -1;
int iRenderWindowHeight = -1;
bool bRenderWindowAutoSize = false, bKeepWindowOnTop = false;
bool bFullscreen = false, bRenderToMain = false;
bool bProgressive = false, bPAL60 = false;
@@ -20,8 +20,8 @@ AboutDolphin::AboutDolphin(wxWindow* parent, wxWindowID id, const wxString& titl
const wxPoint& position, const wxSize& size, long style)
: wxDialog(parent, id, title, position, size, style)
{
wxGenericStaticBitmap* const sbDolphinLogo =
new wxGenericStaticBitmap(this, wxID_ANY, WxUtils::LoadResourceBitmap("dolphin_logo"));
wxGenericStaticBitmap* const sbDolphinLogo = new wxGenericStaticBitmap(
this, wxID_ANY, WxUtils::LoadScaledResourceBitmap("dolphin_logo", this));

const wxString DolphinText = _("Dolphin");
const wxString RevisionText = scm_desc_str;
@@ -80,6 +80,12 @@ AboutDolphin::AboutDolphin(wxWindow* parent, wxWindowID id, const wxString& titl

wxSizerFlags center_flag;
center_flag.Center();
const int space5 = FromDIP(5);
const int space10 = FromDIP(10);
const int space15 = FromDIP(15);
const int space30 = FromDIP(30);
const int space40 = FromDIP(40);
const int space75 = FromDIP(75);

wxBoxSizer* const sCheckUpdates = new wxBoxSizer(wxHORIZONTAL);
sCheckUpdates->Add(UpdateText, center_flag);
@@ -94,30 +100,30 @@ AboutDolphin::AboutDolphin(wxWindow* parent, wxWindowID id, const wxString& titl

wxBoxSizer* const sInfo = new wxBoxSizer(wxVERTICAL);
sInfo->Add(Dolphin);
sInfo->AddSpacer(5);
sInfo->AddSpacer(space5);
sInfo->Add(Revision);
sInfo->AddSpacer(10);
sInfo->AddSpacer(space10);
sInfo->Add(Branch);
sInfo->Add(sCheckUpdates);
sInfo->Add(Message);
sInfo->Add(sLinks);

wxBoxSizer* const sLogo = new wxBoxSizer(wxVERTICAL);
sLogo->AddSpacer(75);
sLogo->AddSpacer(space75);
sLogo->Add(sbDolphinLogo);
sLogo->AddSpacer(40);
sLogo->AddSpacer(space40);

wxBoxSizer* const sMainHor = new wxBoxSizer(wxHORIZONTAL);
sMainHor->AddSpacer(30);
sMainHor->AddSpacer(space30);
sMainHor->Add(sLogo);
sMainHor->AddSpacer(30);
sMainHor->AddSpacer(space30);
sMainHor->Add(sInfo);
sMainHor->AddSpacer(30);
sMainHor->AddSpacer(space30);

wxBoxSizer* const sFooter = new wxBoxSizer(wxVERTICAL);
sFooter->AddSpacer(15);
sFooter->AddSpacer(space15);
sFooter->Add(Copyright, 0, wxALIGN_CENTER_HORIZONTAL);
sFooter->AddSpacer(5);
sFooter->AddSpacer(space5);

wxBoxSizer* const sMain = new wxBoxSizer(wxVERTICAL);
sMain->Add(sMainHor, 1, wxEXPAND);
@@ -40,6 +40,7 @@ set(GUI_SRCS
NetPlay/NetPlaySetupFrame.cpp
NetPlay/NetWindow.cpp
NetPlay/PadMapDialog.cpp
DolphinSlider.cpp
FifoPlayerDlg.cpp
Frame.cpp
FrameAui.cpp
@@ -27,10 +27,7 @@
#include "DolphinWX/Cheats/CreateCodeDialog.h"
#include "DolphinWX/WxUtils.h"

namespace
{
const unsigned int MAX_CHEAT_SEARCH_RESULTS_DISPLAY = 1024;
}
static constexpr unsigned int MAX_CHEAT_SEARCH_RESULTS_DISPLAY = 1024;

CheatSearchTab::CheatSearchTab(wxWindow* const parent) : wxPanel(parent)
{
@@ -39,13 +36,25 @@ CheatSearchTab::CheatSearchTab(wxWindow* const parent) : wxPanel(parent)

// first scan button
m_btn_init_scan = new wxButton(this, wxID_ANY, _("New Scan"));
m_btn_init_scan->SetToolTip(_("Perform a full index of the game's RAM at the current Data Size. "
"Required before any Searching can be performed."));
m_btn_init_scan->Bind(wxEVT_BUTTON, &CheatSearchTab::OnNewScanClicked, this);
m_btn_init_scan->Disable();

// next scan button
m_btn_next_scan = new wxButton(this, wxID_ANY, _("Next Scan"));
m_btn_next_scan->SetToolTip(_("Eliminate items from the current scan results that do not match "
"the current Search settings."));
m_btn_next_scan->Bind(wxEVT_BUTTON, &CheatSearchTab::OnNextScanClicked, this);
m_btn_next_scan->Disable();

m_label_scan_disabled = new wxStaticText(this, wxID_ANY, _("No game is running."));

// create AR code button
m_btn_create_code = new wxButton(this, wxID_ANY, _("Create AR Code"));
m_btn_create_code->Bind(wxEVT_BUTTON, &CheatSearchTab::OnCreateARCodeClicked, this);
m_btn_create_code->Disable();

// data sizes radiobox
std::array<wxString, 3> data_size_names = {{_("8-bit"), _("16-bit"), _("32-bit")}};
m_data_sizes = new wxRadioBox(this, wxID_ANY, _("Data Size"), wxDefaultPosition, wxDefaultSize,
@@ -54,30 +63,39 @@ CheatSearchTab::CheatSearchTab(wxWindow* const parent) : wxPanel(parent)
// ListView for search results
m_lview_search_results = new wxListView(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
wxLC_REPORT | wxLC_SINGLE_SEL);
ResetListViewColumns();
m_lview_search_results->AppendColumn(_("Address"));
m_lview_search_results->AppendColumn(_("Value"));
m_lview_search_results->AppendColumn(_("Value (float)"));
m_lview_search_results->AppendColumn(_("Value (double)"));
m_lview_search_results->Bind(wxEVT_LIST_ITEM_ACTIVATED, &CheatSearchTab::OnListViewItemActivated,
this);
m_lview_search_results->Bind(wxEVT_LIST_ITEM_SELECTED, &CheatSearchTab::OnListViewItemSelected,
this);
m_lview_search_results->Bind(wxEVT_LIST_ITEM_DESELECTED, &CheatSearchTab::OnListViewItemSelected,
this);

// Result count
m_label_results_count = new wxStaticText(this, wxID_ANY, _("Count:"));

// create AR code button
wxButton* const button_cheat_search_copy_address =
new wxButton(this, wxID_ANY, _("Create AR Code"));
button_cheat_search_copy_address->Bind(wxEVT_BUTTON, &CheatSearchTab::OnCreateARCodeClicked,
this);
const int space5 = FromDIP(5);

// results groupbox
wxStaticBoxSizer* const sizer_cheat_search_results =
new wxStaticBoxSizer(wxVERTICAL, this, _("Results"));
sizer_cheat_search_results->Add(m_label_results_count, 0, wxALIGN_LEFT | wxALL, 5);
sizer_cheat_search_results->Add(m_lview_search_results, 1, wxEXPAND | wxALL, 5);
sizer_cheat_search_results->Add(button_cheat_search_copy_address, 0,
wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, 5);
sizer_cheat_search_results->AddSpacer(space5);
sizer_cheat_search_results->Add(m_label_results_count, 0, wxLEFT | wxRIGHT, space5);
sizer_cheat_search_results->AddSpacer(space5);
sizer_cheat_search_results->Add(m_lview_search_results, 1, wxEXPAND | wxLEFT | wxRIGHT, space5);
sizer_cheat_search_results->AddSpacer(space5);
sizer_cheat_search_results->Add(m_btn_create_code, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
sizer_cheat_search_results->AddSpacer(space5);

// search value textbox
m_textctrl_value_x = new wxTextCtrl(this, wxID_ANY, "0x0", wxDefaultPosition, wxSize(96, -1));

wxBoxSizer* const sizer_cheat_filter_text = new wxBoxSizer(wxHORIZONTAL);
sizer_cheat_filter_text->Add(m_textctrl_value_x, 1, wxALIGN_CENTER_VERTICAL, 5);
m_textctrl_value_x = new wxTextCtrl(this, wxID_ANY, "0x0");
m_textctrl_value_x->SetMinSize(WxUtils::GetTextWidgetMinSize(m_textctrl_value_x, "0x00000000 "));
m_textctrl_value_x->SetToolTip(
_("Value to match against. Can be Hex (\"0x\"), Octal (\"0\") or Decimal. "
"Leave blank to filter each result against its own previous value."));

// Filter types in the compare dropdown
// TODO: Implement between search
@@ -93,33 +111,46 @@ CheatSearchTab::CheatSearchTab(wxWindow* const parent) : wxPanel(parent)

wxStaticBoxSizer* const sizer_cheat_search_filter =
new wxStaticBoxSizer(wxVERTICAL, this, _("Search (clear to use previous value)"));
sizer_cheat_search_filter->Add(sizer_cheat_filter_text, 0, wxALL | wxEXPAND, 5);
sizer_cheat_search_filter->Add(m_search_type, 0, wxALL, 5);

// left sizer
wxBoxSizer* const sizer_left = new wxBoxSizer(wxVERTICAL);
sizer_left->Add(sizer_cheat_search_results, 1, wxEXPAND, 5);
sizer_cheat_search_filter->AddSpacer(space5);
sizer_cheat_search_filter->Add(m_textctrl_value_x, 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
sizer_cheat_search_filter->AddSpacer(space5);
sizer_cheat_search_filter->Add(m_search_type, 0, wxLEFT | wxRIGHT, space5);
sizer_cheat_search_filter->AddSpacer(space5);

// button sizer
wxBoxSizer* boxButtons = new wxBoxSizer(wxHORIZONTAL);
boxButtons->Add(m_btn_init_scan, 1, wxRIGHT, 5);
boxButtons->Add(m_btn_next_scan, 1);
boxButtons->Add(m_btn_init_scan, 1);
boxButtons->Add(m_btn_next_scan, 1, wxLEFT, space5);

// right sizer
wxBoxSizer* const sizer_right = new wxBoxSizer(wxVERTICAL);
sizer_right->Add(m_data_sizes, 0, wxEXPAND | wxBOTTOM, 5);
sizer_right->Add(sizer_cheat_search_filter, 0, wxEXPAND | wxBOTTOM, 5);
sizer_right->Add(m_data_sizes, 0, wxEXPAND);
sizer_right->Add(sizer_cheat_search_filter, 0, wxEXPAND | wxTOP, space5);
sizer_right->AddStretchSpacer(1);
sizer_right->Add(boxButtons, 0, wxTOP | wxEXPAND, 5);
sizer_right->Add(m_label_scan_disabled, 0, wxALIGN_CENTER_HORIZONTAL | wxTOP, space5);
sizer_right->Add(boxButtons, 0, wxEXPAND | wxTOP, space5);

// main sizer
wxBoxSizer* const sizer_main = new wxBoxSizer(wxHORIZONTAL);
sizer_main->Add(sizer_left, 1, wxEXPAND | wxALL, 5);
sizer_main->Add(sizer_right, 0, wxEXPAND | wxALL, 5);
sizer_main->AddSpacer(space5);
sizer_main->Add(sizer_cheat_search_results, 1, wxEXPAND | wxTOP | wxBOTTOM, space5);
sizer_main->AddSpacer(space5);
sizer_main->Add(sizer_right, 0, wxEXPAND | wxTOP | wxBOTTOM, space5);
sizer_main->AddSpacer(space5);

SetSizerAndFit(sizer_main);
}

void CheatSearchTab::UpdateGUI()
{
bool core_running = Core::IsRunning();
m_btn_init_scan->Enable(core_running);
m_btn_next_scan->Enable(core_running && m_scan_is_initialized);
m_label_scan_disabled->Show(!core_running);

Layout(); // Label shown/hidden may require layout adjustment
}

void CheatSearchTab::OnNewScanClicked(wxCommandEvent& WXUNUSED(event))
{
if (!Core::IsRunningAndStarted())
@@ -136,6 +167,7 @@ void CheatSearchTab::OnNewScanClicked(wxCommandEvent& WXUNUSED(event))
m_search_results.reserve(Memory::RAM_SIZE / m_search_type_size);

// Enable the "Next Scan" button.
m_scan_is_initialized = true;
m_btn_next_scan->Enable();

CheatSearchResult r;
@@ -183,15 +215,30 @@ void CheatSearchTab::OnCreateARCodeClicked(wxCommandEvent&)
arcode_dlg.ShowModal();
}

void CheatSearchTab::OnListViewItemActivated(wxListEvent&)
{
if (!m_btn_create_code->IsEnabled())
return;

wxCommandEvent fake(wxEVT_BUTTON, m_btn_create_code->GetId());
m_btn_create_code->GetEventHandler()->ProcessEvent(fake);
}

void CheatSearchTab::OnListViewItemSelected(wxListEvent&)
{
// Toggle "Create AR Code" Button
m_btn_create_code->Enable(m_lview_search_results->GetSelectedItemCount() > 0);
}

void CheatSearchTab::OnTimerUpdate(wxTimerEvent&)
{
if (Core::GetState() != Core::CORE_RUN)
return;

// Only update the currently visible list rows.
long first = m_lview_search_results->GetTopItem();
long last =
std::min(m_lview_search_results->GetItemCount(), m_lview_search_results->GetCountPerPage());
long last = std::min<long>(m_lview_search_results->GetItemCount(),
first + m_lview_search_results->GetCountPerPage());

m_lview_search_results->Freeze();

@@ -207,8 +254,8 @@ void CheatSearchTab::OnTimerUpdate(wxTimerEvent&)
void CheatSearchTab::UpdateCheatSearchResultsList()
{
m_update_timer.Stop();
m_lview_search_results->ClearAll();
ResetListViewColumns();
m_lview_search_results->DeleteAllItems();
m_btn_create_code->Disable();

wxString count_label = wxString::Format(_("Count: %lu"), (unsigned long)m_search_results.size());
if (m_search_results.size() > MAX_CHEAT_SEARCH_RESULTS_DISPLAY)
@@ -312,14 +359,6 @@ void CheatSearchTab::FilterCheatSearchResults(u32 value, bool prev)
m_search_results.swap(filtered_results);
}

void CheatSearchTab::ResetListViewColumns()
{
m_lview_search_results->AppendColumn(_("Address"));
m_lview_search_results->AppendColumn(_("Value"));
m_lview_search_results->AppendColumn(_("Value (float)"));
m_lview_search_results->AppendColumn(_("Value (double)"));
}

bool CheatSearchTab::ParseUserEnteredValue(u32* out) const
{
unsigned long parsed_x_val = 0;
Oops, something went wrong.

0 comments on commit b8731eb

Please sign in to comment.
You can’t perform that action at this time.