X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4f7cd56c1489c3205ceb352f8a94152ba53e673d..a5655d37db9baabce654849fd66173f95f74e230:/samples/mdi/mdi.cpp diff --git a/samples/mdi/mdi.cpp b/samples/mdi/mdi.cpp index 1866983260..e64facd67b 100644 --- a/samples/mdi/mdi.cpp +++ b/samples/mdi/mdi.cpp @@ -7,7 +7,7 @@ // RCS-ID: $Id$ // Copyright: (c) 1997 Julian Smart // (c) 2008 Vadim Zeitlin -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // =========================================================================== @@ -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--; }