Skip to content

Commit

Permalink
Merge pull request #1631 from lioncash/id
Browse files Browse the repository at this point in the history
DolphinWX: Specify wxID_ANY where -1 is used in controls
  • Loading branch information
lioncash committed Dec 2, 2014
2 parents 54f1e3a + 10bfbeb commit 734aac5
Show file tree
Hide file tree
Showing 16 changed files with 100 additions and 100 deletions.
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/ARCodeAddEdit.h
Expand Up @@ -22,7 +22,7 @@ class CARCodeAddEdit : public wxDialog
{
public:
CARCodeAddEdit(int _selection, wxWindow* parent,
wxWindowID id = 1,
wxWindowID id = wxID_ANY,
const wxString& title = _("Edit ActionReplay Code"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
Expand Down
20 changes: 10 additions & 10 deletions Source/Core/DolphinWX/Cheats/CheatSearchTab.cpp
Expand Up @@ -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();

Expand All @@ -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
Expand All @@ -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);
Expand All @@ -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"));
Expand Down
16 changes: 8 additions & 8 deletions Source/Core/DolphinWX/Cheats/CreateCodeDialog.cpp
Expand Up @@ -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);
Expand Down
16 changes: 8 additions & 8 deletions Source/Core/DolphinWX/Cheats/GeckoCodeDiag.cpp
Expand Up @@ -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

Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/ConfigMain.h
Expand Up @@ -45,7 +45,7 @@ class CConfigMain : public wxDialog
public:

CConfigMain(wxWindow* parent,
wxWindowID id = 1,
wxWindowID id = wxID_ANY,
const wxString& title = _("Dolphin Configuration"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
Expand Down
8 changes: 4 additions & 4 deletions Source/Core/DolphinWX/ControllerConfigDiag.cpp
Expand Up @@ -47,7 +47,7 @@ const std::array<wxString, 7> ControllerConfigDiag::m_gc_pad_type_strs = {{
}};

ControllerConfigDiag::ControllerConfigDiag(wxWindow* const parent)
: wxDialog(parent, -1, _("Dolphin Controller Configuration"))
: wxDialog(parent, wxID_ANY, _("Dolphin Controller Configuration"))
{
wxBoxSizer* const main_sizer = new wxBoxSizer(wxVERTICAL);

Expand Down Expand Up @@ -239,15 +239,15 @@ wxStaticBoxSizer* ControllerConfigDiag::CreateBalanceBoardSizer()
wxStaticBoxSizer* ControllerConfigDiag::CreateRealWiimoteSizer()
{
// "Real wiimotes" controls
wxButton* const refresh_btn = new wxButton(this, -1, _("Refresh"));
wxButton* const refresh_btn = new wxButton(this, wxID_ANY, _("Refresh"));
refresh_btn->Bind(wxEVT_BUTTON, &ControllerConfigDiag::RefreshRealWiimotes, this);

wxStaticBoxSizer* const real_wiimotes_group = new wxStaticBoxSizer(wxVERTICAL, this, _("Real Wiimotes"));
wxBoxSizer* const real_wiimotes_sizer = new wxBoxSizer(wxHORIZONTAL);

if (!WiimoteReal::g_wiimote_scanner.IsReady())
real_wiimotes_group->Add(new wxStaticText(this, -1, _("A supported bluetooth device could not be found.\n"
"You must manually connect your wiimotes.")), 0, wxALIGN_CENTER | wxALL, 5);
real_wiimotes_group->Add(new wxStaticText(this, wxID_ANY, _("A supported bluetooth device could not be found.\n"
"You must manually connect your wiimotes.")), 0, wxALIGN_CENTER | wxALL, 5);

wxCheckBox* const continuous_scanning = new wxCheckBox(this, wxID_ANY, _("Continuous Scanning"));
continuous_scanning->Bind(wxEVT_CHECKBOX, &ControllerConfigDiag::OnContinuousScanning, this);
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/HotkeyDlg.cpp
Expand Up @@ -306,7 +306,7 @@ void HotkeyConfigDialog::CreateHotkeyGUIControls()

for (int j = 0; j < 2; j++)
{
wxPanel *Page = new wxPanel(Notebook, wxID_ANY);
wxPanel *Page = new wxPanel(Notebook);
Notebook->AddPage(Page, pageNames[j]);

wxGridBagSizer *sHotkeys = new wxGridBagSizer();
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/HotkeyDlg.h
Expand Up @@ -28,7 +28,7 @@ class HotkeyConfigDialog : public wxDialog
{
public:
HotkeyConfigDialog(wxWindow* parent,
wxWindowID id = 1,
wxWindowID id = wxID_ANY,
const wxString &title = _("Hotkey Configuration"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/ISOProperties.h
Expand Up @@ -49,7 +49,7 @@ class CISOProperties : public wxDialog
public:
CISOProperties(const std::string fileName,
wxWindow* parent,
wxWindowID id = 1,
wxWindowID id = wxID_ANY,
const wxString& title = _("Properties"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
Expand Down

0 comments on commit 734aac5

Please sign in to comment.