]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/mousestate.h
Don't define __STRICT_ANSI__, we should build both with and without it.
[wxWidgets.git] / include / wx / mousestate.h
index 7ad3ec4999bc0eedb14eef6384ffc9262cb56738..2ea1cc5bf1daf6d190ebbac664d16b73062dd067 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     Declaration of wxMouseState class
 // Author:      Vadim Zeitlin
 // Created:     2008-09-19 (extracted from wx/utils.h)
-// RCS-ID:      $Id$
 // Copyright:   (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
@@ -11,6 +10,7 @@
 #ifndef _WX_MOUSESTATE_H_
 #define _WX_MOUSESTATE_H_
 
+#include "wx/gdicmn.h"      // for wxPoint
 #include "wx/kbdstate.h"
 
 // the symbolic names for the mouse buttons
@@ -78,10 +78,6 @@ public:
     {
         switch ( but )
         {
-            default:
-                wxFAIL_MSG(wxT("invalid parameter in wxMouseState::ButtonIsDown"));
-                // fall through
-
             case wxMOUSE_BTN_ANY:
                 return LeftIsDown() || MiddleIsDown() || RightIsDown() ||
                             Aux1IsDown() || Aux2IsDown();
@@ -100,7 +96,14 @@ public:
 
             case wxMOUSE_BTN_AUX2:
                 return Aux2IsDown();
+
+            case wxMOUSE_BTN_NONE:
+            case wxMOUSE_BTN_MAX:
+                break;
         }
+
+        wxFAIL_MSG(wxS("invalid parameter"));
+        return false;
     }
 
 
@@ -118,6 +121,15 @@ public:
     // this mostly makes sense in the derived classes such as wxMouseEvent
     void SetState(const wxMouseState& state) { *this = state; }
 
+    // these functions are for compatibility only, they were used in 2.8
+    // version of wxMouseState but their names are confusing as wxMouseEvent
+    // has methods with the same names which do something quite different so
+    // don't use them any more
+#if WXWIN_COMPATIBILITY_2_8
+    wxDEPRECATED_INLINE(bool LeftDown() const, return LeftIsDown(); )
+    wxDEPRECATED_INLINE(bool MiddleDown() const, return MiddleIsDown(); )
+    wxDEPRECATED_INLINE(bool RightDown() const, return RightIsDown(); )
+#endif // WXWIN_COMPATIBILITY_2_8
 
     // for compatibility reasons these variables are public as the code using
     // wxMouseEvent often uses them directly -- however they should not be