]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/event.cpp
combobox buglet when inserting item
[wxWidgets.git] / src / common / event.cpp
index 904178bc7b6445666a2d30d3c60c18c83d7e64ce..2f4f8be170758692659a2a7079c5534a6b959092 100644 (file)
@@ -105,6 +105,22 @@ wxEvent::wxEvent(int theId)
     m_isCommandEvent = FALSE;
 }
 
+wxObject *wxEvent::Clone() const
+{
+    wxEvent *event = (wxEvent *)wxObject::Clone();
+
+    event->m_eventType = m_eventType;
+    event->m_eventObject = m_eventObject;
+    event->m_eventHandle = m_eventHandle;
+    event->m_timeStamp = m_timeStamp;
+    event->m_id = m_id;
+    event->m_skipped = m_skipped;
+    event->m_callbackUserData = m_callbackUserData;
+    event->m_isCommandEvent = m_isCommandEvent;
+
+    return event;
+}
+
 /*
  * Command events
  *
@@ -118,7 +134,7 @@ wxCommandEvent::wxCommandEvent(wxEventType commandType, int theId)
     m_extraLong = 0;
     m_commandInt = 0;
     m_id = theId;
-    m_commandString = (char *) NULL;
+    m_commandString = (wxChar *) NULL;
     m_isCommandEvent = TRUE;
 }
 
@@ -317,10 +333,10 @@ wxEvtHandler::~wxEvtHandler()
         delete m_dynamicEvents;
     };
 
+#if wxUSE_THREADS
     if (m_pendingEvents)
       delete m_pendingEvents;
 
-#if wxUSE_THREADS
     delete m_eventsLocker;
 #endif
 }
@@ -337,8 +353,7 @@ bool wxEvtHandler::ProcessThreadEvent(wxEvent& event)
     if (m_pendingEvents == NULL)
       m_pendingEvents = new wxList();
 
-    event_main = (wxEvent *)event.GetClassInfo()->CreateObject();
-    *event_main = event;
+    event_main = (wxEvent *)event.Clone();
 
     m_pendingEvents->Append(event_main);