From: Václav Slavík Date: Sun, 25 Aug 2002 12:14:37 +0000 (+0000) Subject: added wxFrame* wxXmlResource::LoadFrame(parent,name) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4dd75a6aafab921defcd0b5cad9222280ef03db8?ds=sidebyside;hp=ba201fa43114e4f683a22d814fa215b39c1eaa3a added wxFrame* wxXmlResource::LoadFrame(parent,name) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/contrib/src/xrc/xmlres.cpp b/contrib/src/xrc/xmlres.cpp index 21375aff60..0a1b72cd3a 100644 --- a/contrib/src/xrc/xmlres.cpp +++ b/contrib/src/xrc/xmlres.cpp @@ -171,10 +171,7 @@ wxToolBar *wxXmlResource::LoadToolBar(wxWindow *parent, const wxString& name) wxDialog *wxXmlResource::LoadDialog(wxWindow *parent, const wxString& name) { - wxDialog *dialog = new wxDialog; - if (!LoadDialog(dialog, parent, name)) - { delete dialog; return NULL; } - else return dialog; + return (wxDialog*)CreateResFromNode(FindResource(name, wxT("wxDialog")), parent, NULL); } bool wxXmlResource::LoadDialog(wxDialog *dlg, wxWindow *parent, const wxString& name) diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index 21375aff60..0a1b72cd3a 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -171,10 +171,7 @@ wxToolBar *wxXmlResource::LoadToolBar(wxWindow *parent, const wxString& name) wxDialog *wxXmlResource::LoadDialog(wxWindow *parent, const wxString& name) { - wxDialog *dialog = new wxDialog; - if (!LoadDialog(dialog, parent, name)) - { delete dialog; return NULL; } - else return dialog; + return (wxDialog*)CreateResFromNode(FindResource(name, wxT("wxDialog")), parent, NULL); } bool wxXmlResource::LoadDialog(wxDialog *dlg, wxWindow *parent, const wxString& name)