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