]> git.saurik.com Git - wxWidgets.git/commitdiff
Show extra mouse buttons and wheel state in the text sample output too.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 9 Jul 2011 23:36:50 +0000 (23:36 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 9 Jul 2011 23:36:50 +0000 (23:36 +0000)
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

samples/text/text.cpp

index 624770bc0ebf3b03636fa769e28979aac2230f6e..6c3ddf400ad1b3eaff82169ef2ea879c388ff7be 100644 (file)
@@ -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') )