]> git.saurik.com Git - wxWidgets.git/commitdiff
XMLCTRL() macro now uses wxDynamicCast in debug builds
authorVáclav Slavík <vslavik@fastmail.fm>
Tue, 22 May 2001 22:02:53 +0000 (22:02 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Tue, 22 May 2001 22:02:53 +0000 (22:02 +0000)
(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

index b9cb6aaec687745fbc4438d56657ab4515ddeb66..9615242e8d10c8698f59ede1bee45f09dacc4b21 100644 (file)
@@ -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