]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/event.h
allow using CPPUNIT_ASSERT_EQUAL(int,unsigned) even on 64 bit platforms (see r59576)
[wxWidgets.git] / include / wx / event.h
index 302036e45e9c09ff96160a286431b5365da129e6..7af59c38d78554e1ba584723c5fe19bd45aa1621 100644 (file)
@@ -811,7 +811,8 @@ enum wxEventCategory
     // used in wxEventLoopBase::YieldFor to specify all event categories should be processed:
     wxEVT_CATEGORY_ALL =
         wxEVT_CATEGORY_UI|wxEVT_CATEGORY_USER_INPUT|wxEVT_CATEGORY_SOCKET| \
-        wxEVT_CATEGORY_TIMER|wxEVT_CATEGORY_THREAD
+        wxEVT_CATEGORY_TIMER|wxEVT_CATEGORY_THREAD|wxEVT_CATEGORY_UNKNOWN| \
+        wxEVT_CATEGORY_CLIPBOARD
 };
 
 /*
@@ -2864,7 +2865,6 @@ public:
     // Event queuing and processing
     // ----------------------------
 
-
     // Process an event right now: this can only be called from the main
     // thread, use QueueEvent() for scheduling the events for
     // processing from other threads.
@@ -2900,9 +2900,11 @@ public:
     void ProcessPendingEvents();
         // NOTE: uses ProcessEvent()
 
+    void DeletePendingEvents();
+
 #if wxUSE_THREADS
     bool ProcessThreadEvent(const wxEvent& event);
-        // NOTE: uses AddPendingEvent()
+        // NOTE: uses AddPendingEvent(); call only from secondary threads
 #endif
 
 
@@ -3804,6 +3806,41 @@ typedef void (wxEvtHandler::*wxClipboardTextEventFunction)(wxClipboardTextEvent&
 // Helper functions
 // ----------------------------------------------------------------------------
 
+// This is an ugly hack to allow the use of Bind() instead of Connect() inside
+// the library code if the library was built with support for it, here is how
+// it is used:
+//
+// class SomeEventHandlingClass : wxBIND_OR_CONNECT_HACK_BASE_CLASS
+//                                public SomeBaseClass
+// {
+// public:
+//     SomeEventHandlingClass(wxWindow *win)
+//     {
+//         // connect to the event for the given window
+//         wxBIND_OR_CONNECT_HACK(win, wxEVT_SOMETHING, wxSomeEventHandler,
+//                                SomeEventHandlingClass::OnSomeEvent, this);
+//     }
+//
+// private:
+//     void OnSomeEvent(wxSomeEvent&) { ... }
+// };
+//
+// This is *not* meant to be used by library users, it is only defined here
+// (and not in a private header) because the base class must be visible from
+// other public headers, please do NOT use this in your code, it will be
+// removed from future wx versions without warning.
+#if wxEVENTS_COMPATIBILITY_2_8
+    #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) \
+        win->Connect(evt, handler(func), NULL, obj)
+#else // wxEVENTS_COMPATIBILITY_2_8
+    #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) \
+        win->Bind(evt, &func, obj)
+#endif // wxEVENTS_COMPATIBILITY_2_8/!wxEVENTS_COMPATIBILITY_2_8
+
 #if wxUSE_GUI
 
 // Find a window with the focus, that is also a descendant of the given window.