- //
- // Disconnect a method from an event:
- //
-
- template <typename EventType, typename Class>
- bool Disconnect( int winid,
- int lastId,
- const EventType &eventType,
- void ( Class::*func )( typename EventType::CorrespondingEvent & ),
- wxObject *userData = NULL )
- {
- wxEventFunctorMethod< EventType, Class, Class > functor =
- wxConstructEventFunctor( eventType, func, static_cast< Class * const >( this ));
-
- return Unsubscribe( winid, lastId, eventType, functor, userData );
- }
-
- template <typename EventType, typename Class>
- bool Disconnect( int winid,
- const EventType &eventType,
- void ( Class::*func )( typename EventType::CorrespondingEvent & ),
- wxObject *userData = NULL )
- { return Disconnect( winid, wxID_ANY, eventType, func, userData ); }
-
- template <typename EventType, typename Class>
- bool Disconnect( const EventType &eventType,
- void ( Class::*func )( typename EventType::CorrespondingEvent & ),
- wxObject *userData = NULL )
- { return Disconnect( wxID_ANY, wxID_ANY, eventType, func, userData ); }
-
- template <typename EventType, typename Class, typename Derived>
- bool Disconnect( int winid,
- int lastId,
- const EventType &eventType,
- void ( Class::*func )( typename EventType::CorrespondingEvent & ),
- wxObject *userData = NULL,
- Derived *eventSink = NULL )
- {
- wxEventFunctorMethod< EventType, Class, Derived > functor =
- wxConstructEventFunctor( eventType, func, eventSink );
-
- return Unsubscribe( winid, lastId, eventType, functor, userData );
- }
-
- template <typename EventType, typename Class, typename Derived>
- bool Disconnect( int winid,
- const EventType &eventType,
- void ( Class::*func )( typename EventType::CorrespondingEvent & ),
- wxObject *userData = NULL,
- Derived *eventSink = NULL )
- { return Disconnect( winid, wxID_ANY, eventType, func, userData, eventSink ); }
-
- template <typename EventType, typename Class, typename Derived>
- bool Disconnect( const EventType &eventType,
- void ( Class::*func )( typename EventType::CorrespondingEvent & ),
- wxObject *userData = NULL,
- Derived *eventSink = NULL )
- { return Disconnect( wxID_ANY, wxID_ANY, eventType, func, userData, eventSink ); }
-
- template <typename Sender, typename EventType, typename Class, typename Derived>
- static bool Disconnect( Sender *sender,
- int winid,
- int lastId,
- const EventType &eventType,
- void ( Class::*func )( typename EventType::CorrespondingEvent & ),
- wxObject *userData = NULL,
- Derived *eventSink = NULL )