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

@ -230,8 +230,8 @@ void BreakpointWindow::OnRightDown(wxMouseEvent& event)
}
else
{
m_breakpoints->SetItemState(index, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
m_breakpoints->SetItemState(index, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
m_breakpoints->Focus(index);
m_breakpoints->Select(index);
wxMenu menu;
menu.Append(MENU_ID_DELETE_BP, _("Delete breakpoint"));
@ -245,7 +245,7 @@ void BreakpointWindow::OnContextMenuClickSelected(wxCommandEvent& evt)
{
if (evt.GetId() == MENU_ID_DELETE_BP)
{
long sel = m_breakpoints->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
long sel = m_breakpoints->GetFirstSelected();
if (sel != wxNOT_FOUND)
{
if (sel >= debuggerState.breakpoints.size())

View file

@ -2,6 +2,7 @@
#include "gui/guiWrapper.h"
#include "Cafe/OS/RPL/rpl_symbol_storage.h"
#include "Cafe/HW/Espresso/Debugger/Debugger.h"
#include <wx/listctrl.h>
enum ItemColumns
{
@ -10,8 +11,7 @@ enum ItemColumns
ColumnModule,
};
SymbolListCtrl::SymbolListCtrl(wxWindow* parent, const wxWindowID& id, const wxPoint& pos, const wxSize& size) :
wxListCtrl(parent, id, pos, size, wxLC_REPORT | wxLC_VIRTUAL)
SymbolListCtrl::SymbolListCtrl(wxWindow* parent, const wxWindowID& id, const wxPoint& pos, const wxSize& size) : wxListView(parent, id, pos, size, wxLC_REPORT | wxLC_VIRTUAL)
{
wxListItem col0;
col0.SetId(ColumnName);
@ -106,7 +106,7 @@ wxString SymbolListCtrl::OnGetItemText(long item, long column) const
void SymbolListCtrl::OnLeftDClick(wxListEvent& event)
{
long selected = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
long selected = GetFirstSelected();
if (selected == wxNOT_FOUND)
return;
const auto text = GetItemText(selected, ColumnAddress);
@ -119,7 +119,7 @@ void SymbolListCtrl::OnLeftDClick(wxListEvent& event)
void SymbolListCtrl::OnRightClick(wxListEvent& event)
{
long selected = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
long selected = GetFirstSelected();
if (selected == wxNOT_FOUND)
return;
auto text = GetItemText(selected, ColumnAddress);

View file

@ -2,7 +2,7 @@
#include <wx/listctrl.h>
class SymbolListCtrl : public wxListCtrl
class SymbolListCtrl : public wxListView
{
public:
SymbolListCtrl(wxWindow* parent, const wxWindowID& id, const wxPoint& pos, const wxSize& size);