From 907ea7d5cc64befac486b269b3ab5b87dfc246d5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 14 Nov 2011 12:51:47 +0000 Subject: [PATCH] No changes, just add another case to a switch on wxMouseButton. Fix warnings given when wx headers are compiled with g++ -Wswitch-enum option. Also make the assert messages more precise and less verbose as there is no need to include the function name in them, all relatively recent compilers provide it via __FUNCTION__ and wxFAIL_MSG() already uses it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69756 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mousestate.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/wx/mousestate.h b/include/wx/mousestate.h index 21eee5cb0e..f338ea55d9 100644 --- a/include/wx/mousestate.h +++ b/include/wx/mousestate.h @@ -79,10 +79,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(); @@ -101,6 +97,15 @@ public: case wxMOUSE_BTN_AUX2: return Aux2IsDown(); + + case wxMOUSE_BTN_NONE: + case wxMOUSE_BTN_MAX: + wxFAIL_MSG(wxS("invalid parameter")); + return false; + + default: + wxFAIL_MSG(wxS("unknown parameter")); + return false; } } -- 2.45.2