Fix last commit, and set the position on mouse down instead of mouse up.

This commit is contained in:
Rachel Bryk 2013-06-25 11:04:28 -04:00
parent b892d838ff
commit 5904ffb21d
2 changed files with 7 additions and 7 deletions

View File

@ -41,8 +41,8 @@ TASInputDlg::TASInputDlg(wxWindow *parent, wxWindowID id, const wxString &title,
wxBoxSizer* const main_stick_box = new wxBoxSizer(wxVERTICAL); wxBoxSizer* const main_stick_box = new wxBoxSizer(wxVERTICAL);
static_bitmap_main = new wxStaticBitmap(this, ID_MAIN_STICK, TASInputDlg::CreateStickBitmap(128,128), wxDefaultPosition, wxDefaultSize); static_bitmap_main = new wxStaticBitmap(this, ID_MAIN_STICK, TASInputDlg::CreateStickBitmap(128,128), wxDefaultPosition, wxDefaultSize);
static_bitmap_main->Bind(wxEVT_LEFT_UP, &TASInputDlg::OnMouseUpL, this); static_bitmap_main->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::OnMouseDownL, this);
static_bitmap_main->Bind(wxEVT_MOTION, &TASInputDlg::OnMouseUpL, this); static_bitmap_main->Bind(wxEVT_MOTION, &TASInputDlg::OnMouseDownL, this);
static_bitmap_main->Bind(wxEVT_RIGHT_UP, &TASInputDlg::OnMouseUpR, this); static_bitmap_main->Bind(wxEVT_RIGHT_UP, &TASInputDlg::OnMouseUpR, this);
wx_mainX_s = new wxSlider(this, ID_MAIN_X_SLIDER, 128, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL); wx_mainX_s = new wxSlider(this, ID_MAIN_X_SLIDER, 128, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL);
wx_mainX_s->SetMinSize(wxSize(120,-1)); wx_mainX_s->SetMinSize(wxSize(120,-1));
@ -68,8 +68,8 @@ TASInputDlg::TASInputDlg(wxWindow *parent, wxWindowID id, const wxString &title,
wxBoxSizer* const c_stick_box = new wxBoxSizer(wxVERTICAL); wxBoxSizer* const c_stick_box = new wxBoxSizer(wxVERTICAL);
static_bitmap_c = new wxStaticBitmap(this, ID_C_STICK, TASInputDlg::CreateStickBitmap(128,128), wxDefaultPosition, wxDefaultSize); static_bitmap_c = new wxStaticBitmap(this, ID_C_STICK, TASInputDlg::CreateStickBitmap(128,128), wxDefaultPosition, wxDefaultSize);
static_bitmap_c->Bind(wxEVT_LEFT_UP, &TASInputDlg::OnMouseUpL, this); static_bitmap_c->Bind(wxEVT_LEFT_DOWN, &TASInputDlg::OnMouseDownL, this);
static_bitmap_c->Bind(wxEVT_MOTION, &TASInputDlg::OnMouseUpL, this); static_bitmap_c->Bind(wxEVT_MOTION, &TASInputDlg::OnMouseDownL, this);
static_bitmap_c->Bind(wxEVT_RIGHT_UP, &TASInputDlg::OnMouseUpR, this); static_bitmap_c->Bind(wxEVT_RIGHT_UP, &TASInputDlg::OnMouseUpR, this);
wx_cX_s = new wxSlider(this, ID_C_X_SLIDER, 128, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL); wx_cX_s = new wxSlider(this, ID_C_X_SLIDER, 128, 0, 255, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL);
wx_cX_s->SetMinSize(wxSize(120,-1)); wx_cX_s->SetMinSize(wxSize(120,-1));
@ -754,9 +754,9 @@ void TASInputDlg::OnMouseUpR(wxMouseEvent& event)
} }
void TASInputDlg::OnMouseUpL(wxMouseEvent& event) void TASInputDlg::OnMouseDownL(wxMouseEvent& event)
{ {
if (!event.LeftIsDown()) if (event.GetEventType() == wxEVT_MOTION && !event.LeftIsDown())
return; return;
wxSlider *sliderX,*sliderY; wxSlider *sliderX,*sliderY;

View File

@ -24,7 +24,7 @@ class TASInputDlg : public wxDialog
void OnCloseWindow(wxCloseEvent& event); void OnCloseWindow(wxCloseEvent& event);
void UpdateFromSliders(wxCommandEvent& event); void UpdateFromSliders(wxCommandEvent& event);
void UpdateFromText(wxCommandEvent& event); void UpdateFromText(wxCommandEvent& event);
void OnMouseUpL(wxMouseEvent& event); void OnMouseDownL(wxMouseEvent& event);
void OnMouseUpR(wxMouseEvent& event); void OnMouseUpR(wxMouseEvent& event);
void ResetValues(); void ResetValues();
void GetValues(SPADStatus *PadStatus, int controllerID); void GetValues(SPADStatus *PadStatus, int controllerID);