From 09b3d2d227581585d6008432bed9911a4e1997b2 Mon Sep 17 00:00:00 2001 From: facugaich Date: Sat, 3 Jan 2009 23:02:13 +0000 Subject: Changed the way the iterator is used in PatchAddEdit, I thought I'd submit it since it makes for shorter code. Also a couple of bugfixes git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1755 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DolphinWX/Src/ARCodeAddEdit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/DolphinWX/Src/ARCodeAddEdit.cpp') diff --git a/Source/Core/DolphinWX/Src/ARCodeAddEdit.cpp b/Source/Core/DolphinWX/Src/ARCodeAddEdit.cpp index dec2c32518..c3194c48d2 100644 --- a/Source/Core/DolphinWX/Src/ARCodeAddEdit.cpp +++ b/Source/Core/DolphinWX/Src/ARCodeAddEdit.cpp @@ -45,8 +45,8 @@ void CARCodeAddEdit::CreateGUIControls(int _selection) EditCheatName = new wxTextCtrl(this, ID_EDITCHEAT_NAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); EditCheatName->SetValue(wxString::FromAscii(currentCode.name.c_str())); EntrySelection = new wxSpinButton(this, ID_ENTRY_SELECT, wxDefaultPosition, wxDefaultSize, wxVERTICAL); - EntrySelection->SetRange((int)arCodes.size()-1, 0); - EntrySelection->SetValue(_selection); + EntrySelection->SetRange(0, (int)arCodes.size()-1); + EntrySelection->SetValue((int)arCodes.size()-1 - _selection); EditCheatCode = new wxTextCtrl(this, ID_EDITCHEAT_CODE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE); UpdateTextCtrl(currentCode); wxGridBagSizer* sgEntry = new wxGridBagSizer(0, 0); @@ -76,7 +76,7 @@ void CARCodeAddEdit::OnClose(wxCloseEvent& WXUNUSED (event)) void CARCodeAddEdit::ChangeEntry(wxSpinEvent& event) { - ActionReplay::ARCode currentCode = arCodes.at(event.GetPosition()); + ActionReplay::ARCode currentCode = arCodes.at((int)arCodes.size()-1 - event.GetPosition()); EditCheatName->SetValue(wxString::FromAscii(currentCode.name.c_str())); UpdateTextCtrl(currentCode); } -- cgit v1.2.3