mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-10 17:01:17 +12:00
UI: Use wxID_ANY and wxNOT_FOUND instead of hardcoding -1 (#1581)
This commit is contained in:
parent
02616bf6be
commit
152b790242
7 changed files with 48 additions and 48 deletions
|
@ -246,7 +246,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);
|
||||
if (sel != -1)
|
||||
if (sel != wxNOT_FOUND)
|
||||
{
|
||||
if (sel >= debuggerState.breakpoints.size())
|
||||
return;
|
||||
|
|
|
@ -126,7 +126,7 @@ void ModuleWindow::OnGameLoaded()
|
|||
void ModuleWindow::OnLeftDClick(wxMouseEvent& event)
|
||||
{
|
||||
long selected = m_modules->GetFirstSelected();
|
||||
if (selected == -1)
|
||||
if (selected == wxNOT_FOUND)
|
||||
return;
|
||||
const auto text = m_modules->GetItemText(selected, ColumnAddress);
|
||||
const auto address = std::stoul(text.ToStdString(), nullptr, 16);
|
||||
|
|
|
@ -107,7 +107,7 @@ wxString SymbolListCtrl::OnGetItemText(long item, long column) const
|
|||
void SymbolListCtrl::OnLeftDClick(wxListEvent& event)
|
||||
{
|
||||
long selected = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
|
||||
if (selected == -1)
|
||||
if (selected == wxNOT_FOUND)
|
||||
return;
|
||||
const auto text = GetItemText(selected, ColumnAddress);
|
||||
const auto address = std::stoul(text.ToStdString(), nullptr, 16);
|
||||
|
@ -120,7 +120,7 @@ void SymbolListCtrl::OnLeftDClick(wxListEvent& event)
|
|||
void SymbolListCtrl::OnRightClick(wxListEvent& event)
|
||||
{
|
||||
long selected = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
|
||||
if (selected == -1)
|
||||
if (selected == wxNOT_FOUND)
|
||||
return;
|
||||
auto text = GetItemText(selected, ColumnAddress);
|
||||
text = "0x" + text;
|
||||
|
@ -162,4 +162,4 @@ void SymbolListCtrl::ChangeListFilter(std::string filter)
|
|||
SetItemCount(visible_entries);
|
||||
if (visible_entries > 0)
|
||||
RefreshItems(GetTopItem(), std::min<long>(visible_entries - 1, GetTopItem() + GetCountPerPage() + 1));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue