Clarified Patch Add/Edit, added AR Add/Edit by slink3

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2313 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY
2009-02-20 00:07:35 +00:00
parent a1cd6c982e
commit 4883727384
6 changed files with 77 additions and 6 deletions

View File

@ -82,7 +82,8 @@ void CPatchAddEdit::CreateGUIControls(int _selection)
sEditPatchName->Add(EditPatchNameText, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
sEditPatchName->Add(EditPatchName, 1, wxEXPAND|wxALL, 5);
sEditPatch->Add(sEditPatchName, 0, wxEXPAND);
wxStaticBoxSizer* sbEntry = new wxStaticBoxSizer(wxVERTICAL, this, _("Entry"));
sbEntry = new wxStaticBoxSizer(wxVERTICAL, this, wxString::Format(wxT("Entry 1/%d"), (int)tempEntries.size()));
currentItem = 1;
wxGridBagSizer* sgEntry = new wxGridBagSizer(0, 0);
sgEntry->AddGrowableCol(1);
sgEntry->Add(EditPatchType, wxGBPosition(0, 0), wxGBSpan(1, 2), wxEXPAND|wxALL, 5);
@ -119,6 +120,7 @@ void CPatchAddEdit::ChangeEntry(wxSpinEvent& event)
SaveEntryData(itCurEntry);
itCurEntry = tempEntries.end() - event.GetPosition() - 1;
currentItem = (int)tempEntries.size() - event.GetPosition();
UpdateEntryCtrls(*itCurEntry);
}
@ -154,6 +156,7 @@ void CPatchAddEdit::AddRemoveEntry(wxCommandEvent& event)
PatchEngine::PatchEntry peEmptyEntry(PatchEngine::PATCH_8BIT, 0x00000000, 0x00000000);
itCurEntry++;
currentItem++;
itCurEntry = tempEntries.insert(itCurEntry, peEmptyEntry);
EntrySelection->SetRange(EntrySelection->GetMin(), EntrySelection->GetMax() + 1);
@ -170,6 +173,7 @@ void CPatchAddEdit::AddRemoveEntry(wxCommandEvent& event)
if (itCurEntry != tempEntries.begin())
{
itCurEntry--;
currentItem--;
}
else
{
@ -191,6 +195,8 @@ void CPatchAddEdit::AddRemoveEntry(wxCommandEvent& event)
void CPatchAddEdit::UpdateEntryCtrls(PatchEngine::PatchEntry pE)
{
sbEntry->GetStaticBox()->SetLabel(wxString::Format(wxT("Entry %d/%d"), currentItem,
(int)tempEntries.size()));
EditPatchOffset->SetValue(wxString::Format(wxT("%08X"), pE.address));
EditPatchType->SetSelection(pE.type);
EditPatchValue->SetValue(wxString::Format(wxT("%08X"), pE.value));