]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/event.cpp
reverted the fix for Unicode compilation with VC++ as it breaks other ports (and...
[wxWidgets.git] / src / common / event.cpp
index 897280b804d5a2e91cc9e9063d5e9d00ddcd153a..e9a76b3fd2355631b84d26ded1a09a3708ca9f2d 100644 (file)
@@ -52,9 +52,9 @@
 
 IMPLEMENT_DYNAMIC_CLASS(wxEvtHandler, wxObject)
 IMPLEMENT_ABSTRACT_CLASS(wxEvent, wxObject)
 
 IMPLEMENT_DYNAMIC_CLASS(wxEvtHandler, wxObject)
 IMPLEMENT_ABSTRACT_CLASS(wxEvent, wxObject)
-IMPLEMENT_DYNAMIC_CLASS(wxIdleEvent, wxEvent)
 
 #if wxUSE_GUI
 
 #if wxUSE_GUI
+    IMPLEMENT_DYNAMIC_CLASS(wxIdleEvent, wxEvent)
     IMPLEMENT_DYNAMIC_CLASS(wxCommandEvent, wxEvent)
     IMPLEMENT_DYNAMIC_CLASS(wxNotifyEvent, wxCommandEvent)
     IMPLEMENT_DYNAMIC_CLASS(wxScrollEvent, wxCommandEvent)
     IMPLEMENT_DYNAMIC_CLASS(wxCommandEvent, wxEvent)
     IMPLEMENT_DYNAMIC_CLASS(wxNotifyEvent, wxCommandEvent)
     IMPLEMENT_DYNAMIC_CLASS(wxScrollEvent, wxCommandEvent)
@@ -67,6 +67,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxIdleEvent, wxEvent)
     IMPLEMENT_DYNAMIC_CLASS(wxEraseEvent, wxEvent)
     IMPLEMENT_DYNAMIC_CLASS(wxMoveEvent, wxEvent)
     IMPLEMENT_DYNAMIC_CLASS(wxFocusEvent, wxEvent)
     IMPLEMENT_DYNAMIC_CLASS(wxEraseEvent, wxEvent)
     IMPLEMENT_DYNAMIC_CLASS(wxMoveEvent, wxEvent)
     IMPLEMENT_DYNAMIC_CLASS(wxFocusEvent, wxEvent)
+    IMPLEMENT_DYNAMIC_CLASS(wxChildFocusEvent, wxCommandEvent)
     IMPLEMENT_DYNAMIC_CLASS(wxCloseEvent, wxEvent)
     IMPLEMENT_DYNAMIC_CLASS(wxShowEvent, wxEvent)
     IMPLEMENT_DYNAMIC_CLASS(wxMaximizeEvent, wxEvent)
     IMPLEMENT_DYNAMIC_CLASS(wxCloseEvent, wxEvent)
     IMPLEMENT_DYNAMIC_CLASS(wxShowEvent, wxEvent)
     IMPLEMENT_DYNAMIC_CLASS(wxMaximizeEvent, wxEvent)
@@ -120,8 +121,6 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_CHOICE_SELECTED)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_LISTBOX_SELECTED)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_LISTBOX_SELECTED)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_UPDATED)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_ENTER)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_MENU_SELECTED)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_SLIDER_UPDATED)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_RADIOBOX_SELECTED)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_MENU_SELECTED)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_SLIDER_UPDATED)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_RADIOBOX_SELECTED)
@@ -152,6 +151,7 @@ DEFINE_EVENT_TYPE(wxEVT_MIDDLE_DCLICK)
 DEFINE_EVENT_TYPE(wxEVT_RIGHT_DCLICK)
 DEFINE_EVENT_TYPE(wxEVT_SET_FOCUS)
 DEFINE_EVENT_TYPE(wxEVT_KILL_FOCUS)
 DEFINE_EVENT_TYPE(wxEVT_RIGHT_DCLICK)
 DEFINE_EVENT_TYPE(wxEVT_SET_FOCUS)
 DEFINE_EVENT_TYPE(wxEVT_KILL_FOCUS)
+DEFINE_EVENT_TYPE(wxEVT_CHILD_FOCUS)
 DEFINE_EVENT_TYPE(wxEVT_MOUSEWHEEL)
 
 // Non-client mouse events
 DEFINE_EVENT_TYPE(wxEVT_MOUSEWHEEL)
 
 // Non-client mouse events
@@ -724,8 +724,6 @@ wxWindowDestroyEvent::wxWindowDestroyEvent(wxWindow *win)
     SetEventObject(win);
 }
 
     SetEventObject(win);
 }
 
-#endif // wxUSE_GUI
-
 void wxIdleEvent::CopyObject(wxObject& obj_d) const
 {
     wxIdleEvent *obj = (wxIdleEvent *)&obj_d;
 void wxIdleEvent::CopyObject(wxObject& obj_d) const
 {
     wxIdleEvent *obj = (wxIdleEvent *)&obj_d;
@@ -734,6 +732,18 @@ void wxIdleEvent::CopyObject(wxObject& obj_d) const
     obj->m_requestMore = m_requestMore;
 }
 
     obj->m_requestMore = m_requestMore;
 }
 
+wxChildFocusEvent::wxChildFocusEvent(wxWindow *win)
+                 : wxCommandEvent(wxEVT_CHILD_FOCUS)
+{
+    SetEventObject(win);
+}
+
+#endif // wxUSE_GUI
+
+// ----------------------------------------------------------------------------
+// wxEvtHandler
+// ----------------------------------------------------------------------------
+
 /*
  * Event handler
  */
 /*
  * Event handler
  */
@@ -890,9 +900,32 @@ void wxEvtHandler::ProcessPendingEvents()
 bool wxEvtHandler::ProcessEvent(wxEvent& event)
 {
 #if wxUSE_GUI
 bool wxEvtHandler::ProcessEvent(wxEvent& event)
 {
 #if wxUSE_GUI
+
+    // We have to use the actual window or processing events from wxWindowNative
+    // destructor won't work (we don't see the wxWindow class)
+#ifdef __WXDEBUG__
     // check that our flag corresponds to reality
     // check that our flag corresponds to reality
-    wxASSERT_MSG( m_isWindow == IsKindOf(CLASSINFO(wxWindow)),
+    wxClassInfo* info = NULL;
+#ifdef __WXUNIVERSAL__
+#  if defined(__WXMSW__)
+    info = CLASSINFO(wxWindowMSW);
+#  elif defined(__WXGTK__)
+    info = CLASSINFO(wxWindowGTK);
+#  elif defined(__WXMGL__)
+    info = CLASSINFO(wxWindowMGL);
+#  elif defined(__WXMAC__)
+    info = CLASSINFO(wxWindowMac);
+#  elif defined(__WXMOTIF__)
+    info = CLASSINFO(wxWindowMotif);
+#  endif
+#else
+    info = CLASSINFO(wxWindow);
+#endif
+
+    wxASSERT_MSG( m_isWindow == IsKindOf(info),
                   _T("this should [not] be a window but it is [not]") );
                   _T("this should [not] be a window but it is [not]") );
+#endif
+
 #endif // wxUSE_GUI
 
     // An event handler can be enabled or disabled
 #endif // wxUSE_GUI
 
     // An event handler can be enabled or disabled