Add wxWindow::ProcessWindowEventLocally() and use it in wxMSW MDI code.

Add ProcessWindowEventLocally() which wraps ProcessEventLocally() in the same
way as ProcessWindowEvent() wraps ProcessEvent(). I.e. it allows to process
the event in this window only, without propagating it upwards, but taking into
account any event handlers associated with it.

Use the new method in wxMDIParentFrame code in wxMSW to ensure that event
handlers pushed on MDI children frames are taken into account. Add a test for
this to the MDI sample.

Closes #11225.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64262 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-05-09 14:55:33 +00:00
parent 3cbb9df817
commit 396e9eb8e2
5 changed files with 52 additions and 1 deletions

View File

@@ -803,6 +803,13 @@ public:
bool ProcessWindowEvent(wxEvent& event)
{ return GetEventHandler()->ProcessEvent(event); }
// Call GetEventHandler()->ProcessEventLocally(): this should be used
// instead of calling ProcessEventLocally() directly on the window
// itself as this wouldn't take any pushed event handlers into account
// correctly
bool ProcessWindowEventLocally(wxEvent& event)
{ return GetEventHandler()->ProcessEventLocally(event); }
// Process an event by calling GetEventHandler()->ProcessEvent() and
// handling any exceptions thrown by event handlers. It's mostly useful
// when processing wx events when called from C code (e.g. in GTK+
@@ -830,6 +837,7 @@ protected:
// The same holds for all other wxEvtHandler functions.
using wxEvtHandler::ProcessEvent;
using wxEvtHandler::ProcessEventLocally;
#if wxUSE_THREADS
using wxEvtHandler::ProcessThreadEvent;
#endif