From 9c9fc51ba750e043fe816d85bf82f15f2468e573 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Tue, 22 May 2001 22:02:53 +0000 Subject: [PATCH] XMLCTRL() macro now uses wxDynamicCast in debug builds (should help in catching typo bugs when accessing XRC controls) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10280 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/xml/xmlres.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/include/wx/xml/xmlres.h b/contrib/include/wx/xml/xmlres.h index b9cb6aaec6..9615242e8d 100644 --- a/contrib/include/wx/xml/xmlres.h +++ b/contrib/include/wx/xml/xmlres.h @@ -216,9 +216,13 @@ extern wxXmlResource *wxTheXmlResource; // wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog"); // XMLCTRL(dlg, "my_textctrl", wxTextCtrl)->SetValue(wxT("default value")); +#ifdef __WXDEBUG__ +#define XMLCTRL(window, id, type) \ + (wxDynamicCast((window).FindWindow(XMLID(id)), type)) +#else #define XMLCTRL(window, id, type) \ ((type*)((window).FindWindow(XMLID(id)))) - +#endif class WXDLLEXPORT wxXmlResourceHandler : public wxObject -- 2.47.2