X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f8f7cff4368ee960f63f61d0dd32eacdd471800b..e143fb636d50d5802dcc8c7c2e9e8e2944afa467:/include/wx/event.h?ds=sidebyside diff --git a/include/wx/event.h b/include/wx/event.h index 70fd7df823..b18f39bed8 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -237,12 +237,7 @@ public: m_method = method; } - virtual void operator()(wxEvtHandler *handler, wxEvent& event) - { - wxEvtHandler * const realHandler = m_handler ? m_handler : handler; - - (realHandler->*m_method)(event); - } + virtual void operator()(wxEvtHandler *handler, wxEvent& event); virtual bool Matches(const wxEventFunctor& func) const { @@ -397,7 +392,7 @@ class wxEventFunctorMethod < Class, EventArg, - wxConvertibleTo::value + wxConvertibleTo::value != 0 > { private: @@ -1110,6 +1105,14 @@ public: : wxCommandEvent(eventType, id) { } + wxThreadEvent(const wxThreadEvent& event) + : wxCommandEvent(event) + { + // make sure our string member (which uses COW, aka refcounting) is not + // shared by other wxString instances: + SetString(GetString().c_str()); + } + virtual wxEvent *Clone() const { wxThreadEvent* ev = new wxThreadEvent(*this); @@ -2425,7 +2428,7 @@ public: virtual wxEvent *Clone() const { return new wxNavigationKeyEvent(*this); } - enum + enum wxNavigationKeyEventFlags { IsBackward = 0x0000, IsForward = 0x0001, @@ -3401,6 +3404,13 @@ private: wxDECLARE_NO_ASSIGN_CLASS(wxEventConnectionRef); }; +inline void wxObjectEventFunctor::operator()(wxEvtHandler *handler, wxEvent& event) +{ + wxEvtHandler * const realHandler = m_handler ? m_handler : handler; + + (realHandler->*m_method)(event); +} + // Post a message to the given event handler which will be processed during the // next event loop iteration. //