Replace public wxEvtHandler::ProcessEventHere() with private TryHere().

ProcessEventHere() doesn't have to be public any more now that we have
ProcessEventLocally() which is safe to call from the outside (i.e. doesn't
forget about the chained event handlers and validators).

Still keep this function because it makes the code more modular and also
because we might want to make it virtual for consistency with TryBefore() and
TryAfter() later. Also rename it to TryHere() to make the symmetry with these
functions more manifest.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64264 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-05-09 14:55:46 +00:00
parent 44070fd379
commit 512220b67b
5 changed files with 43 additions and 44 deletions

View File

@@ -1026,8 +1026,8 @@ protected:
bool m_wasProcessed;
// this flag is used by ProcessEventLocally() to prevent ProcessEvent()
// from doing its usual stuff and force it to just call ProcessEventHere()
// instead, see the comment there explaining why is this needed
// from doing its usual stuff and force it to just call TryHere() instead,
// see the comment there explaining why is this needed
bool m_processHereOnly;
protected:
@@ -3232,13 +3232,6 @@ public:
void OnSinkDestroyed( wxEvtHandler *sink );
// The method tries to process the event in this event handler.
//
// It is called from ProcessEventLocally() and normally shouldn't be called
// directly as doing it would ignore any chained event handlers.
bool ProcessEventHere(wxEvent& event);
private:
void DoBind(int winid,
int lastId,
@@ -3263,6 +3256,12 @@ protected:
// validators.
virtual bool TryBefore(wxEvent& event);
// this one is not a hook but just a helper which looks up the handler in
// this object itself called from ProcessEventLocally() and normally
// shouldn't be called directly as doing it would ignore any chained event
// handlers
bool TryHere(wxEvent& event);
// 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
//