X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c058cafa56179e79df02ad370bdeafd725ff2478..777819af7b7b4ad98ac69a7cd5a96728c197b1fc:/include/wx/event.h diff --git a/include/wx/event.h b/include/wx/event.h index 4a456f1dbb..109c842ffb 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -2258,7 +2258,10 @@ protected: // wxEvtHandler: the base class for all objects handling wxWidgets events // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_BASE wxEvtHandler : public wxObject, public wxTrackable +class WXDLLIMPEXP_BASE wxEvtHandler : public wxObject +#if wxUSE_WEAKREF + , public wxTrackable +#endif { public: wxEvtHandler(); @@ -2358,7 +2361,9 @@ public: // Avoid problems at exit by cleaning up static hash table gracefully void ClearEventHashTable() { GetEventHashTable().Clear(); } +#if wxUSE_WEAKREF void OnSinkDestroyed( wxEvtHandler *sink ); +#endif private: static const wxEventTableEntry sm_eventTableEntries[]; @@ -2425,13 +2430,16 @@ protected: virtual void DoSetClientData( void *data ); virtual void *DoGetClientData() const; +#if wxUSE_WEAKREF // Search tracker objects for event connection with this sink wxEventConnectionRef *FindRefInTrackerList(wxEvtHandler *eventSink); +#endif private: DECLARE_DYNAMIC_CLASS_NO_COPY(wxEvtHandler) }; +#if wxUSE_WEAKREF // ---------------------------------------------------------------------------- // wxEventConnectionRef represents all connections between two event handlers // and enables automatic disconnect when an event handler sink goes out of @@ -2480,6 +2488,7 @@ private: DECLARE_NO_ASSIGN_CLASS(wxEventConnectionRef) }; +#endif // wxUSE_WEAKREF // Post a message to the given eventhandler which will be processed during the // next event loop iteration @@ -2491,9 +2500,12 @@ inline void wxPostEvent(wxEvtHandler *dest, const wxEvent& event) } typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&); +typedef void (wxEvtHandler::*wxIdleEventFunction)(wxIdleEvent&); #define wxEventHandler(func) \ (wxObjectEventFunction)wxStaticCastEvent(wxEventFunction, &func) +#define wxIdleEventHandler(func) \ + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxIdleEventFunction, &func) #if wxUSE_GUI @@ -2541,7 +2553,6 @@ typedef void (wxEvtHandler::*wxInitDialogEventFunction)(wxInitDialogEvent&); typedef void (wxEvtHandler::*wxSysColourChangedEventFunction)(wxSysColourChangedEvent&); typedef void (wxEvtHandler::*wxDisplayChangedEventFunction)(wxDisplayChangedEvent&); typedef void (wxEvtHandler::*wxUpdateUIEventFunction)(wxUpdateUIEvent&); -typedef void (wxEvtHandler::*wxIdleEventFunction)(wxIdleEvent&); typedef void (wxEvtHandler::*wxCloseEventFunction)(wxCloseEvent&); typedef void (wxEvtHandler::*wxShowEventFunction)(wxShowEvent&); typedef void (wxEvtHandler::*wxIconizeEventFunction)(wxIconizeEvent&); @@ -2601,8 +2612,6 @@ typedef void (wxEvtHandler::*wxClipboardTextEventFunction)(wxClipboardTextEvent& (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDisplayChangedEventFunction, &func) #define wxUpdateUIEventHandler(func) \ (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxUpdateUIEventFunction, &func) -#define wxIdleEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxIdleEventFunction, &func) #define wxCloseEventHandler(func) \ (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCloseEventFunction, &func) #define wxShowEventHandler(func) \