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:
@@ -115,6 +115,10 @@ public:
|
||||
// Destructor.
|
||||
~wxXmlResource();
|
||||
|
||||
// Gives access to the first root node for
|
||||
// direct manipulation or querying
|
||||
wxXmlNode *GetFirstRoot();
|
||||
|
||||
// Loads resources from XML files that match given filemask.
|
||||
// This method understands VFS (see filesys.h).
|
||||
bool Load(const wxString& filemask);
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -115,6 +115,10 @@ public:
|
||||
// Destructor.
|
||||
~wxXmlResource();
|
||||
|
||||
// Gives access to the first root node for
|
||||
// direct manipulation or querying
|
||||
wxXmlNode *GetFirstRoot();
|
||||
|
||||
// Loads resources from XML files that match given filemask.
|
||||
// This method understands VFS (see filesys.h).
|
||||
bool Load(const wxString& filemask);
|
||||
|
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user