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:
@@ -99,6 +99,10 @@ BEGIN_EVENT_TABLE(MyCanvas, wxScrolledWindow)
|
||||
EVT_MOUSE_EVENTS(MyCanvas::OnEvent)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
BEGIN_EVENT_TABLE(MyChild::EventHandler, wxEvtHandler)
|
||||
EVT_MENU(MDI_REFRESH, MyChild::EventHandler::OnRefresh)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// ===========================================================================
|
||||
// implementation
|
||||
// ===========================================================================
|
||||
@@ -451,10 +455,16 @@ MyChild::MyChild(wxMDIParentFrame *parent)
|
||||
// they can be resized at all
|
||||
if ( canBeResized )
|
||||
SetSizeHints(100, 100);
|
||||
|
||||
// test that event handlers pushed on top of MDI children do work (this
|
||||
// used to be broken, see #11225)
|
||||
PushEventHandler(new EventHandler(ms_numChildren));
|
||||
}
|
||||
|
||||
MyChild::~MyChild()
|
||||
{
|
||||
PopEventHandler(true);
|
||||
|
||||
ms_numChildren--;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user