From 45a248176c4e7da12f43753d61c5da5b20c950a1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 27 Jul 2000 18:51:28 +0000 Subject: [PATCH] added XMLCTRL() macro for fast access to dialog controls git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7880 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/xml/xmlres.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/contrib/include/wx/xml/xmlres.h b/contrib/include/wx/xml/xmlres.h index 89b5119d54..3d5a0e7164 100644 --- a/contrib/include/wx/xml/xmlres.h +++ b/contrib/include/wx/xml/xmlres.h @@ -149,7 +149,23 @@ extern wxXmlResource *wxTheXmlResource; // EVT_MENU(XMLID("new"), MyFrame::OnNew) // EVT_MENU(XMLID("open"), MyFrame::OnOpen) // END_EVENT_TABLE() -#define XMLID(str_id) wxXmlResource::GetXMLID(str_id) + +#define XMLID(str_id) \ + wxXmlResource::GetXMLID(_T(str_id)) + + + +// This macro returns pointer to particular control in dialog +// created using XML resources. You can use it to set/get values from +// controls. +// Example: +// wxDialog dlg; +// wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog"); +// XMLCTRL(dlg, "my_textctrl", wxTextCtrl)->SetValue(_T("default value")); + +#define XMLCTRL(window, id, type) \ + ((type*)((window).FindWindow(XMLID(id)))) + class WXDLLEXPORT wxXmlResourceHandler : public wxObject -- 2.50.0