From: Václav Slavík Date: Tue, 22 May 2001 22:02:53 +0000 (+0000) Subject: XMLCTRL() macro now uses wxDynamicCast in debug builds X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9c9fc51ba750e043fe816d85bf82f15f2468e573 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 --- 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