- DECLARE_DYNAMIC_CLASS(wxEvtHandler)
- public:
- wxEvtHandler(void);
- ~wxEvtHandler(void);
-
- inline wxEvtHandler *GetNextHandler(void) const { return m_nextHandler; }
- inline wxEvtHandler *GetPreviousHandler(void) const { return m_previousHandler; }
- inline void SetNextHandler(wxEvtHandler *handler) { m_nextHandler = handler; }
- inline void SetPreviousHandler(wxEvtHandler *handler) { m_previousHandler = handler; }
-
- inline void SetEvtHandlerEnabled(bool en) { m_enabled = en; }
- inline bool GetEvtHandlerEnabled(void) const { return m_enabled; }
-
- inline virtual void OnCommand(wxWindow& WXUNUSED(win), wxCommandEvent& WXUNUSED(event)) {};
- // Called if child control has no
- // callback function
- // Default behaviour
- virtual long Default(void) { if (GetNextHandler()) return GetNextHandler()->Default(); else return 0; };
-
- virtual bool OnClose(void);
-
- inline char *GetClientData(void) const { return m_clientData; }
- inline void SetClientData(char *clientData) { m_clientData = clientData; }
-
- virtual bool ProcessEvent(wxEvent& event);
- virtual bool SearchEventTable(wxEventTable& table, wxEvent& event);
-
- void Connect( int id, int lastId,
- int eventType,
- wxObjectEventFunction func,
- wxObject *userData = (wxObject *) NULL );
-
- bool SearchDynamicEventTable( wxEvent& event );
+ DECLARE_DYNAMIC_CLASS(wxEvtHandler)
+
+public:
+ wxEvtHandler();
+ ~wxEvtHandler();
+
+ wxEvtHandler *GetNextHandler() const { return m_nextHandler; }
+ wxEvtHandler *GetPreviousHandler() const { return m_previousHandler; }
+ void SetNextHandler(wxEvtHandler *handler) { m_nextHandler = handler; }
+ void SetPreviousHandler(wxEvtHandler *handler) { m_previousHandler = handler; }
+
+ void SetEvtHandlerEnabled(bool en) { m_enabled = en; }
+ bool GetEvtHandlerEnabled() const { return m_enabled; }
+
+ virtual void OnCommand(wxWindow& WXUNUSED(win),
+ wxCommandEvent& WXUNUSED(event))
+ {
+ }
+
+ // Called if child control has no
+ // callback function
+ // Default behaviour
+ virtual long Default()
+ { return GetNextHandler() ? GetNextHandler()->Default() : 0; };
+
+#if WXWIN_COMPATIBILITY
+ virtual bool OnClose();
+#endif
+
+#if wxUSE_THREADS
+ bool ProcessThreadEvent(wxEvent& event);
+ void ProcessPendingEvents();
+#endif
+ virtual bool ProcessEvent(wxEvent& event);
+ virtual bool SearchEventTable(wxEventTable& table, wxEvent& event);
+
+ // Dynamic association of a member function handler with the event handler,
+ // id and event type
+ void Connect( int id, int lastId, wxEventType eventType,
+ wxObjectEventFunction func,
+ wxObject *userData = (wxObject *) NULL );
+
+ // Convenience function: take just one id
+ void Connect( int id, wxEventType eventType,
+ wxObjectEventFunction func,
+ wxObject *userData = (wxObject *) NULL )
+ { Connect(id, -1, eventType, func, userData); }
+
+ bool SearchDynamicEventTable( wxEvent& event );
+
+#if wxUSE_THREADS
+ void ClearEventLocker() { delete m_eventsLocker; m_eventsLocker = NULL; };
+#endif