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
This commit is contained in:
Václav Slavík
2001-05-22 22:02:53 +00:00
parent 3b1ca90e5a
commit 9c9fc51ba7

View 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