]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/event.cpp
use SetClientSize(), not SetSize() in Fit()
[wxWidgets.git] / src / common / event.cpp
index 083e52a70960d512a741bc774294c6b22331f843..e734fb9e83c7f1b9d86c0295adabdf830fb2969c 100644 (file)
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) && !defined(__EMX__)
+// Some older compilers (such as EMX) cannot handle
+// #pragma interface/implementation correctly, iff 
+// #pragma implementation is used in _two_ translation
+// units (as created by e.g. event.cpp compiled for
+// libwx_base and event.cpp compiled for libwx_gui_core).
+// So we must not use those pragmas for those compilers in
+// such files.
     #pragma implementation "event.h"
 #endif
 
@@ -304,16 +311,6 @@ int wxNewEventType()
     // MT-FIXME
     static int s_lastUsedEventType = wxEVT_FIRST;
 
-#if WXWIN_COMPATIBILITY_2
-    // check that we don't overlap with the user-defined types: if it does
-    // happen, the best solution is probably to update the existing code to
-    // use wxNewEventType() instead of wxEVT_USER_FIRST
-    //
-    // due to the uncertainty
-    wxASSERT_MSG( s_lastUsedEventType < wxEVT_USER_FIRST - 1,
-                  _T("possible event type conflict") );
-#endif // WXWIN_COMPATIBILITY_2
-
     return s_lastUsedEventType++;
 }
 
@@ -339,6 +336,7 @@ wxEvent::wxEvent(int theId, wxEventType commandType )
     m_skipped = FALSE;
     m_callbackUserData = (wxObject *) NULL;
     m_isCommandEvent = FALSE;
+    m_propagationLevel = wxEVENT_PROPAGATE_NONE;
 }
 
 wxEvent::wxEvent(const wxEvent &src)
@@ -348,6 +346,7 @@ wxEvent::wxEvent(const wxEvent &src)
     , m_timeStamp(src.m_timeStamp)
     , m_id(src.m_id)
     , m_callbackUserData(src.m_callbackUserData)
+    , m_propagationLevel(src.m_propagationLevel)
     , m_skipped(src.m_skipped)
     , m_isCommandEvent(src.m_isCommandEvent)
 {
@@ -370,6 +369,9 @@ wxCommandEvent::wxCommandEvent(wxEventType commandType, int theId)
     m_extraLong = 0;
     m_commandInt = 0;
     m_isCommandEvent = TRUE;
+
+    // the command events are propagated upwards by default
+    m_propagationLevel = wxEVENT_PROPAGATE_MAX;
 }
 
 /*
@@ -385,7 +387,7 @@ long wxUpdateUIEvent::sm_updateInterval = 0;
 wxUpdateUIMode wxUpdateUIEvent::sm_updateMode = wxUPDATE_UI_PROCESS_ALL;
 
 // Can we update?
-bool wxUpdateUIEvent::CanUpdate(wxWindowwin)
+bool wxUpdateUIEvent::CanUpdate(wxWindowBase *win)
 {
     // Don't update if we've switched global updating off
     // and this window doesn't support updates.
@@ -708,6 +710,9 @@ wxChildFocusEvent::wxChildFocusEvent(wxWindow *win)
 
 #endif // wxUSE_GUI
 
+
+#if wxUSE_BASE
+
 // ----------------------------------------------------------------------------
 // wxEventHashTable
 // ----------------------------------------------------------------------------
@@ -888,8 +893,6 @@ void wxEventHashTable::GrowEventTypeTable()
 // wxEvtHandler
 // ----------------------------------------------------------------------------
 
-#if wxUSE_BASE
-
 /*
  * Event handler
  */
@@ -1101,10 +1104,8 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event)
     {
         // if we have a validator, it has higher priority than our own event
         // table
-#if wxUSE_VALIDATORS
         if ( TryValidator(event) )
             return TRUE;
-#endif // wxUSE_VALIDATORS
 
         // Handle per-instance dynamic event tables first
         if ( m_dynamicEvents && SearchDynamicEventTable(event) )
@@ -1317,17 +1318,6 @@ void *wxEvtHandler::DoGetClientData() const
     return m_clientData;
 }
 
-
-#if WXWIN_COMPATIBILITY
-bool wxEvtHandler::OnClose()
-{
-    if (GetNextHandler())
-        return GetNextHandler()->OnClose();
-    else
-        return FALSE;
-}
-#endif // WXWIN_COMPATIBILITY
-
 #endif // wxUSE_BASE
 
 #if wxUSE_GUI