]> git.saurik.com Git - wxWidgets.git/commitdiff
have TryValidator even if wxUSE_VALIDATORS=1, so that wxBase library can be used...
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 17 Aug 2003 10:33:25 +0000 (10:33 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 17 Aug 2003 10:33:25 +0000 (10:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22953 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/event.h
include/wx/window.h
src/common/event.cpp
src/common/wincmn.cpp

index 040020fee7838a31fbfd98c8b0790a8b8a8c2c5c..33523b8875d110e14c7d70492f4e4309fdf614a0 100644 (file)
@@ -2324,11 +2324,15 @@ protected:
     // hooks for wxWindow used by ProcessEvent()
     // -----------------------------------------
 
-    // this one is called before trying our own event table to allow plugging
-    // in the validators
-#if wxUSE_VALIDATORS
+    // This one is called before trying our own event table to allow plugging
+    // in the validators.
+    // 
+    // NB: This method is intentionally *not* inside wxUSE_VALIDATORS!
+    //     It is part of wxBase which doesn't use validators and the code
+    //     is compiled out when building wxBase w/o GUI classes, which affects
+    //     binary compatiblity and wxBase library can't be used by GUI
+    //     ports.
     virtual bool TryValidator(wxEvent& WXUNUSED(event)) { return false; }
-#endif // wxUSE_VALIDATORS
 
     // this one is called after failing to find the event handle in our own
     // table to give a chance to the other windows to process it
index c506460376086556647e90e782033fd5cd3d1478..9b774ff0c61bb47f5c53ed3ca1c9b7a910ff0a3a 100644 (file)
@@ -914,9 +914,7 @@ public:
 
 protected:
     // event handling specific to wxWindow
-#if wxUSE_VALIDATORS
     virtual bool TryValidator(wxEvent& event);
-#endif // wxUSE_VALIDATORS
     virtual bool TryParent(wxEvent& event);
 
 
index 29c1c3a6901cc33ef241b2c02113bddc02d10cd1..618e5eb61fc6dad564ab6f70aff16ae29a1a613e 100644 (file)
@@ -1107,10 +1107,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) )
index 9a1a983162f8922f7580fe9508b4ddd674c3aa88..d553b83ec3e918d8e1419b8c9a6a18e4790d5c5f 100644 (file)
@@ -2152,10 +2152,9 @@ void wxWindowBase::SendDestroyEvent()
 // event processing
 // ----------------------------------------------------------------------------
 
-#if wxUSE_VALIDATORS
-
 bool wxWindowBase::TryValidator(wxEvent& event)
 {
+#if wxUSE_VALIDATORS
     // Can only use the validator of the window which
     // is receiving the event
     if ( event.GetEventObject() == this )
@@ -2163,15 +2162,14 @@ bool wxWindowBase::TryValidator(wxEvent& event)
         wxValidator *validator = GetValidator();
         if ( validator && validator->ProcessEvent(event) )
         {
-            return TRUE;
+            return true;
         }
     }
+#endif // wxUSE_VALIDATORS
 
-    return FALSE;
+    return false;
 }
 
-#endif // wxUSE_VALIDATORS
-
 bool wxWindowBase::TryParent(wxEvent& event)
 {
     // carry on up the parent-child hierarchy if the propgation count hasn't