diff options
author | StapleButter <thetotalworm@gmail.com> | 2017-03-25 05:25:03 +0100 |
---|---|---|
committer | StapleButter <thetotalworm@gmail.com> | 2017-03-25 05:25:03 +0100 |
commit | 12daf16282414310756c81cf265d126ba3f906ff (patch) | |
tree | 3abac2a414f045917870b0768cc6f255848159a4 /src/wx/InputConfig.cpp | |
parent | e6124c4776fce633c60aee016d941b0d9e6c06de (diff) |
input dialog finished
Diffstat (limited to 'src/wx/InputConfig.cpp')
-rw-r--r-- | src/wx/InputConfig.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/wx/InputConfig.cpp b/src/wx/InputConfig.cpp index 104adc7..9ed9dfc 100644 --- a/src/wx/InputConfig.cpp +++ b/src/wx/InputConfig.cpp @@ -22,7 +22,8 @@ wxBEGIN_EVENT_TABLE(InputConfigDialog, wxDialog) - EVT_COMMAND(1001, wxEVT_BUTTON, InputConfigDialog::OnDerp) + EVT_COMMAND(1001, wxEVT_BUTTON, InputConfigDialog::OnOk) + EVT_COMMAND(1002, wxEVT_BUTTON, InputConfigDialog::OnCancel) EVT_TIMER(wxID_ANY, InputConfigDialog::OnPoll) wxEND_EVENT_TABLE() @@ -141,22 +142,21 @@ InputConfigDialog::InputConfigDialog(wxWindow* parent) p->SetSizer(sizer); vboxmain->Add(p, 0, wxALL&(~wxBOTTOM), 15); } -wxButton* boobs; + { wxPanel* p = new wxPanel(this); wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL); - //keycatcher = new wxButton(p, wxID_ANY, "pancake"); keycatcher = new wxPanel(p, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS); sizer->Add(keycatcher); keycatcher->Show(false); - wxButton* derp = new wxButton(p, 1001, "derp"); - sizer->Add(derp); + wxButton* ok = new wxButton(p, 1001, "OK"); + sizer->Add(ok); - boobs = new wxButton(p, 1002, "boobs"); + wxButton* cancel = new wxButton(p, 1002, "Cancel"); sizer->Add(3, 0); - sizer->Add(boobs); + sizer->Add(cancel); p->SetSizer(sizer); vboxmain->Add(p, 0, wxALL|wxALIGN_RIGHT, 15); @@ -186,9 +186,18 @@ InputConfigDialog::~InputConfigDialog() SDL_DestroyWindow(sdlwin); } -void InputConfigDialog::OnDerp(wxCommandEvent& event) +void InputConfigDialog::OnOk(wxCommandEvent& event) +{ + memcpy(Config::KeyMapping, keymapping, 12*sizeof(int)); + memcpy(Config::JoyMapping, joymapping, 12*sizeof(int)); + Config::Save(); + + Close(); +} + +void InputConfigDialog::OnCancel(wxCommandEvent& event) { - printf("OnDerp %d\n", event.GetId()); + Close(); } // black magic going on there @@ -342,12 +351,6 @@ void InputConfigDialog::OnPoll(wxTimerEvent& event) } } -void InputConfigDialog::OnKeyDown(wxKeyEvent& event) -{ - printf("!!\n"); - event.Skip(); -} - void InputConfigDialog::OnFancybuttonHover(wxMouseEvent& event) { wxStaticText* btn = (wxStaticText*)this; |