From 0fe243db0c0447b69917eaa6d3a0e32743229638 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 16 Apr 2009 21:23:28 +0000 Subject: [PATCH] remove wxNewEventFunctor() overload which allowed calls to "Bind(evt, &WrongClass::method)" to compile git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/event.h | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/include/wx/event.h b/include/wx/event.h index 7898489b97..622a44a973 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -78,7 +78,7 @@ typedef int wxEventType; #define wxStaticCastEvent(type, val) static_cast(val) #define DECLARE_EVENT_TABLE_ENTRY(type, winid, idLast, fn, obj) \ - wxEventTableEntry(type, winid, idLast, wxNewEventFunctor(type, fn), obj) + wxEventTableEntry(type, winid, idLast, wxNewEventTableFunctor(type, fn), obj) #define DECLARE_EVENT_TABLE_TERMINATOR() \ wxEventTableEntry(wxEVT_NULL, 0, 0, 0, 0) @@ -507,25 +507,17 @@ wxMakeEventFunctor(const EventTag&, method, handler); } -// Special case for the wxNewEventFunctor() calls used inside the event table -// macros: they don't specify the handler so EventHandler can't be deduced +// Create an event functor for the event table via DECLARE_EVENT_TABLE_ENTRY: +// in this case we don't have the handler (as it's always the same as the +// object which generated the event) so we must use Class as its type template inline wxEventFunctorMethod * -wxNewEventFunctor(const EventTag&, void (Class::*method)(EventArg&)) +wxNewEventTableFunctor(const EventTag&, void (Class::*method)(EventArg&)) { return new wxEventFunctorMethod( method, NULL); } -template - -inline wxEventFunctorMethod -wxMakeEventFunctor(const EventTag&, void (Class::*method)(EventArg&)) -{ - return wxEventFunctorMethod( - method, NULL); -} - #endif // !wxEVENTS_COMPATIBILITY_2_8 -- 2.45.2