Detect attempts to catch wxEVT_TEXT_ENTER without wxTE_PROCESS_ENTER
This is never going to work, so complain about trying to do it to help with catching this bug. This is possible thanks to the new OnDynamicBind() method invoked whenever a dynamic event handler is bound to a control, so this doesn't detect all possible occurrences of the bug (such as specifying the handler in a static event table or in a validator), but it's still better than nothing. In the future OnDynamicBind() should be extended for other invalid calls, e.g. binding a handler for wxEVT_TEXT_ENTER to a non-text control shouldn't work neither, ideally.
This commit is contained in:
@@ -3671,6 +3671,15 @@ protected:
|
||||
virtual bool TryParent(wxEvent& event), return DoTryApp(event); )
|
||||
#endif // WXWIN_COMPATIBILITY_2_8
|
||||
|
||||
// Overriding this method allows filtering the event handlers dynamically
|
||||
// connected to this object. If this method returns false, the handler is
|
||||
// not connected at all. If it returns true, it is connected using the
|
||||
// possibly modified fields of the given entry.
|
||||
virtual bool OnDynamicBind(wxDynamicEventTableEntry& WXUNUSED(entry))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
static const wxEventTable sm_eventTable;
|
||||
virtual const wxEventTable *GetEventTable() const;
|
||||
|
Reference in New Issue
Block a user