]> git.saurik.com Git - wxWidgets.git/commitdiff
compilation fix for wxEVENTS_COMPATIBILITY_2_8 case
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 6 Feb 2009 21:54:09 +0000 (21:54 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 6 Feb 2009 21:54:09 +0000 (21:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58694 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/events/evthandler.cpp

index ea866600201362f5bce3d3008b22c65cba1839ee..0d831307b3506206b3831a0af4bcf28f8bfffb87 100644 (file)
@@ -36,7 +36,10 @@ public:
     virtual wxEvent *Clone() const { return new MyEvent; }
 };
 
     virtual wxEvent *Clone() const { return new MyEvent; }
 };
 
-#define EVT_MYEVENT(func) wx__DECLARE_EVT0(MyEventType, &func)
+typedef void (wxEvtHandler::*MyEventFunction)(MyEvent&);
+#define MyEventHandler(func) wxEVENT_HANDLER_CAST(MyEventFunction, func)
+#define EVT_MYEVENT(func) \
+    wx__DECLARE_EVT0(MyEventType, MyEventHandler(func))
 
 class AnotherEvent : public wxEvent
 {
 
 class AnotherEvent : public wxEvent
 {
@@ -123,7 +126,9 @@ BEGIN_EVENT_TABLE(MyClassWithEventTable, wxEvtHandler)
     EVT_IDLE(MyClassWithEventTable::OnIdle)
 
     EVT_MYEVENT(MyClassWithEventTable::OnMyEvent)
     EVT_IDLE(MyClassWithEventTable::OnIdle)
 
     EVT_MYEVENT(MyClassWithEventTable::OnMyEvent)
+#if !wxEVENTS_COMPATIBILITY_2_8
     EVT_MYEVENT(MyClassWithEventTable::OnEvent)
     EVT_MYEVENT(MyClassWithEventTable::OnEvent)
+#endif
 
     // this shouldn't compile:
     //EVT_MYEVENT(MyClassWithEventTable::OnIdle)
 
     // this shouldn't compile:
     //EVT_MYEVENT(MyClassWithEventTable::OnIdle)