summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Cheats/CreateCodeDialog.cpp
diff options
context:
space:
mode:
authorEmptyChaos <EmptyChaos@users.noreply.github.com>2016-10-03 06:56:45 +0000
committerEmptyChaos <EmptyChaos@users.noreply.github.com>2016-10-04 13:47:22 +1100
commitc893447913917e7104a1b7fd566e75d7c5c31a4c (patch)
treece436bb2957f956920599a0579d98e9c38ebb1d9 /Source/Core/DolphinWX/Cheats/CreateCodeDialog.cpp
parent8fe94c3c508f70ec26305d48a8582222b2c12e9d (diff)
WX: HiDPI: CheatsWindow
Changed the Cheat Search tab to disable the scan buttons while there is not a game running and enable when it starts. Also added double-click to create code to the result list.
Diffstat (limited to 'Source/Core/DolphinWX/Cheats/CreateCodeDialog.cpp')
-rw-r--r--Source/Core/DolphinWX/Cheats/CreateCodeDialog.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/Source/Core/DolphinWX/Cheats/CreateCodeDialog.cpp b/Source/Core/DolphinWX/Cheats/CreateCodeDialog.cpp
index 32b4ac09a9..8f398bd513 100644
--- a/Source/Core/DolphinWX/Cheats/CreateCodeDialog.cpp
+++ b/Source/Core/DolphinWX/Cheats/CreateCodeDialog.cpp
@@ -19,8 +19,8 @@ CreateCodeDialog::CreateCodeDialog(wxWindow* const parent, const u32 address)
: wxDialog(parent, wxID_ANY, _("Create AR Code")), m_code_address(address)
{
wxStaticText* const label_name = new wxStaticText(this, wxID_ANY, _("Name: "));
- m_textctrl_name =
- new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(256, -1));
+ m_textctrl_name = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
+ wxDLG_UNIT(this, wxSize(180, -1)));
wxStaticText* const label_code = new wxStaticText(this, wxID_ANY, _("Code: "));
m_textctrl_code = new wxTextCtrl(this, wxID_ANY, wxString::Format("0x%08x", address));
@@ -33,22 +33,31 @@ CreateCodeDialog::CreateCodeDialog(wxWindow* const parent, const u32 address)
m_checkbox_use_hex->SetValue(true);
wxBoxSizer* const sizer_value_label = new wxBoxSizer(wxHORIZONTAL);
- sizer_value_label->Add(label_value, 0, wxRIGHT, 5);
- sizer_value_label->Add(m_checkbox_use_hex);
+ const int space5 = FromDIP(5);
+ sizer_value_label->Add(label_value);
+ sizer_value_label->Add(m_checkbox_use_hex, 0, wxLEFT, space5);
// main sizer
wxBoxSizer* const sizer_main = new wxBoxSizer(wxVERTICAL);
- sizer_main->Add(label_name, 0, wxALL, 5);
- sizer_main->Add(m_textctrl_name, 0, wxALL, 5);
- sizer_main->Add(label_code, 0, wxALL, 5);
- sizer_main->Add(m_textctrl_code, 0, wxALL, 5);
- sizer_main->Add(sizer_value_label, 0, wxALL, 5);
- sizer_main->Add(m_textctrl_value, 0, wxALL, 5);
- sizer_main->Add(CreateButtonSizer(wxOK | wxCANCEL | wxNO_DEFAULT), 0, wxALL, 5);
-
+ sizer_main->AddSpacer(space5);
+ sizer_main->Add(label_name, 0, wxLEFT | wxRIGHT, space5);
+ sizer_main->AddSpacer(space5);
+ sizer_main->Add(m_textctrl_name, 0, wxLEFT | wxRIGHT, space5);
+ sizer_main->AddSpacer(space5);
+ sizer_main->Add(label_code, 0, wxLEFT | wxRIGHT, space5);
+ sizer_main->AddSpacer(space5);
+ sizer_main->Add(m_textctrl_code, 0, wxLEFT | wxRIGHT, space5);
+ sizer_main->AddSpacer(space5);
+ sizer_main->Add(sizer_value_label, 0, wxLEFT | wxRIGHT, space5);
+ sizer_main->AddSpacer(space5);
+ sizer_main->Add(m_textctrl_value, 0, wxLEFT | wxRIGHT, space5);
+ sizer_main->AddSpacer(space5);
+ sizer_main->Add(CreateButtonSizer(wxOK | wxCANCEL | wxNO_DEFAULT), 0, wxEXPAND | wxLEFT | wxRIGHT,
+ space5);
+ sizer_main->AddSpacer(space5);
+
+ // NOTE: Use default wxCANCEL handling.
Bind(wxEVT_BUTTON, &CreateCodeDialog::PressOK, this, wxID_OK);
- Bind(wxEVT_BUTTON, &CreateCodeDialog::PressCancel, this, wxID_CANCEL);
- Bind(wxEVT_CLOSE_WINDOW, &CreateCodeDialog::OnEvent_Close, this);
SetSizerAndFit(sizer_main);
SetFocus();
@@ -82,15 +91,6 @@ void CreateCodeDialog::PressOK(wxCommandEvent& ev)
add_event.SetClientData(&new_cheat);
GetParent()->GetEventHandler()->ProcessEvent(add_event);
- Close();
-}
-
-void CreateCodeDialog::PressCancel(wxCommandEvent& ev)
-{
- Close();
-}
-
-void CreateCodeDialog::OnEvent_Close(wxCloseEvent& ev)
-{
- Destroy();
+ // Allow base class to process. wxDialog will set the return code and hide the window.
+ ev.Skip();
}