@@ -43,11 +43,9 @@ CheatDialog::CheatDialog(Core *core): wxDialog(nullptr, wxID_ANY, "Action Replay
43
43
44
44
// Set up the cheat name and code editors
45
45
wxBoxSizer *editSizer = new wxBoxSizer (wxVERTICAL);
46
- nameEditor = new wxTextCtrl ();
47
- nameEditor->Create (this , wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (size * 8 , size));
46
+ nameEditor = new wxTextCtrl (this , wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (size * 8 , size));
48
47
editSizer->Add (nameEditor, 0 , wxEXPAND | wxBOTTOM, size / 16 );
49
- codeEditor = new wxTextCtrl ();
50
- codeEditor->Create (this , wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
48
+ codeEditor = new wxTextCtrl (this , wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
51
49
editSizer->Add (codeEditor, 1 , wxEXPAND | wxTOP, size / 16 );
52
50
53
51
// Set up the cheat list and combine it with the editors
@@ -104,7 +102,7 @@ void CheatDialog::updateCheat()
104
102
{
105
103
p = code.find_first_of (" \n " , i);
106
104
if (p == std::string::npos) p = code.size ();
107
- cheat->code .push_back (strtol (code.substr (i, p).c_str (), nullptr , 16 ));
105
+ cheat->code .push_back (strtoll (code.substr (i, p).c_str (), nullptr , 16 ));
108
106
}
109
107
110
108
// Ensure the code's word count is a multiple of 2
@@ -124,10 +122,11 @@ void CheatDialog::selectCheat(wxCommandEvent &event)
124
122
// Select a new cheat and put its name in the editor
125
123
if (curCheat >= 0 ) updateCheat ();
126
124
ARCheat *cheat = &core->actionReplay .cheats [curCheat = event.GetInt ()];
127
- nameEditor->SetValue (cheat-> name );
128
- codeEditor-> Clear ( );
125
+ nameEditor->Clear ( );
126
+ nameEditor-> AppendText (cheat-> name );
129
127
130
128
// Write the code to the editor as a string
129
+ codeEditor->Clear ();
131
130
for (uint32_t i = 0 ; i < cheat->code .size (); i += 2 )
132
131
{
133
132
char line[19 ];
0 commit comments