From: Vadim Zeitlin Date: Sat, 9 Jul 2011 23:36:50 +0000 (+0000) Subject: Show extra mouse buttons and wheel state in the text sample output too. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/dcd6f736546247c0709db9b1ec4ab3c6cc050bf8 Show extra mouse buttons and wheel state in the text sample output too. Do it for consistency, as the state of all the other buttons is already shown, and also to have some place for testing this functionality. Closes #13309. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68211 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/text/text.cpp b/samples/text/text.cpp index 624770bc0e..6c3ddf400a 100644 --- a/samples/text/text.cpp +++ b/samples/text/text.cpp @@ -733,10 +733,27 @@ static wxString GetMouseEventDesc(const wxMouseEvent& ev) dbl = ev.RightDClick(); up = ev.RightUp(); } + else if ( ev.Aux1Down() || ev.Aux1Up() || ev.Aux1DClick() ) + { + button = wxT("Aux1"); + dbl = ev.Aux1DClick(); + up = ev.Aux1Up(); + } + else if ( ev.Aux2Down() || ev.Aux2Up() || ev.Aux2DClick() ) + { + button = wxT("Aux2"); + dbl = ev.Aux2DClick(); + up = ev.Aux2Up(); + } + else if ( ev.GetWheelRotation() ) + { + return wxString::Format("Wheel rotation %+d", ev.GetWheelRotation()); + } else { return wxT("Unknown mouse event"); } + wxASSERT(!(dbl && up)); return wxString::Format(wxT("%s mouse button %s"), button.c_str(), @@ -780,6 +797,8 @@ void MyTextCtrl::OnMouseEvent(wxMouseEvent& ev) << GetChar( ev.LeftIsDown(), wxT('1') ) << GetChar( ev.MiddleIsDown(), wxT('2') ) << GetChar( ev.RightIsDown(), wxT('3') ) + << GetChar( ev.Aux1IsDown(), wxT('x') ) + << GetChar( ev.Aux2IsDown(), wxT('X') ) << GetChar( ev.ControlDown(), wxT('C') ) << GetChar( ev.AltDown(), wxT('A') ) << GetChar( ev.ShiftDown(), wxT('S') )