EvtHandler.AddPendingEvent patches
nummish <[email protected]> Mon, 27 Dec 2004 17:46:00 -0500
| Newsgroups | gmane.comp.lib.wxwindows.wxnet |
|---|---|
| Message-ID | <[email protected]> |
I made some changes to The EvtHandler class to allow for the
AddPendingEvent call. During testing of this addition, I found a small
bug in Object.cs as well. The patches are included in this email. In
case the mail mungs the patches, they're also available at
http://www.0x90.org/~nummish/wx/
--
Bigger 1:23
This address if for mailing list traffic only.
Please direct non-list correspondence to 0x90.org
-------------------- Patches -------------------------
Index: Src/wx.NET/EvtHandler.cs
===================================================================
RCS file: /home/nummish/wxnet/wx.NET/Src/wx.NET/EvtHandler.cs,v
retrieving revision 1.44
diff -u -r1.44 EvtHandler.cs
--- Src/wx.NET/EvtHandler.cs 4 Dec 2004 10:21:27 -0000 1.44
+++ Src/wx.NET/EvtHandler.cs 24 Dec 2004 15:25:37 -0000
@@ -62,6 +62,7 @@
[DllImport("wx-c")] static extern void wxEvtHandler_Connect(IntPtr
self, int evtType, int id, int lastId, int iListener);
[DllImport("wx-c")] static extern bool
wxEvtHandler_ProcessEvent(IntPtr self, IntPtr evt);
+ [DllImport("wx-c")] static extern void
wxEvtHandler_AddPendingEvent(IntPtr self, IntPtr evt);
//---------------------------------------------------------------------
@@ -192,6 +193,13 @@
return false;
}
+
+ //---------------------------------------------------------------------
+
+ public void AddPendingEvent(Event evt)
+ {
+ wxEvtHandler_AddPendingEvent(wxObject, Object.SafePtr(evt));
+ }
//---------------------------------------------------------------------
Index: Src/wx-c/evthandler.cxx
===================================================================
RCS file: /home/nummish/wxnet/wx.NET/Src/wx-c/evthandler.cxx,v
retrieving revision 1.5
diff -u -r1.5 evthandler.cxx
--- Src/wx-c/evthandler.cxx 13 May 2004 23:26:49 -0000 1.5
+++ Src/wx-c/evthandler.cxx 23 Dec 2004 22:19:01 -0000
@@ -71,3 +71,11 @@
//-----------------------------------------------------------------------------
+extern "C" WXEXPORT
+void wxEvtHandler_AddPendingEvent(wxEvtHandler* self, wxEvent* event)
+{
+ self->AddPendingEvent(*event);
+}
+
+//-----------------------------------------------------------------------------
+
Index: Src/wx.NET/Object.cs
===================================================================
RCS file: /home/nummish/wxnet/wx.NET/Src/wx.NET/Object.cs,v
retrieving revision 1.25
diff -u -r1.25 Object.cs
--- Src/wx.NET/Object.cs 27 Nov 2004 21:29:53 -0000 1.25
+++ Src/wx.NET/Object.cs 25 Dec 2004 23:11:12 -0000
@@ -123,7 +123,7 @@
Object o = FindObject(ptr);
// If the object wasn't found, create it
- if (type != null && (o == null || o.GetType() != type)) {
+ if (!(type != null && (o == null || o.GetType() != type))) {
o = (Object)Activator.CreateInstance(type, new object[]{ptr});
}
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/