Merge pull request #2456 from aserna3/master

UI improvements to Add AR Code and Add Patch windows.
This commit is contained in:
Fiora 2015-06-14 18:53:49 -07:00
commit c68bb0bdec
1 changed files with 7 additions and 6 deletions

View File

@ -30,7 +30,7 @@ CARCodeAddEdit::CARCodeAddEdit(int _selection, std::vector<ActionReplay::ARCode>
Bind(wxEVT_BUTTON, &CARCodeAddEdit::SaveCheatData, this, wxID_OK); Bind(wxEVT_BUTTON, &CARCodeAddEdit::SaveCheatData, this, wxID_OK);
ActionReplay::ARCode tempEntries; ActionReplay::ARCode tempEntries;
wxString currentName = _("Insert name here..."); wxString currentName;
if (selection == wxNOT_FOUND) if (selection == wxNOT_FOUND)
{ {
@ -47,6 +47,8 @@ CARCodeAddEdit::CARCodeAddEdit(int _selection, std::vector<ActionReplay::ARCode>
wxGridBagSizer* sgEntry = new wxGridBagSizer(0, 0); wxGridBagSizer* sgEntry = new wxGridBagSizer(0, 0);
wxStaticText* EditCheatNameText = new wxStaticText(this, wxID_ANY, _("Name:")); wxStaticText* EditCheatNameText = new wxStaticText(this, wxID_ANY, _("Name:"));
wxStaticText* EditCheatCodeText = new wxStaticText(this, wxID_ANY, _("Code:"));
EditCheatName = new wxTextCtrl(this, wxID_ANY, wxEmptyString); EditCheatName = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
EditCheatName->SetValue(currentName); EditCheatName->SetValue(currentName);
@ -56,12 +58,14 @@ CARCodeAddEdit::CARCodeAddEdit(int _selection, std::vector<ActionReplay::ARCode>
EntrySelection->Bind(wxEVT_SPIN, &CARCodeAddEdit::ChangeEntry, this); EntrySelection->Bind(wxEVT_SPIN, &CARCodeAddEdit::ChangeEntry, this);
EditCheatCode = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(300, 100), wxTE_MULTILINE); EditCheatCode = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(300, 100), wxTE_MULTILINE);
UpdateTextCtrl(tempEntries); UpdateTextCtrl(tempEntries);
sgEntry->Add(EditCheatNameText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER | wxALL, 5); sgEntry->Add(EditCheatNameText, wxGBPosition(0, 0), wxGBSpan(1, 1), wxALIGN_CENTER | wxALL, 5);
sgEntry->Add(EditCheatCodeText, wxGBPosition(1, 0), wxGBSpan(1, 1), wxALIGN_CENTER | wxALL, 5);
sgEntry->Add(EditCheatName, wxGBPosition(0, 1), wxGBSpan(1, 1), wxEXPAND | wxALL, 5); sgEntry->Add(EditCheatName, wxGBPosition(0, 1), wxGBSpan(1, 1), wxEXPAND | wxALL, 5);
sgEntry->Add(EntrySelection, wxGBPosition(0, 2), wxGBSpan(2, 1), wxEXPAND | wxALL, 5); sgEntry->Add(EntrySelection, wxGBPosition(0, 2), wxGBSpan(2, 1), wxEXPAND | wxALL, 5);
sgEntry->Add(EditCheatCode, wxGBPosition(1, 0), wxGBSpan(1, 2), wxEXPAND | wxALL, 5); sgEntry->Add(EditCheatCode, wxGBPosition(1, 1), wxGBSpan(1, 1), wxEXPAND | wxALL, 5);
sgEntry->AddGrowableCol(1); sgEntry->AddGrowableCol(1);
sgEntry->AddGrowableRow(1); sgEntry->AddGrowableRow(1);
sbEntry->Add(sgEntry, 1, wxEXPAND | wxALL); sbEntry->Add(sgEntry, 1, wxEXPAND | wxALL);
@ -176,8 +180,5 @@ void CARCodeAddEdit::UpdateTextCtrl(ActionReplay::ARCode arCode)
for (auto& op : arCode.ops) for (auto& op : arCode.ops)
EditCheatCode->AppendText(wxString::Format("%08X %08X\n", op.cmd_addr, op.value)); EditCheatCode->AppendText(wxString::Format("%08X %08X\n", op.cmd_addr, op.value));
} }
else
{
EditCheatCode->SetValue(_("Insert Encrypted or Decrypted code here..."));
}
} }