UI: Use wxListView instead of wxListCtrl (#1584)
Some checks failed
Generate translation template / generate-pot (push) Failing after 36s
Build check / build (push) Has been cancelled

This commit is contained in:
oltolm 2025-06-10 08:15:25 +02:00 committed by GitHub
parent 3eff2d4a60
commit 2eec6b44c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 61 additions and 65 deletions

View file

@ -5,6 +5,7 @@
#include <vector>
#include <sstream>
#include <thread>
#include <wx/listctrl.h>
#include "config/ActiveSettings.h"
#include "gui/helpers/wxHelpers.h"
@ -79,7 +80,7 @@ MemorySearcherTool::MemorySearcherTool(wxFrame* parent)
m_gauge->Enable(false);
m_textEntryTable = new wxStaticText(this, wxID_ANY, _("Results"));
m_listResults = new wxListCtrl(this, LIST_RESULTS, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_SORT_ASCENDING);
m_listResults = new wxListView(this, LIST_RESULTS, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_SORT_ASCENDING);
m_listResults->Bind(wxEVT_LEFT_DCLICK, &MemorySearcherTool::OnResultListClick, this);
{
wxListItem col0;
@ -388,14 +389,8 @@ void MemorySearcherTool::OnEntryListRightClick(wxDataViewEvent& event)
void MemorySearcherTool::OnResultListClick(wxMouseEvent& event)
{
long selectedIndex = -1;
while (true)
for (long selectedIndex = m_listResults->GetFirstSelected(); selectedIndex != wxNOT_FOUND; selectedIndex = m_listResults->GetNextSelected(selectedIndex))
{
selectedIndex = m_listResults->GetNextItem(selectedIndex, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (selectedIndex == wxNOT_FOUND)
break;
long address = m_listResults->GetItemData(selectedIndex);
auto currValue = m_listResults->GetItemText(selectedIndex, 1);