]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/event.h
Don't define wxADJUST_MINSIZE if it had been already defined.
[wxWidgets.git] / include / wx / event.h
index 210d323bb8440cdfa52d171087f5eb109898f8c0..36f7a8b73edda435f11644cb7179ad703ba740da 100644 (file)
@@ -27,6 +27,7 @@
 #include "wx/thread.h"
 #include "wx/tracker.h"
 #include "wx/typeinfo.h"
+#include "wx/any.h"
 
 #ifdef wxHAS_EVENT_BIND
     #include "wx/meta/convertible.h"
@@ -1203,16 +1204,15 @@ public:
         // make sure our string member (which uses COW, aka refcounting) is not
         // shared by other wxString instances:
         SetString(GetString().c_str());
+
+#if wxUSE_ANY && (!defined(__VISUALC__) || wxCHECK_VISUALC_VERSION(7))
+        m_payload = event.m_payload;
+#endif
     }
 
     virtual wxEvent *Clone() const
     {
-        wxThreadEvent* ev = new wxThreadEvent(*this);
-
-        // make sure our string member (which uses COW, aka refcounting) is not
-        // shared by other wxString instances:
-        ev->SetString(GetString().c_str());
-        return ev;
+        return new wxThreadEvent(*this);
     }
 
     // this is important to avoid that calling wxEventLoopBase::YieldFor thread events
@@ -1220,6 +1220,23 @@ public:
     virtual wxEventCategory GetEventCategory() const
         { return wxEVT_CATEGORY_THREAD; }
 
+#if wxUSE_ANY && (!defined(__VISUALC__) || wxCHECK_VISUALC_VERSION(7))
+    template<typename T>
+    void SetPayload(const T& payload)
+    {
+        m_payload = payload;
+    }
+
+    template<typename T>
+    T GetPayload() const
+    {
+        return m_payload.As<T>();
+    }
+
+protected:
+    wxAny m_payload;
+#endif // wxUSE_ANY && (!defined(__VISUALC__) || wxCHECK_VISUALC_VERSION(7))
+
 private:
     DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxThreadEvent)
 };
@@ -3923,12 +3940,12 @@ typedef void (wxEvtHandler::*wxClipboardTextEventFunction)(wxClipboardTextEvent&
 #ifdef wxHAS_EVENT_BIND
     #define wxBIND_OR_CONNECT_HACK_BASE_CLASS
     #define wxBIND_OR_CONNECT_HACK_ONLY_BASE_CLASS
-    #define wxBIND_OR_CONNECT_HACK(w, evt, handler, func, obj) \
+    #define wxBIND_OR_CONNECT_HACK(win, evt, handler, func, obj) \
         win->Bind(evt, &func, obj)
 #else // wxHAS_EVENT_BIND
     #define wxBIND_OR_CONNECT_HACK_BASE_CLASS public wxEvtHandler,
     #define wxBIND_OR_CONNECT_HACK_ONLY_BASE_CLASS : public wxEvtHandler
-    #define wxBIND_OR_CONNECT_HACK(w, evt, handler, func, obj) \
+    #define wxBIND_OR_CONNECT_HACK(win, evt, handler, func, obj) \
         win->Connect(evt, handler(func), NULL, obj)
 #endif // wxHAS_EVENT_BIND