]>
git.saurik.com Git - wxWidgets.git/blob - contrib/src/xml/xh_unkwn.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: XML resource for unknown widget
4 // Author: Vaclav Slavik
7 // Copyright: (c) 2000 Vaclav Slavik
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "xh_unkwn.h"
15 // For compilers that support precompilation, includes "wx.h".
16 #include "wx/wxprec.h"
22 #include "wx/xml/xh_unkwn.h"
23 #include "wx/window.h"
27 wxUnknownWidgetXmlHandler::wxUnknownWidgetXmlHandler()
28 : wxXmlResourceHandler()
33 wxObject
*wxUnknownWidgetXmlHandler::DoCreateResource()
35 long id
= GetLong(wxT("id"), -1);
36 wxString name
= GetParamValue(wxT("name"));
41 wnd
= m_ParentAsWindow
->FindWindow(id
);
42 if (wnd
== NULL
&& !name
.IsEmpty())
43 wnd
= m_ParentAsWindow
->FindWindow(name
);
46 wxLogError(wxT("Cannot find specified window for class 'unknown' (id=%li, name='%s')."), id
, name
.mb_str());
49 if (wnd
->GetParent() != m_ParentAsWindow
)
50 wnd
->Reparent(m_ParentAsWindow
);
57 bool wxUnknownWidgetXmlHandler::CanHandle(wxXmlNode
*node
)
59 return IsOfClass(node
, wxT("unknown"));