DolphinWX: Specify wxID_ANY where -1 is used in controls

This commit is contained in:
Lioncash
2014-12-01 22:56:18 -05:00
parent 64124a0d21
commit 10bfbebc78
16 changed files with 100 additions and 100 deletions

View File

@ -30,14 +30,14 @@ namespace
}
CheatSearchTab::CheatSearchTab(wxWindow* const parent)
: wxPanel(parent, -1)
: wxPanel(parent)
{
// first scan button
m_btn_init_scan = new wxButton(this, -1, _("New Scan"));
m_btn_init_scan = new wxButton(this, wxID_ANY, _("New Scan"));
m_btn_init_scan->Bind(wxEVT_BUTTON, &CheatSearchTab::StartNewSearch, this);
// next scan button
m_btn_next_scan = new wxButton(this, -1, _("Next Scan"));
m_btn_next_scan = new wxButton(this, wxID_ANY, _("Next Scan"));
m_btn_next_scan->Bind(wxEVT_BUTTON, &CheatSearchTab::FilterCheatSearchResults, this);
m_btn_next_scan->Disable();
@ -46,16 +46,16 @@ CheatSearchTab::CheatSearchTab(wxWindow* const parent)
m_data_sizes = new wxRadioBox(this, wxID_ANY, _("Data Size"), wxDefaultPosition, wxDefaultSize, static_cast<int>(data_size_names.size()), data_size_names.data());
// Listbox for search results (shown in monospace font).
m_lbox_search_results = new wxListBox(this, -1);
m_lbox_search_results = new wxListBox(this, wxID_ANY);
wxFont list_font = m_lbox_search_results->GetFont();
list_font.SetFamily(wxFONTFAMILY_TELETYPE);
m_lbox_search_results->SetFont(list_font);
// Result count
m_label_results_count = new wxStaticText(this, -1, _("Count:"));
m_label_results_count = new wxStaticText(this, wxID_ANY, _("Count:"));
// create AR code button
wxButton* const button_cheat_search_copy_address = new wxButton(this, -1, _("Create AR Code"));
wxButton* const button_cheat_search_copy_address = new wxButton(this, wxID_ANY, _("Create AR Code"));
button_cheat_search_copy_address->Bind(wxEVT_BUTTON, &CheatSearchTab::CreateARCode, this);
// results groupbox
@ -65,12 +65,12 @@ CheatSearchTab::CheatSearchTab(wxWindow* const parent)
sizer_cheat_search_results->Add(button_cheat_search_copy_address, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, 5);
// Search value radio buttons
m_value_x_radiobtn.rad_oldvalue = new wxRadioButton(this, -1, _("Previous Value"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
m_value_x_radiobtn.rad_uservalue = new wxRadioButton(this, -1, "");
m_value_x_radiobtn.rad_oldvalue = new wxRadioButton(this, wxID_ANY, _("Previous Value"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
m_value_x_radiobtn.rad_uservalue = new wxRadioButton(this, wxID_ANY, "");
m_value_x_radiobtn.rad_oldvalue->SetValue(true);
// search value textbox
m_textctrl_value_x = new wxTextCtrl(this, -1, "0x0", wxDefaultPosition, wxSize(96,-1));
m_textctrl_value_x = new wxTextCtrl(this, wxID_ANY, "0x0", wxDefaultPosition, wxSize(96, -1));
m_textctrl_value_x->Bind(wxEVT_SET_FOCUS, &CheatSearchTab::ApplyFocus, this);
wxBoxSizer* const sizer_cheat_filter_text = new wxBoxSizer(wxHORIZONTAL);
@ -93,7 +93,7 @@ CheatSearchTab::CheatSearchTab(wxWindow* const parent)
//_("Between"),
};
m_search_type = new wxChoice(this, -1, wxDefaultPosition, wxDefaultSize, sizeof(searches)/sizeof(*searches), searches);
m_search_type = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, sizeof(searches) / sizeof(*searches), searches);
m_search_type->Select(0);
wxStaticBoxSizer* const sizer_cheat_search_filter = new wxStaticBoxSizer(wxVERTICAL, this, _("Search Filter"));

View File

@ -21,20 +21,20 @@
wxDEFINE_EVENT(UPDATE_CHEAT_LIST_EVENT, wxCommandEvent);
CreateCodeDialog::CreateCodeDialog(wxWindow* const parent, const u32 address)
: wxDialog(parent, -1, _("Create AR Code"))
: wxDialog(parent, wxID_ANY, _("Create AR Code"))
, m_code_address(address)
{
wxStaticText* const label_name = new wxStaticText(this, -1, _("Name: "));
m_textctrl_name = new wxTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, wxSize(256,-1));
wxStaticText* const label_name = new wxStaticText(this, wxID_ANY, _("Name: "));
m_textctrl_name = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(256, -1));
wxStaticText* const label_code = new wxStaticText(this, -1, _("Code: "));
m_textctrl_code = new wxTextCtrl(this, -1, wxString::Format("0x%08x", address));
wxStaticText* const label_code = new wxStaticText(this, wxID_ANY, _("Code: "));
m_textctrl_code = new wxTextCtrl(this, wxID_ANY, wxString::Format("0x%08x", address));
m_textctrl_code->Disable();
wxStaticText* const label_value = new wxStaticText(this, -1, _("Value: "));
m_textctrl_value = new wxTextCtrl(this, -1, "0");
wxStaticText* const label_value = new wxStaticText(this, wxID_ANY, _("Value: "));
m_textctrl_value = new wxTextCtrl(this, wxID_ANY, "0");
m_checkbox_use_hex = new wxCheckBox(this, -1, _("Use Hex"));
m_checkbox_use_hex = new wxCheckBox(this, wxID_ANY, _("Use Hex"));
m_checkbox_use_hex->SetValue(true);
wxBoxSizer* const sizer_value_label = new wxBoxSizer(wxHORIZONTAL);

View File

@ -38,17 +38,17 @@ static const wxString wxstr_name(wxTRANSLATE("Name: ")),
wxstr_creator(wxTRANSLATE("Creator: "));
CodeConfigPanel::CodeConfigPanel(wxWindow* const parent)
: wxPanel(parent, -1)
: wxPanel(parent)
{
m_listbox_gcodes = new wxCheckListBox(this, -1);
m_listbox_gcodes = new wxCheckListBox(this, wxID_ANY);
m_listbox_gcodes->Bind(wxEVT_LISTBOX, &CodeConfigPanel::UpdateInfoBox, this);
m_listbox_gcodes->Bind(wxEVT_CHECKLISTBOX, &CodeConfigPanel::ToggleCode, this);
m_infobox.label_name = new wxStaticText(this, -1, wxGetTranslation(wxstr_name));
m_infobox.label_creator = new wxStaticText(this, -1, wxGetTranslation(wxstr_creator));
m_infobox.label_notes = new wxStaticText(this, -1, wxGetTranslation(wxstr_notes));
m_infobox.textctrl_notes = new wxTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, wxSize(64, -1), wxTE_MULTILINE | wxTE_READONLY);
m_infobox.listbox_codes = new wxListBox(this, -1, wxDefaultPosition, wxSize(-1, 64));
m_infobox.label_name = new wxStaticText(this, wxID_ANY, wxGetTranslation(wxstr_name));
m_infobox.label_creator = new wxStaticText(this, wxID_ANY, wxGetTranslation(wxstr_creator));
m_infobox.label_notes = new wxStaticText(this, wxID_ANY, wxGetTranslation(wxstr_notes));
m_infobox.textctrl_notes = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(64, -1), wxTE_MULTILINE | wxTE_READONLY);
m_infobox.listbox_codes = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 64));
// TODO: buttons to add/edit codes
@ -62,7 +62,7 @@ CodeConfigPanel::CodeConfigPanel(wxWindow* const parent)
// button sizer
wxBoxSizer* const sizer_buttons = new wxBoxSizer(wxHORIZONTAL);
btn_download = new wxButton(this, -1, _("Download Codes (WiiRD Database)"), wxDefaultPosition, wxSize(128, -1));
btn_download = new wxButton(this, wxID_ANY, _("Download Codes (WiiRD Database)"), wxDefaultPosition, wxSize(128, -1));
btn_download->Enable(false);
btn_download->Bind(wxEVT_BUTTON, &CodeConfigPanel::DownloadCodes, this);
sizer_buttons->AddStretchSpacer(1);