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:
@@ -512,9 +512,9 @@ public:
|
||||
the chain until the event is processed or the chain is exhausted.
|
||||
|
||||
This function is called from ProcessEvent() and, in turn, calls
|
||||
ProcessEventHere() for each handler in turn. It is not virtual and so
|
||||
cannot be overridden but can, and should, be called to forward an event
|
||||
to another handler instead of ProcessEvent() which would result in a
|
||||
TryThis() for each handler in turn. It is not virtual and so cannot be
|
||||
overridden but can, and should, be called to forward an event to
|
||||
another handler instead of ProcessEvent() which would result in a
|
||||
duplicate call to TryAfter(), e.g. resulting in all unprocessed events
|
||||
being sent to the application object multiple times.
|
||||
|
||||
@@ -528,25 +528,6 @@ public:
|
||||
*/
|
||||
bool ProcessEventLocally(wxEvent& event);
|
||||
|
||||
/**
|
||||
Try to process the event in this event handler.
|
||||
|
||||
This method is called from ProcessEventLocally() and thus,
|
||||
indirectly, from ProcessEvent(), please see the detailed description of
|
||||
the event processing logic there.
|
||||
|
||||
It is @em not virtual and so may not be overridden.
|
||||
|
||||
@since 2.9.1
|
||||
|
||||
@param event
|
||||
Event to process.
|
||||
@return
|
||||
@true if this object itself defines a handler for this event and
|
||||
the handler didn't skip the event.
|
||||
*/
|
||||
bool ProcessEventHere(wxEvent& event);
|
||||
|
||||
/**
|
||||
Processes an event by calling ProcessEvent() and handles any exceptions
|
||||
that occur in the process.
|
||||
@@ -1111,10 +1092,29 @@ protected:
|
||||
};
|
||||
@endcode
|
||||
|
||||
@see ProcessEvent(), ProcessEventHere()
|
||||
@see ProcessEvent()
|
||||
*/
|
||||
virtual bool TryBefore(wxEvent& event);
|
||||
|
||||
/**
|
||||
Try to process the event in this event handler.
|
||||
|
||||
This method is called from ProcessEventLocally() and thus, indirectly,
|
||||
from ProcessEvent(), please see the detailed description of the event
|
||||
processing logic there.
|
||||
|
||||
It is currently @em not virtual and so may not be overridden.
|
||||
|
||||
@since 2.9.1
|
||||
|
||||
@param event
|
||||
Event to process.
|
||||
@return
|
||||
@true if this object itself defines a handler for this event and
|
||||
the handler didn't skip the event.
|
||||
*/
|
||||
bool TryThis(wxEvent& event);
|
||||
|
||||
/**
|
||||
Method called by ProcessEvent() as last resort.
|
||||
|
||||
@@ -1140,7 +1140,7 @@ protected:
|
||||
};
|
||||
@endcode
|
||||
|
||||
@see ProcessEvent(), ProcessEventHere()
|
||||
@see ProcessEvent()
|
||||
*/
|
||||
virtual bool TryAfter(wxEvent& event);
|
||||
};
|
||||
|
@@ -1846,8 +1846,8 @@ public:
|
||||
This method is similar to ProcessWindowEvent() but can be used to
|
||||
search for the event handler only in this window and any event handlers
|
||||
pushed on top of it. Unlike ProcessWindowEvent() it won't propagate the
|
||||
event upwards. But unlike wxEvtHandler::ProcessEventHere() it will use
|
||||
the event handlers associated with this window.
|
||||
event upwards. But it will use the validator and event handlers
|
||||
associated with this window, if any.
|
||||
|
||||
@since 2.9.1
|
||||
*/
|
||||
|
Reference in New Issue
Block a user