2013-04-18 03:43:35 +00:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2011-06-27 19:44:27 +00:00
|
|
|
|
2014-02-22 22:36:30 +00:00
|
|
|
#include <cstddef>
|
|
|
|
#include <wx/bitmap.h>
|
|
|
|
#include <wx/chartype.h>
|
|
|
|
#include <wx/checkbox.h>
|
|
|
|
#include <wx/dcmemory.h>
|
|
|
|
#include <wx/defs.h>
|
|
|
|
#include <wx/dialog.h>
|
|
|
|
#include <wx/event.h>
|
|
|
|
#include <wx/gdicmn.h>
|
|
|
|
#include <wx/layout.h>
|
|
|
|
#include <wx/sizer.h>
|
|
|
|
#include <wx/slider.h>
|
|
|
|
#include <wx/statbmp.h>
|
|
|
|
#include <wx/string.h>
|
|
|
|
#include <wx/textctrl.h>
|
|
|
|
#include <wx/translation.h>
|
|
|
|
#include <wx/validate.h>
|
|
|
|
#include <wx/window.h>
|
|
|
|
#include <wx/windowid.h>
|
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "DolphinWX/TASInputDlg.h"
|
2014-02-22 22:36:30 +00:00
|
|
|
#include "InputCommon/GCPadStatus.h"
|
2011-06-27 19:44:27 +00:00
|
|
|
|
|
|
|
BEGIN_EVENT_TABLE(TASInputDlg, wxDialog)
|
|
|
|
|
|
|
|
EVT_SLIDER(ID_MAIN_X_SLIDER, TASInputDlg::UpdateFromSliders)
|
|
|
|
EVT_SLIDER(ID_MAIN_Y_SLIDER, TASInputDlg::UpdateFromSliders)
|
|
|
|
EVT_SLIDER(ID_C_X_SLIDER, TASInputDlg::UpdateFromSliders)
|
|
|
|
EVT_SLIDER(ID_C_Y_SLIDER, TASInputDlg::UpdateFromSliders)
|
|
|
|
EVT_SLIDER(ID_L_SLIDER, TASInputDlg::UpdateFromSliders)
|
|
|
|
EVT_SLIDER(ID_R_SLIDER, TASInputDlg::UpdateFromSliders)
|
|
|
|
|
|
|
|
EVT_TEXT(ID_MAIN_X_TEXT, TASInputDlg::UpdateFromText)
|
|
|
|
EVT_TEXT(ID_MAIN_Y_TEXT, TASInputDlg::UpdateFromText)
|
|
|
|
EVT_TEXT(ID_C_X_TEXT, TASInputDlg::UpdateFromText)
|
|
|
|
EVT_TEXT(ID_C_Y_TEXT, TASInputDlg::UpdateFromText)
|
|
|
|
EVT_TEXT(ID_L_TEXT, TASInputDlg::UpdateFromText)
|
|
|
|
EVT_TEXT(ID_R_TEXT, TASInputDlg::UpdateFromText)
|
|
|
|
|
|
|
|
EVT_CLOSE(TASInputDlg::OnCloseWindow)
|
|
|
|
|
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
|
|
|
TASInputDlg::TASInputDlg(wxWindow *parent, wxWindowID id, const wxString &title,
|
|
|
|
const wxPoint &position, const wxSize& size, long style)
|
|
|
|
: wxDialog(parent, id, title, position, size, style)
|
|
|
|
{
|
2012-03-01 22:05:35 +00:00
|
|
|
A_turbo = B_turbo = X_turbo = Y_turbo = Z_turbo = L_turbo = R_turbo = START_turbo = DL_turbo = DR_turbo = DD_turbo = DU_turbo = false;
|
|
|
|
xaxis = yaxis = c_xaxis = c_yaxis = 128;
|
2013-07-23 23:24:05 +00:00
|
|
|
A_cont = B_cont = X_cont = Y_cont = Z_cont = L_cont = L_button_cont = R_cont = R_button_cont = START_cont = DL_cont = DR_cont = DD_cont = DU_cont = mstickx = msticky = cstickx = csticky = false;
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2011-06-27 19:44:27 +00:00
|
|
|
wxBoxSizer* const top_box = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
wxBoxSizer* const bottom_box = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
wxStaticBoxSizer* const main_box = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Main Stick"));
|
2012-01-22 00:39:17 +00:00
|
|
|
wxBoxSizer* const main_xslider_box = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
wxBoxSizer* const main_yslider_box = new wxBoxSizer(wxVERTICAL);
|
|
|
|
wxBoxSizer* const main_stick_box = new wxBoxSizer(wxVERTICAL);
|
|
|
|
|
2014-03-06 04:02:34 +00:00
|
|
|
static_bitmap_main = new wxStaticBitmap(this, ID_MAIN_STICK, TASInputDlg::CreateStickBitmap(128,128));
|
2013-06-25 15:04:28 +00:00
|
|
|
static_bitmap_main->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::OnMouseDownL, this);
|
|
|
|
static_bitmap_main->Bind(wxEVT_MOTION, &TASInputDlg::OnMouseDownL, this);
|
2013-01-13 17:46:30 +00:00
|
|
|
static_bitmap_main->Bind(wxEVT_RIGHT_UP, &TASInputDlg::OnMouseUpR, this);
|
2014-03-06 04:02:34 +00:00
|
|
|
wx_mainX_s = new wxSlider(this, ID_MAIN_X_SLIDER, 128, 0, 255);
|
2012-01-22 00:39:17 +00:00
|
|
|
wx_mainX_s->SetMinSize(wxSize(120,-1));
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_mainX_t = new wxTextCtrl(this, ID_MAIN_X_TEXT, "128", wxDefaultPosition, wxSize(40, 20));
|
2011-06-27 19:44:27 +00:00
|
|
|
wx_mainX_t->SetMaxLength(3);
|
|
|
|
wx_mainY_s = new wxSlider(this, ID_MAIN_Y_SLIDER, 128, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL | wxSL_INVERSE);
|
2012-01-22 00:39:17 +00:00
|
|
|
wx_mainY_s->SetMinSize(wxSize(-1,120));
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_mainY_t = new wxTextCtrl(this, ID_MAIN_Y_TEXT, "128", wxDefaultPosition, wxSize(40, 20));
|
2011-06-27 19:44:27 +00:00
|
|
|
wx_mainY_t->SetMaxLength(3);
|
|
|
|
|
2012-01-22 00:39:17 +00:00
|
|
|
main_xslider_box->Add(wx_mainX_s, 0, wxALIGN_TOP);
|
|
|
|
main_xslider_box->Add(wx_mainX_t, 0, wxALIGN_TOP);
|
|
|
|
main_stick_box->Add(main_xslider_box);
|
|
|
|
main_stick_box->Add(static_bitmap_main, 0, wxALL|wxCENTER, 3);
|
|
|
|
main_box->Add(main_stick_box);
|
|
|
|
main_yslider_box->Add(wx_mainY_s, 0, wxALIGN_CENTER_VERTICAL);
|
|
|
|
main_yslider_box->Add(wx_mainY_t, 0, wxALIGN_CENTER_VERTICAL);
|
|
|
|
main_box->Add(main_yslider_box);
|
2013-04-08 05:16:50 +00:00
|
|
|
|
2011-06-27 19:44:27 +00:00
|
|
|
wxStaticBoxSizer* const c_box = new wxStaticBoxSizer(wxHORIZONTAL, this, _("C Stick"));
|
2012-01-22 00:39:17 +00:00
|
|
|
wxBoxSizer* const c_xslider_box = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
wxBoxSizer* const c_yslider_box = new wxBoxSizer(wxVERTICAL);
|
|
|
|
wxBoxSizer* const c_stick_box = new wxBoxSizer(wxVERTICAL);
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2014-03-06 04:02:34 +00:00
|
|
|
static_bitmap_c = new wxStaticBitmap(this, ID_C_STICK, TASInputDlg::CreateStickBitmap(128,128));
|
2013-06-25 15:04:28 +00:00
|
|
|
static_bitmap_c->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::OnMouseDownL, this);
|
|
|
|
static_bitmap_c->Bind(wxEVT_MOTION, &TASInputDlg::OnMouseDownL, this);
|
2013-01-13 17:46:30 +00:00
|
|
|
static_bitmap_c->Bind(wxEVT_RIGHT_UP, &TASInputDlg::OnMouseUpR, this);
|
2014-03-06 04:02:34 +00:00
|
|
|
wx_cX_s = new wxSlider(this, ID_C_X_SLIDER, 128, 0, 255);
|
2012-01-22 00:39:17 +00:00
|
|
|
wx_cX_s->SetMinSize(wxSize(120,-1));
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_cX_t = new wxTextCtrl(this, ID_C_X_TEXT, "128", wxDefaultPosition, wxSize(40, 20));
|
2011-06-27 19:44:27 +00:00
|
|
|
wx_cX_t->SetMaxLength(3);
|
|
|
|
wx_cY_s = new wxSlider(this, ID_C_Y_SLIDER, 128, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL | wxSL_INVERSE);
|
2012-01-22 00:39:17 +00:00
|
|
|
wx_cY_s->SetMinSize(wxSize(-1,120));
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_cY_t = new wxTextCtrl(this, ID_C_Y_TEXT, "128", wxDefaultPosition, wxSize(40, 20));
|
2011-06-27 19:44:27 +00:00
|
|
|
wx_cY_t->SetMaxLength(3);
|
2012-01-22 00:39:17 +00:00
|
|
|
|
|
|
|
c_xslider_box->Add(wx_cX_s, 0, wxALIGN_TOP);
|
|
|
|
c_xslider_box->Add(wx_cX_t, 0, wxALIGN_TOP);
|
|
|
|
c_stick_box->Add(c_xslider_box);
|
|
|
|
c_stick_box->Add(static_bitmap_c,0, wxALL|wxCenter,3);
|
|
|
|
c_box->Add(c_stick_box);
|
|
|
|
c_yslider_box->Add(wx_cY_s, 0, wxALIGN_CENTER_VERTICAL);
|
|
|
|
c_yslider_box->Add(wx_cY_t, 0, wxALIGN_CENTER_VERTICAL);
|
|
|
|
c_box->Add(c_yslider_box);
|
2011-06-27 19:44:27 +00:00
|
|
|
|
|
|
|
wxStaticBoxSizer* const shoulder_box = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Shoulder Buttons"));
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2011-06-27 19:44:27 +00:00
|
|
|
wx_l_s = new wxSlider(this, ID_L_SLIDER, 0, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL | wxSL_INVERSE);
|
|
|
|
wx_l_s->SetMinSize(wxSize(-1,100));
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_l_t = new wxTextCtrl(this, ID_L_TEXT, "0", wxDefaultPosition, wxSize(40, 20));
|
2011-06-27 19:44:27 +00:00
|
|
|
wx_l_t->SetMaxLength(3);
|
|
|
|
wx_r_s = new wxSlider(this, ID_R_SLIDER, 0, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL | wxSL_INVERSE);
|
|
|
|
wx_r_s->SetMinSize(wxSize(-1,100));
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_r_t = new wxTextCtrl(this, ID_R_TEXT, "0", wxDefaultPosition, wxSize(40, 20));
|
2011-06-27 19:44:27 +00:00
|
|
|
wx_r_t->SetMaxLength(3);
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2011-06-27 19:44:27 +00:00
|
|
|
shoulder_box->Add(wx_l_s, 0, wxALIGN_CENTER_VERTICAL);
|
|
|
|
shoulder_box->Add(wx_l_t, 0, wxALIGN_CENTER_VERTICAL);
|
|
|
|
shoulder_box->Add(wx_r_s, 0, wxALIGN_CENTER_VERTICAL);
|
|
|
|
shoulder_box->Add(wx_r_t, 0, wxALIGN_CENTER_VERTICAL);
|
|
|
|
|
|
|
|
wxStaticBoxSizer* const buttons_box = new wxStaticBoxSizer(wxVERTICAL, this, _("Buttons"));
|
|
|
|
wxGridSizer* const buttons_grid = new wxGridSizer(4);
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_a_button = new wxCheckBox(this, ID_A, "A");
|
2013-01-13 17:46:30 +00:00
|
|
|
wx_a_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this);
|
|
|
|
wx_a_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this);
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_b_button = new wxCheckBox(this, ID_B, "B");
|
2013-01-13 17:46:30 +00:00
|
|
|
wx_b_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this);
|
|
|
|
wx_b_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this);
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_x_button = new wxCheckBox(this, ID_X, "X");
|
2013-01-13 17:46:30 +00:00
|
|
|
wx_x_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this);
|
|
|
|
wx_x_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this);
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_y_button = new wxCheckBox(this, ID_Y, "Y");
|
2013-01-13 17:46:30 +00:00
|
|
|
wx_y_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this);
|
|
|
|
wx_y_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this);
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_l_button = new wxCheckBox(this, ID_L, "L");
|
2013-01-13 17:46:30 +00:00
|
|
|
wx_l_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this);
|
|
|
|
wx_l_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this);
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_r_button = new wxCheckBox(this, ID_R, "R");
|
2013-01-13 17:46:30 +00:00
|
|
|
wx_r_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this);
|
|
|
|
wx_r_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this);
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_z_button = new wxCheckBox(this, ID_Z, "Z");
|
2013-01-13 17:46:30 +00:00
|
|
|
wx_z_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this);
|
|
|
|
wx_z_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this);
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_start_button = new wxCheckBox(this, ID_START, "Start");
|
2013-01-13 17:46:30 +00:00
|
|
|
wx_start_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this);
|
|
|
|
wx_start_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this);
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2011-06-27 19:44:27 +00:00
|
|
|
buttons_grid->Add(wx_a_button,false);
|
|
|
|
buttons_grid->Add(wx_b_button,false);
|
|
|
|
buttons_grid->Add(wx_x_button,false);
|
|
|
|
buttons_grid->Add(wx_y_button,false);
|
|
|
|
buttons_grid->Add(wx_l_button,false);
|
|
|
|
buttons_grid->Add(wx_r_button,false);
|
|
|
|
buttons_grid->Add(wx_z_button,false);
|
|
|
|
buttons_grid->Add(wx_start_button,false);
|
|
|
|
buttons_grid->AddSpacer(5);
|
|
|
|
|
|
|
|
wxGridSizer* const buttons_dpad = new wxGridSizer(3);
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_up_button = new wxCheckBox(this, ID_UP, "Up");
|
2013-01-13 17:46:30 +00:00
|
|
|
wx_up_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this);
|
|
|
|
wx_up_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this);
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_right_button = new wxCheckBox(this, ID_RIGHT, "Right");
|
2013-01-13 17:46:30 +00:00
|
|
|
wx_right_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this);
|
|
|
|
wx_right_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this);
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_down_button = new wxCheckBox(this, ID_DOWN, "Down");
|
2013-01-13 17:46:30 +00:00
|
|
|
wx_down_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this);
|
|
|
|
wx_down_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this);
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_left_button = new wxCheckBox(this, ID_LEFT, "Left");
|
2013-01-13 17:46:30 +00:00
|
|
|
wx_left_button->Bind(wxEVT_RIGHT_DOWN, &TASInputDlg::SetTurbo, this);
|
|
|
|
wx_left_button->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::SetTurboFalse, this);
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2011-06-27 19:44:27 +00:00
|
|
|
buttons_dpad->AddSpacer(20);
|
|
|
|
buttons_dpad->Add(wx_up_button,false);
|
|
|
|
buttons_dpad->AddSpacer(20);
|
|
|
|
buttons_dpad->Add(wx_left_button,false);
|
|
|
|
buttons_dpad->AddSpacer(20);
|
|
|
|
buttons_dpad->Add(wx_right_button,false);
|
|
|
|
buttons_dpad->AddSpacer(20);
|
|
|
|
buttons_dpad->Add(wx_down_button,false);
|
|
|
|
buttons_dpad->AddSpacer(20);
|
|
|
|
buttons_box->Add(buttons_grid);
|
|
|
|
buttons_box->Add(buttons_dpad);
|
|
|
|
|
|
|
|
wxBoxSizer* const main_szr = new wxBoxSizer(wxVERTICAL);
|
2012-01-22 00:39:17 +00:00
|
|
|
|
2011-06-27 19:44:27 +00:00
|
|
|
top_box->AddSpacer(5);
|
|
|
|
top_box->Add(main_box);
|
|
|
|
top_box->AddSpacer(5);
|
|
|
|
top_box->Add(c_box);
|
|
|
|
top_box->AddSpacer(5);
|
|
|
|
bottom_box->AddSpacer(5);
|
|
|
|
bottom_box->Add(shoulder_box);
|
|
|
|
bottom_box->AddSpacer(5);
|
|
|
|
bottom_box->Add(buttons_box);
|
|
|
|
bottom_box->AddSpacer(5);
|
|
|
|
main_szr->Add(top_box);
|
|
|
|
main_szr->Add(bottom_box);
|
|
|
|
SetSizerAndFit(main_szr);
|
|
|
|
ResetValues();
|
|
|
|
}
|
|
|
|
|
|
|
|
void TASInputDlg::ResetValues()
|
|
|
|
{
|
|
|
|
mainX = mainY = cX = cY = 128;
|
|
|
|
lTrig = rTrig = 0;
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2011-06-27 19:44:27 +00:00
|
|
|
wx_mainX_s->SetValue(128);
|
|
|
|
wx_mainY_s->SetValue(128);
|
|
|
|
wx_cX_s->SetValue(128);
|
|
|
|
wx_cY_s->SetValue(128);
|
|
|
|
wx_l_s->SetValue(0);
|
|
|
|
wx_r_s->SetValue(0);
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_mainX_t->SetValue("128");
|
|
|
|
wx_mainY_t->SetValue("128");
|
|
|
|
wx_cX_t->SetValue("128");
|
|
|
|
wx_cY_t->SetValue("128");
|
|
|
|
wx_l_t->SetValue("0");
|
|
|
|
wx_r_t->SetValue("0");
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2011-06-27 19:44:27 +00:00
|
|
|
wx_up_button->SetValue(false);
|
|
|
|
wx_down_button->SetValue(false);
|
|
|
|
wx_left_button->SetValue(false);
|
|
|
|
wx_right_button->SetValue(false);
|
|
|
|
wx_a_button->SetValue(false);
|
|
|
|
wx_b_button->SetValue(false);
|
|
|
|
wx_x_button->SetValue(false);
|
|
|
|
wx_y_button->SetValue(false);
|
|
|
|
wx_l_button->SetValue(false);
|
|
|
|
wx_r_button->SetValue(false);
|
|
|
|
wx_z_button->SetValue(false);
|
|
|
|
wx_start_button->SetValue(false);
|
|
|
|
}
|
|
|
|
|
2012-01-22 00:39:17 +00:00
|
|
|
void TASInputDlg::GetKeyBoardInput(SPADStatus *PadStatus)
|
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
if (PadStatus->stickX != 128)
|
2012-01-22 19:45:55 +00:00
|
|
|
{
|
|
|
|
mainX = PadStatus->stickX;
|
|
|
|
mstickx = true;
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_mainX_t->SetValue(wxString::Format("%i", mainX));
|
2012-01-22 19:45:55 +00:00
|
|
|
}
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
else if (mstickx)
|
2012-01-22 19:45:55 +00:00
|
|
|
{
|
|
|
|
mstickx = false;
|
|
|
|
mainX = 128;
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_mainX_t->SetValue(wxString::Format("%i", mainX));
|
2012-01-22 19:45:55 +00:00
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (PadStatus->stickY != 128)
|
2012-01-22 19:45:55 +00:00
|
|
|
{
|
|
|
|
mainY = PadStatus->stickY;
|
|
|
|
msticky = true;
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_mainY_t->SetValue(wxString::Format("%i",mainY));
|
2012-01-22 19:45:55 +00:00
|
|
|
}
|
2014-03-10 11:30:55 +00:00
|
|
|
else if (msticky)
|
2012-01-22 19:45:55 +00:00
|
|
|
{
|
|
|
|
msticky = false;
|
|
|
|
mainY = 128;
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_mainY_t->SetValue(wxString::Format("%i", mainY));
|
2012-01-22 19:45:55 +00:00
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (PadStatus->substickX != 128)
|
2012-01-22 19:45:55 +00:00
|
|
|
{
|
|
|
|
cX = PadStatus->substickX;
|
|
|
|
cstickx = true;
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_cX_t->SetValue(wxString::Format("%i", cX));
|
2012-01-22 19:45:55 +00:00
|
|
|
}
|
2014-03-10 11:30:55 +00:00
|
|
|
else if (cstickx)
|
2012-01-22 19:45:55 +00:00
|
|
|
{
|
|
|
|
cstickx = false;
|
|
|
|
cX = 128;
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_cX_t->SetValue(wxString::Format("%i", cX));
|
2012-01-22 19:45:55 +00:00
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (PadStatus->substickY != 128)
|
2012-01-22 19:45:55 +00:00
|
|
|
{
|
|
|
|
cY = PadStatus->substickY;
|
|
|
|
csticky = true;
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_cY_t->SetValue(wxString::Format("%i", cY));
|
2012-01-22 19:45:55 +00:00
|
|
|
}
|
2014-03-10 11:30:55 +00:00
|
|
|
else if (csticky)
|
2012-01-22 19:45:55 +00:00
|
|
|
{
|
|
|
|
csticky = false;
|
|
|
|
cY = 128;
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_cY_t->SetValue(wxString::Format("%i", cY));
|
2012-01-22 19:45:55 +00:00
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if ((PadStatus->button & PAD_BUTTON_UP) != 0)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_up_button->SetValue(true);
|
|
|
|
DU_cont = true;
|
|
|
|
}
|
2014-03-10 11:30:55 +00:00
|
|
|
else if (DU_cont)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_up_button->SetValue(false);
|
|
|
|
DU_cont = false;
|
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if ((PadStatus->button & PAD_BUTTON_DOWN) != 0)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_down_button->SetValue(true);
|
|
|
|
DD_cont = true;
|
|
|
|
}
|
2014-03-10 11:30:55 +00:00
|
|
|
else if (DD_cont)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_down_button->SetValue(false);
|
|
|
|
DD_cont = false;
|
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if ((PadStatus->button & PAD_BUTTON_LEFT) != 0)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_left_button->SetValue(true);
|
|
|
|
DL_cont = true;
|
|
|
|
}
|
2014-03-10 11:30:55 +00:00
|
|
|
else if (DL_cont)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_left_button->SetValue(false);
|
|
|
|
DL_cont = false;
|
|
|
|
}
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if ((PadStatus->button & PAD_BUTTON_RIGHT) != 0)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_right_button->SetValue(true);
|
|
|
|
DR_cont = true;
|
|
|
|
}
|
2014-03-10 11:30:55 +00:00
|
|
|
else if (DR_cont)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_right_button->SetValue(false);
|
|
|
|
DR_cont = false;
|
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if ((PadStatus->button & PAD_BUTTON_A) != 0)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_a_button->SetValue(true);
|
|
|
|
A_cont = true;
|
|
|
|
}
|
2014-03-10 11:30:55 +00:00
|
|
|
else if (A_cont)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_a_button->SetValue(false);
|
|
|
|
A_cont = false;
|
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if ((PadStatus->button & PAD_BUTTON_B) != 0)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_b_button->SetValue(true);
|
|
|
|
B_cont = true;
|
|
|
|
}
|
2014-03-10 11:30:55 +00:00
|
|
|
else if (B_cont)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_b_button->SetValue(false);
|
|
|
|
B_cont = false;
|
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if ((PadStatus->button & PAD_BUTTON_X) != 0)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_x_button->SetValue(true);
|
|
|
|
X_cont = true;
|
|
|
|
}
|
2014-03-10 11:30:55 +00:00
|
|
|
else if (X_cont)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_x_button->SetValue(false);
|
|
|
|
X_cont = false;
|
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if ((PadStatus->button & PAD_BUTTON_Y) != 0)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_y_button->SetValue(true);
|
|
|
|
Y_cont = true;
|
|
|
|
}
|
2014-03-10 11:30:55 +00:00
|
|
|
else if (Y_cont)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_y_button->SetValue(false);
|
|
|
|
Y_cont = false;
|
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if ((PadStatus->triggerLeft) != 0)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
2013-07-23 23:24:05 +00:00
|
|
|
if (PadStatus->triggerLeft == 255)
|
|
|
|
{
|
|
|
|
wx_l_button->SetValue(true);
|
|
|
|
L_button_cont = true;
|
|
|
|
}
|
2013-07-23 23:55:17 +00:00
|
|
|
else if (L_button_cont)
|
2013-07-23 23:24:05 +00:00
|
|
|
{
|
|
|
|
wx_l_button->SetValue(false);
|
|
|
|
L_button_cont = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
wx_l_s->SetValue(PadStatus->triggerLeft);
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_l_t->SetValue(wxString::Format("%i", PadStatus->triggerLeft));
|
2012-01-22 00:39:17 +00:00
|
|
|
L_cont = true;
|
|
|
|
}
|
2014-03-10 11:30:55 +00:00
|
|
|
else if (L_cont)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_l_button->SetValue(false);
|
2013-07-23 23:24:05 +00:00
|
|
|
wx_l_s->SetValue(0);
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_l_t->SetValue("0");
|
2012-01-22 00:39:17 +00:00
|
|
|
L_cont = false;
|
|
|
|
}
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if ((PadStatus->triggerRight) != 0)
|
2013-07-23 23:24:05 +00:00
|
|
|
{
|
|
|
|
if (PadStatus->triggerRight == 255)
|
|
|
|
{
|
|
|
|
wx_r_button->SetValue(true);
|
|
|
|
R_button_cont = true;
|
|
|
|
}
|
|
|
|
else if (R_button_cont)
|
|
|
|
{
|
|
|
|
wx_r_button->SetValue(false);
|
|
|
|
R_button_cont = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
wx_r_s->SetValue(PadStatus->triggerRight);
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_r_t->SetValue(wxString::Format("%i", PadStatus->triggerRight));
|
2012-01-22 00:39:17 +00:00
|
|
|
R_cont = true;
|
|
|
|
}
|
2014-03-10 11:30:55 +00:00
|
|
|
else if (R_cont)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_r_button->SetValue(false);
|
2013-07-23 23:24:05 +00:00
|
|
|
wx_r_s->SetValue(0);
|
2014-05-17 17:17:28 +00:00
|
|
|
wx_r_t->SetValue("0");
|
2012-01-22 00:39:17 +00:00
|
|
|
R_cont = false;
|
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if ((PadStatus->button & PAD_TRIGGER_Z) != 0)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_z_button->SetValue(true);
|
|
|
|
Z_cont = true;
|
|
|
|
}
|
2014-03-10 11:30:55 +00:00
|
|
|
else if (Z_cont)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_z_button->SetValue(false);
|
|
|
|
Z_cont = false;
|
|
|
|
}
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if ((PadStatus->button & PAD_BUTTON_START) != 0)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_start_button->SetValue(true);
|
|
|
|
START_cont = true;
|
|
|
|
}
|
2014-03-10 11:30:55 +00:00
|
|
|
else if (START_cont)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
wx_start_button->SetValue(false);
|
|
|
|
START_cont = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-23 23:24:05 +00:00
|
|
|
void TASInputDlg::SetLandRTriggers()
|
|
|
|
{
|
|
|
|
if (wx_l_button->GetValue())
|
|
|
|
lTrig = 255;
|
|
|
|
else
|
|
|
|
lTrig = wx_l_s->GetValue();
|
|
|
|
|
|
|
|
if (wx_r_button->GetValue())
|
|
|
|
rTrig = 255;
|
|
|
|
else
|
|
|
|
rTrig = wx_r_s->GetValue();
|
|
|
|
}
|
|
|
|
|
2011-06-27 19:44:27 +00:00
|
|
|
void TASInputDlg::GetValues(SPADStatus *PadStatus, int controllerID)
|
|
|
|
{
|
|
|
|
if (!IsShown())
|
|
|
|
return;
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2012-01-22 19:45:55 +00:00
|
|
|
//TODO:: Make this instant not when polled.
|
2012-01-22 00:39:17 +00:00
|
|
|
GetKeyBoardInput(PadStatus);
|
2013-07-23 23:24:05 +00:00
|
|
|
SetLandRTriggers();
|
2011-06-27 19:44:27 +00:00
|
|
|
|
|
|
|
PadStatus->stickX = mainX;
|
|
|
|
PadStatus->stickY = mainY;
|
|
|
|
PadStatus->substickX = cX;
|
|
|
|
PadStatus->substickY = cY;
|
|
|
|
PadStatus->triggerLeft = lTrig;
|
|
|
|
PadStatus->triggerRight = rTrig;
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_up_button->IsChecked())
|
2011-06-27 19:44:27 +00:00
|
|
|
PadStatus->button |= PAD_BUTTON_UP;
|
|
|
|
else
|
|
|
|
PadStatus->button &= ~PAD_BUTTON_UP;
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_down_button->IsChecked())
|
2011-06-27 19:44:27 +00:00
|
|
|
PadStatus->button |= PAD_BUTTON_DOWN;
|
|
|
|
else
|
|
|
|
PadStatus->button &= ~PAD_BUTTON_DOWN;
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_left_button->IsChecked())
|
2011-06-27 19:44:27 +00:00
|
|
|
PadStatus->button |= PAD_BUTTON_LEFT;
|
|
|
|
else
|
|
|
|
PadStatus->button &= ~PAD_BUTTON_LEFT;
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_right_button->IsChecked())
|
2011-06-27 19:44:27 +00:00
|
|
|
PadStatus->button |= PAD_BUTTON_RIGHT;
|
|
|
|
else
|
|
|
|
PadStatus->button &= ~PAD_BUTTON_RIGHT;
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_a_button->IsChecked())
|
2011-06-27 19:44:27 +00:00
|
|
|
{
|
|
|
|
PadStatus->button |= PAD_BUTTON_A;
|
|
|
|
PadStatus->analogA = 0xFF;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
PadStatus->button &= ~PAD_BUTTON_A;
|
|
|
|
PadStatus->analogA = 0x00;
|
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_b_button->IsChecked())
|
2011-06-27 19:44:27 +00:00
|
|
|
{
|
|
|
|
PadStatus->button |= PAD_BUTTON_B;
|
|
|
|
PadStatus->analogB = 0xFF;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
PadStatus->button &= ~PAD_BUTTON_B;
|
|
|
|
PadStatus->analogB = 0x00;
|
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_x_button->IsChecked())
|
2011-06-27 19:44:27 +00:00
|
|
|
PadStatus->button |= PAD_BUTTON_X;
|
|
|
|
else
|
|
|
|
PadStatus->button &= ~PAD_BUTTON_X;
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_y_button->IsChecked())
|
2011-06-27 19:44:27 +00:00
|
|
|
PadStatus->button |= PAD_BUTTON_Y;
|
|
|
|
else
|
|
|
|
PadStatus->button &= ~PAD_BUTTON_Y;
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_z_button->IsChecked())
|
2011-06-27 19:44:27 +00:00
|
|
|
PadStatus->button |= PAD_TRIGGER_Z;
|
|
|
|
else
|
|
|
|
PadStatus->button &= ~PAD_TRIGGER_Z;
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_start_button->IsChecked())
|
2011-06-27 19:44:27 +00:00
|
|
|
PadStatus->button |= PAD_BUTTON_START;
|
|
|
|
else
|
|
|
|
PadStatus->button &= ~PAD_BUTTON_START;
|
2013-09-17 13:56:45 +00:00
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_r_button->IsChecked() || rTrig >= 255)
|
2013-09-17 13:56:45 +00:00
|
|
|
PadStatus->button |= PAD_TRIGGER_R;
|
|
|
|
else
|
|
|
|
PadStatus->button &= ~PAD_TRIGGER_R;
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_l_button->IsChecked() || lTrig >= 255)
|
2013-09-17 13:56:45 +00:00
|
|
|
PadStatus->button |= PAD_TRIGGER_L;
|
|
|
|
else
|
|
|
|
PadStatus->button &= ~PAD_TRIGGER_L;
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2012-01-22 00:39:17 +00:00
|
|
|
ButtonTurbo();
|
2011-06-27 19:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TASInputDlg::UpdateFromSliders(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
wxTextCtrl *text;
|
|
|
|
u8 *v;
|
2012-01-22 00:39:17 +00:00
|
|
|
update = 0;
|
2011-06-27 19:44:27 +00:00
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
switch (event.GetId())
|
2011-06-27 19:44:27 +00:00
|
|
|
{
|
|
|
|
case ID_MAIN_X_SLIDER:
|
|
|
|
text = wx_mainX_t;
|
|
|
|
v = &mainX;
|
2012-01-22 00:39:17 +00:00
|
|
|
xaxis =((wxSlider *) event.GetEventObject())->GetValue();
|
|
|
|
update = 1;
|
2011-06-27 19:44:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_MAIN_Y_SLIDER:
|
|
|
|
text = wx_mainY_t;
|
|
|
|
v = &mainY;
|
2012-01-22 00:39:17 +00:00
|
|
|
yaxis = 256 - ((wxSlider *) event.GetEventObject())->GetValue();
|
|
|
|
update = 1;
|
2011-06-27 19:44:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_C_X_SLIDER:
|
|
|
|
text = wx_cX_t;
|
|
|
|
v = &cX;
|
2012-01-22 00:39:17 +00:00
|
|
|
c_xaxis = ((wxSlider *) event.GetEventObject())->GetValue();
|
|
|
|
update = 2;
|
2011-06-27 19:44:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_C_Y_SLIDER:
|
|
|
|
text = wx_cY_t;
|
|
|
|
v = &cY;
|
2012-01-22 00:39:17 +00:00
|
|
|
c_yaxis = 256 -((wxSlider *) event.GetEventObject())->GetValue();
|
|
|
|
update = 2;
|
2011-06-27 19:44:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_L_SLIDER:
|
|
|
|
text = wx_l_t;
|
|
|
|
v = &lTrig;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_R_SLIDER:
|
|
|
|
text = wx_r_t;
|
|
|
|
v = &rTrig;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
int value = ((wxSlider *) event.GetEventObject())->GetValue();
|
|
|
|
*v = (u8) value;
|
2014-05-17 17:17:28 +00:00
|
|
|
text->SetValue(wxString::Format("%i", value));
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (update == 1)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
static_bitmap_main->SetBitmap(TASInputDlg::CreateStickBitmap(xaxis, yaxis));
|
|
|
|
}
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (update == 2)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
static_bitmap_c->SetBitmap(TASInputDlg::CreateStickBitmap(c_xaxis, c_yaxis));
|
|
|
|
}
|
2011-06-27 19:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TASInputDlg::UpdateFromText(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
wxSlider *slider;
|
|
|
|
u8 *v;
|
2012-03-01 22:05:35 +00:00
|
|
|
update = 0;
|
|
|
|
update_axis = 0;
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
switch (event.GetId())
|
2011-06-27 19:44:27 +00:00
|
|
|
{
|
|
|
|
case ID_MAIN_X_TEXT:
|
|
|
|
slider = wx_mainX_s;
|
|
|
|
v = &mainX;
|
2012-01-22 00:39:17 +00:00
|
|
|
update = 1;
|
|
|
|
update_axis = 1;
|
2011-06-27 19:44:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_MAIN_Y_TEXT:
|
|
|
|
slider = wx_mainY_s;
|
|
|
|
v = &mainY;
|
2012-01-22 00:39:17 +00:00
|
|
|
update = 1;
|
|
|
|
update_axis = 2;
|
2011-06-27 19:44:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_C_X_TEXT:
|
|
|
|
slider = wx_cX_s;
|
|
|
|
v = &cX;
|
2012-01-22 00:39:17 +00:00
|
|
|
update = 2;
|
|
|
|
update_axis = 1;
|
2011-06-27 19:44:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_C_Y_TEXT:
|
|
|
|
slider = wx_cY_s;
|
|
|
|
v = &cY;
|
2013-10-29 05:23:17 +00:00
|
|
|
update = 2;
|
2012-01-22 00:39:17 +00:00
|
|
|
update_axis = 2;
|
2011-06-27 19:44:27 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_L_TEXT:
|
|
|
|
slider = wx_l_s;
|
|
|
|
v = &lTrig;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_R_TEXT:
|
|
|
|
slider = wx_r_s;
|
|
|
|
v = &rTrig;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
unsigned long value;
|
|
|
|
|
|
|
|
if (((wxTextCtrl *) event.GetEventObject())->GetValue().ToULong(&value))
|
|
|
|
{
|
|
|
|
*v = (u8) (value > 255 ? 255 : value);
|
|
|
|
slider->SetValue(*v);
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (update == 1)
|
|
|
|
{
|
|
|
|
if (update_axis == 1)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
xaxis = *v;
|
|
|
|
static_bitmap_main->SetBitmap(TASInputDlg::CreateStickBitmap(xaxis,yaxis));
|
|
|
|
}
|
|
|
|
else if (update_axis == 2)
|
|
|
|
{
|
|
|
|
yaxis =256 - *v;
|
|
|
|
static_bitmap_main->SetBitmap(TASInputDlg::CreateStickBitmap(xaxis,yaxis));
|
2012-03-02 00:00:41 +00:00
|
|
|
}
|
2012-01-22 00:39:17 +00:00
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
}
|
|
|
|
else if (update == 2)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
if (update_axis == 1)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
c_xaxis = *v;
|
|
|
|
static_bitmap_c->SetBitmap(TASInputDlg::CreateStickBitmap(c_xaxis,c_yaxis));
|
|
|
|
}
|
2014-03-10 11:30:55 +00:00
|
|
|
else if (update_axis == 2)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
c_yaxis =256- *v;
|
|
|
|
static_bitmap_c->SetBitmap(TASInputDlg::CreateStickBitmap(c_xaxis,c_yaxis));
|
|
|
|
}
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2012-01-22 00:39:17 +00:00
|
|
|
}
|
2012-03-02 00:00:41 +00:00
|
|
|
}
|
2011-06-27 19:44:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TASInputDlg::OnCloseWindow(wxCloseEvent& event)
|
|
|
|
{
|
|
|
|
if (event.CanVeto())
|
|
|
|
{
|
|
|
|
event.Skip(false);
|
|
|
|
this->Show(false);
|
|
|
|
ResetValues();
|
|
|
|
}
|
|
|
|
}
|
2011-07-13 05:53:56 +00:00
|
|
|
|
2013-08-29 05:33:24 +00:00
|
|
|
bool TASInputDlg::TASHasFocus()
|
2013-10-29 05:23:17 +00:00
|
|
|
{
|
2012-01-22 00:39:17 +00:00
|
|
|
//allows numbers to be used as hotkeys
|
2014-03-10 11:30:55 +00:00
|
|
|
if (TextBoxHasFocus())
|
2012-01-22 00:39:17 +00:00
|
|
|
return false;
|
|
|
|
|
2013-04-08 05:16:50 +00:00
|
|
|
if (wxWindow::FindFocus() == this)
|
|
|
|
return true;
|
2014-03-09 20:14:26 +00:00
|
|
|
else if (wxWindow::FindFocus() != nullptr &&
|
2014-03-10 11:30:55 +00:00
|
|
|
wxWindow::FindFocus()->GetParent() == this)
|
2013-04-08 05:16:50 +00:00
|
|
|
return true;
|
|
|
|
else
|
|
|
|
return false;
|
2011-07-13 05:53:56 +00:00
|
|
|
}
|
2012-01-22 00:39:17 +00:00
|
|
|
|
2012-12-23 19:01:44 +00:00
|
|
|
bool TASInputDlg::TextBoxHasFocus()
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wxWindow::FindFocus() == wx_mainX_t)
|
2012-01-22 00:39:17 +00:00
|
|
|
return true;
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wxWindow::FindFocus() == wx_mainY_t)
|
2012-01-22 00:39:17 +00:00
|
|
|
return true;
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wxWindow::FindFocus() == wx_cX_t)
|
2012-01-22 00:39:17 +00:00
|
|
|
return true;
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wxWindow::FindFocus() == wx_cY_t)
|
2012-01-22 00:39:17 +00:00
|
|
|
return true;
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wxWindow::FindFocus() == wx_l_t)
|
2012-01-22 00:39:17 +00:00
|
|
|
return true;
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wxWindow::FindFocus() == wx_r_t)
|
2012-01-22 00:39:17 +00:00
|
|
|
return true;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TASInputDlg::OnMouseUpR(wxMouseEvent& event)
|
|
|
|
{
|
|
|
|
wxSlider *sliderX,*sliderY;
|
|
|
|
wxStaticBitmap *sbitmap;
|
|
|
|
wxTextCtrl *textX, *textY;
|
|
|
|
int *x,*y;
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
switch (event.GetId())
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
case ID_MAIN_STICK:
|
|
|
|
sliderX = wx_mainX_s;
|
|
|
|
sliderY = wx_mainY_s;
|
|
|
|
textX = wx_mainX_t;
|
|
|
|
textY = wx_mainY_t;
|
|
|
|
sbitmap = static_bitmap_main;
|
|
|
|
x = &xaxis;
|
|
|
|
y = &yaxis;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_C_STICK:
|
|
|
|
sliderX = wx_cX_s;
|
|
|
|
sliderY = wx_cY_s;
|
|
|
|
textX = wx_cX_t;
|
|
|
|
textY = wx_cY_t;
|
|
|
|
sbitmap = static_bitmap_c;
|
|
|
|
x = &c_xaxis;
|
|
|
|
y = &c_yaxis;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
*x = 128;
|
|
|
|
*y = 128;
|
|
|
|
|
|
|
|
sbitmap->SetBitmap(TASInputDlg::CreateStickBitmap(*x,*y));
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2014-05-17 17:17:28 +00:00
|
|
|
textX->SetValue(wxString::Format("%i", *x));
|
|
|
|
textY->SetValue(wxString::Format("%i", 256 - *y));
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2012-01-22 00:39:17 +00:00
|
|
|
sliderX->SetValue(*x);
|
|
|
|
sliderY->SetValue(256 - *y);
|
|
|
|
event.Skip(true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-06-25 15:04:28 +00:00
|
|
|
void TASInputDlg::OnMouseDownL(wxMouseEvent& event)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
2013-06-25 15:04:28 +00:00
|
|
|
if (event.GetEventType() == wxEVT_MOTION && !event.LeftIsDown())
|
2013-06-25 14:52:25 +00:00
|
|
|
return;
|
|
|
|
|
2012-01-22 00:39:17 +00:00
|
|
|
wxSlider *sliderX,*sliderY;
|
|
|
|
wxStaticBitmap *sbitmap;
|
|
|
|
wxTextCtrl *textX, *textY;
|
|
|
|
int *x,*y;
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
switch (event.GetId())
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
case ID_MAIN_STICK:
|
|
|
|
sliderX = wx_mainX_s;
|
|
|
|
sliderY = wx_mainY_s;
|
|
|
|
textX = wx_mainX_t;
|
|
|
|
textY = wx_mainY_t;
|
|
|
|
sbitmap = static_bitmap_main;
|
|
|
|
x = &xaxis;
|
|
|
|
y = &yaxis;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_C_STICK:
|
|
|
|
sliderX = wx_cX_s;
|
|
|
|
sliderY = wx_cY_s;
|
|
|
|
textX = wx_cX_t;
|
|
|
|
textY = wx_cY_t;
|
|
|
|
sbitmap = static_bitmap_c;
|
|
|
|
x = &c_xaxis;
|
|
|
|
y = &c_yaxis;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-10-29 05:23:17 +00:00
|
|
|
wxPoint ptM(event.GetPosition());
|
2012-01-22 00:39:17 +00:00
|
|
|
*x = ptM.x *2;
|
|
|
|
*y = ptM.y * 2;
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (*x > 255)
|
2012-01-22 00:39:17 +00:00
|
|
|
*x = 255;
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (*y > 255)
|
2012-01-22 00:39:17 +00:00
|
|
|
*y = 255;
|
|
|
|
|
|
|
|
sbitmap->SetBitmap(TASInputDlg::CreateStickBitmap(*x,*y));
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2014-05-17 17:17:28 +00:00
|
|
|
textX->SetValue(wxString::Format("%i", *x));
|
|
|
|
textY->SetValue(wxString::Format("%i", 256 - *y));
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2012-01-22 00:39:17 +00:00
|
|
|
sliderX->SetValue(*x);
|
|
|
|
sliderY->SetValue(256 - *y);
|
|
|
|
event.Skip(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TASInputDlg::SetTurboFalse(wxMouseEvent& event)
|
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
switch (event.GetId())
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
case ID_A:
|
2014-03-12 14:12:29 +00:00
|
|
|
A_turbo = false;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
2013-04-08 05:16:50 +00:00
|
|
|
|
2012-01-22 00:39:17 +00:00
|
|
|
case ID_B:
|
2014-03-12 14:12:29 +00:00
|
|
|
B_turbo = false;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_X:
|
2014-03-12 14:12:29 +00:00
|
|
|
X_turbo = false;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_Y:
|
2014-03-12 14:12:29 +00:00
|
|
|
Y_turbo = false;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_Z:
|
2014-03-12 14:12:29 +00:00
|
|
|
Z_turbo = false;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_L:
|
2014-03-12 14:12:29 +00:00
|
|
|
L_turbo = false;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_R:
|
2014-03-12 14:12:29 +00:00
|
|
|
R_turbo = false;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_START:
|
2014-03-12 14:12:29 +00:00
|
|
|
START_turbo = false;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_UP:
|
2014-03-12 14:12:29 +00:00
|
|
|
DU_turbo = false;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_DOWN:
|
2014-03-12 14:12:29 +00:00
|
|
|
DD_turbo = false;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_LEFT:
|
2014-03-12 14:12:29 +00:00
|
|
|
DL_turbo = false;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_RIGHT:
|
2014-03-12 14:12:29 +00:00
|
|
|
DR_turbo = false;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
2013-04-08 05:16:50 +00:00
|
|
|
|
2012-01-22 00:39:17 +00:00
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
event.Skip(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TASInputDlg::SetTurbo(wxMouseEvent& event)
|
|
|
|
{
|
|
|
|
wxCheckBox* placeholder;
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
switch (event.GetId())
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
|
|
|
case ID_A:
|
|
|
|
placeholder = wx_a_button;
|
2014-03-12 14:12:29 +00:00
|
|
|
A_turbo = !A_turbo;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_B:
|
|
|
|
placeholder = wx_b_button;
|
2014-03-12 14:12:29 +00:00
|
|
|
B_turbo = !B_turbo;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_X:
|
|
|
|
placeholder = wx_x_button;
|
2014-03-12 14:12:29 +00:00
|
|
|
X_turbo = !X_turbo;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_Y:
|
|
|
|
placeholder = wx_y_button;
|
2014-03-12 14:12:29 +00:00
|
|
|
Y_turbo = !Y_turbo;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_Z:
|
|
|
|
placeholder = wx_z_button;
|
2014-03-12 14:12:29 +00:00
|
|
|
Z_turbo = !Z_turbo;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_L:
|
|
|
|
placeholder = wx_l_button;
|
2014-03-12 14:12:29 +00:00
|
|
|
L_turbo = !L_turbo;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_R:
|
|
|
|
placeholder = wx_r_button;
|
2014-03-12 14:12:29 +00:00
|
|
|
R_turbo = !R_turbo;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_START:
|
|
|
|
placeholder = wx_start_button;
|
2014-03-12 14:12:29 +00:00
|
|
|
START_turbo = !START_turbo;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_UP:
|
2014-03-02 23:58:54 +00:00
|
|
|
placeholder = wx_up_button;
|
2014-03-12 14:12:29 +00:00
|
|
|
DU_turbo = !DU_turbo;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_DOWN:
|
2014-03-02 23:58:54 +00:00
|
|
|
placeholder = wx_down_button;
|
2014-03-12 14:12:29 +00:00
|
|
|
DD_turbo = !DD_turbo;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_LEFT:
|
|
|
|
placeholder = wx_left_button;
|
2014-03-12 14:12:29 +00:00
|
|
|
DL_turbo = !DL_turbo;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_RIGHT:
|
|
|
|
placeholder = wx_right_button;
|
2014-03-12 14:12:29 +00:00
|
|
|
DR_turbo = !DR_turbo;
|
2012-01-22 00:39:17 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
placeholder->SetValue(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void TASInputDlg::ButtonTurbo()
|
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
if (A_turbo)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_a_button->GetValue())
|
2012-01-22 00:39:17 +00:00
|
|
|
wx_a_button->SetValue(false);
|
|
|
|
else
|
|
|
|
wx_a_button->SetValue(true);
|
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (B_turbo)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_b_button->GetValue())
|
2012-01-22 00:39:17 +00:00
|
|
|
wx_b_button->SetValue(false);
|
|
|
|
else
|
|
|
|
wx_b_button->SetValue(true);
|
|
|
|
}
|
2013-04-08 05:16:50 +00:00
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (X_turbo)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_x_button->GetValue())
|
2012-01-22 00:39:17 +00:00
|
|
|
wx_x_button->SetValue(false);
|
|
|
|
else
|
|
|
|
wx_x_button->SetValue(true);
|
|
|
|
}
|
2013-04-08 05:16:50 +00:00
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (Y_turbo)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_y_button->GetValue())
|
2012-01-22 00:39:17 +00:00
|
|
|
wx_y_button->SetValue(false);
|
|
|
|
else
|
|
|
|
wx_y_button->SetValue(true);
|
|
|
|
}
|
2013-04-08 05:16:50 +00:00
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (Z_turbo)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_z_button->GetValue())
|
2012-01-22 00:39:17 +00:00
|
|
|
wx_z_button->SetValue(false);
|
|
|
|
else
|
|
|
|
wx_z_button->SetValue(true);
|
|
|
|
}
|
2013-04-08 05:16:50 +00:00
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (L_turbo)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_l_button->GetValue())
|
2012-01-22 00:39:17 +00:00
|
|
|
wx_l_button->SetValue(false);
|
|
|
|
else
|
|
|
|
wx_l_button->SetValue(true);
|
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (R_turbo)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_r_button->GetValue())
|
2012-01-22 00:39:17 +00:00
|
|
|
wx_r_button->SetValue(false);
|
|
|
|
else
|
|
|
|
wx_r_button->SetValue(true);
|
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (START_turbo)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_start_button->GetValue())
|
2012-01-22 00:39:17 +00:00
|
|
|
wx_start_button->SetValue(false);
|
|
|
|
else
|
|
|
|
wx_start_button->SetValue(true);
|
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (DU_turbo)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_up_button->GetValue())
|
2012-01-22 00:39:17 +00:00
|
|
|
wx_up_button->SetValue(false);
|
|
|
|
else
|
|
|
|
wx_up_button->SetValue(true);
|
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (DD_turbo)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_down_button->GetValue())
|
2012-01-22 00:39:17 +00:00
|
|
|
wx_down_button->SetValue(false);
|
|
|
|
else
|
|
|
|
wx_down_button->SetValue(true);
|
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (DL_turbo)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_left_button->GetValue())
|
2012-01-22 00:39:17 +00:00
|
|
|
wx_left_button->SetValue(false);
|
|
|
|
else
|
|
|
|
wx_left_button->SetValue(true);
|
|
|
|
}
|
|
|
|
|
2014-03-10 11:30:55 +00:00
|
|
|
if (DR_turbo)
|
2012-01-22 00:39:17 +00:00
|
|
|
{
|
2014-03-10 11:30:55 +00:00
|
|
|
if (wx_right_button->GetValue())
|
2012-01-22 00:39:17 +00:00
|
|
|
wx_right_button->SetValue(false);
|
|
|
|
else
|
|
|
|
wx_right_button->SetValue(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
wxBitmap TASInputDlg::CreateStickBitmap(int x, int y)
|
|
|
|
{
|
|
|
|
x = x/2;
|
|
|
|
y = y/2;
|
2013-04-08 05:16:50 +00:00
|
|
|
|
2012-01-22 00:39:17 +00:00
|
|
|
wxMemoryDC memDC;
|
2013-04-08 05:16:50 +00:00
|
|
|
wxBitmap stick_bitmap(127, 127);
|
|
|
|
memDC.SelectObject(stick_bitmap);
|
|
|
|
memDC.SetBackground(*wxLIGHT_GREY_BRUSH);
|
|
|
|
memDC.Clear();
|
|
|
|
memDC.SetBrush(*wxWHITE_BRUSH);
|
2012-01-22 00:39:17 +00:00
|
|
|
memDC.DrawCircle(65,65,64);
|
|
|
|
memDC.SetBrush(*wxRED_BRUSH);
|
|
|
|
memDC.DrawLine(64,64,x,y);
|
|
|
|
memDC.DrawLine(63,64,x-1,y);
|
|
|
|
memDC.DrawLine(65,64,x+1,y);
|
|
|
|
memDC.DrawLine(64,63,x,y-1);
|
|
|
|
memDC.DrawLine(64,65,x,y+1);
|
|
|
|
memDC.SetPen(*wxBLACK_PEN);
|
|
|
|
memDC.CrossHair(64,64);
|
|
|
|
memDC.SetBrush(*wxBLUE_BRUSH);
|
|
|
|
memDC.DrawCircle(x,y,5);
|
2013-04-08 05:16:50 +00:00
|
|
|
memDC.SelectObject(wxNullBitmap);
|
|
|
|
return stick_bitmap;
|
2012-05-26 13:24:18 +00:00
|
|
|
}
|