Enable direct access to XML data in XRC.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17514 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2002-10-13 16:19:15 +00:00
parent fbf9b66e03
commit daa820fd8b
4 changed files with 28 additions and 0 deletions

View File

@@ -115,6 +115,10 @@ public:
// Destructor. // Destructor.
~wxXmlResource(); ~wxXmlResource();
// Gives access to the first root node for
// direct manipulation or querying
wxXmlNode *GetFirstRoot();
// Loads resources from XML files that match given filemask. // Loads resources from XML files that match given filemask.
// This method understands VFS (see filesys.h). // This method understands VFS (see filesys.h).
bool Load(const wxString& filemask); bool Load(const wxString& filemask);

View File

@@ -146,6 +146,16 @@ void wxXmlResource::ClearHandlers()
} }
wxXmlNode *wxXmlResource::GetFirstRoot()
{
UpdateResources(); //ensure everything is up-to-date
if (m_data.GetCount() == 0) return NULL;
if (m_data[0].Doc == NULL) return NULL;
return m_data[0].Doc->GetRoot();
}
wxMenu *wxXmlResource::LoadMenu(const wxString& name) wxMenu *wxXmlResource::LoadMenu(const wxString& name)
{ {

View File

@@ -115,6 +115,10 @@ public:
// Destructor. // Destructor.
~wxXmlResource(); ~wxXmlResource();
// Gives access to the first root node for
// direct manipulation or querying
wxXmlNode *GetFirstRoot();
// Loads resources from XML files that match given filemask. // Loads resources from XML files that match given filemask.
// This method understands VFS (see filesys.h). // This method understands VFS (see filesys.h).
bool Load(const wxString& filemask); bool Load(const wxString& filemask);

View File

@@ -146,6 +146,16 @@ void wxXmlResource::ClearHandlers()
} }
wxXmlNode *wxXmlResource::GetFirstRoot()
{
UpdateResources(); //ensure everything is up-to-date
if (m_data.GetCount() == 0) return NULL;
if (m_data[0].Doc == NULL) return NULL;
return m_data[0].Doc->GetRoot();
}
wxMenu *wxXmlResource::LoadMenu(const wxString& name) wxMenu *wxXmlResource::LoadMenu(const wxString& name)
{ {