// 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
protected:
// event handling specific to wxWindow
-#if wxUSE_VALIDATORS
virtual bool TryValidator(wxEvent& event);
-#endif // wxUSE_VALIDATORS
virtual bool TryParent(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) )
// 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 )
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