have TryValidator even if wxUSE_VALIDATORS=1, so that wxBase library can be used by GUI ports

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22953 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2003-08-17 10:33:25 +00:00
parent b880adecc4
commit 6eabf58cec
4 changed files with 13 additions and 15 deletions

View File

@@ -2324,11 +2324,15 @@ protected:
// hooks for wxWindow used by ProcessEvent() // hooks for wxWindow used by ProcessEvent()
// ----------------------------------------- // -----------------------------------------
// this one is called before trying our own event table to allow plugging // This one is called before trying our own event table to allow plugging
// in the validators // in the validators.
#if wxUSE_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; } 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 // 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 // table to give a chance to the other windows to process it

View File

@@ -914,9 +914,7 @@ public:
protected: protected:
// event handling specific to wxWindow // event handling specific to wxWindow
#if wxUSE_VALIDATORS
virtual bool TryValidator(wxEvent& event); virtual bool TryValidator(wxEvent& event);
#endif // wxUSE_VALIDATORS
virtual bool TryParent(wxEvent& event); virtual bool TryParent(wxEvent& event);

View File

@@ -1107,10 +1107,8 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event)
{ {
// if we have a validator, it has higher priority than our own event // if we have a validator, it has higher priority than our own event
// table // table
#if wxUSE_VALIDATORS
if ( TryValidator(event) ) if ( TryValidator(event) )
return TRUE; return TRUE;
#endif // wxUSE_VALIDATORS
// Handle per-instance dynamic event tables first // Handle per-instance dynamic event tables first
if ( m_dynamicEvents && SearchDynamicEventTable(event) ) if ( m_dynamicEvents && SearchDynamicEventTable(event) )

View File

@@ -2152,10 +2152,9 @@ void wxWindowBase::SendDestroyEvent()
// event processing // event processing
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#if wxUSE_VALIDATORS
bool wxWindowBase::TryValidator(wxEvent& event) bool wxWindowBase::TryValidator(wxEvent& event)
{ {
#if wxUSE_VALIDATORS
// Can only use the validator of the window which // Can only use the validator of the window which
// is receiving the event // is receiving the event
if ( event.GetEventObject() == this ) if ( event.GetEventObject() == this )
@@ -2163,15 +2162,14 @@ bool wxWindowBase::TryValidator(wxEvent& event)
wxValidator *validator = GetValidator(); wxValidator *validator = GetValidator();
if ( validator && validator->ProcessEvent(event) ) if ( validator && validator->ProcessEvent(event) )
{ {
return TRUE; return true;
} }
} }
return FALSE;
}
#endif // wxUSE_VALIDATORS #endif // wxUSE_VALIDATORS
return false;
}
bool wxWindowBase::TryParent(wxEvent& event) bool wxWindowBase::TryParent(wxEvent& event)
{ {
// carry on up the parent-child hierarchy if the propgation count hasn't // carry on up the parent-child hierarchy if the propgation count hasn't