Add wxDocManager::FindTemplate() method.
This allows to find the template corresponding to the document of the given class. Closes #12170. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65915 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1894,6 +1894,20 @@ void wxDocManager::DisassociateTemplate(wxDocTemplate *temp)
|
||||
m_templates.DeleteObject(temp);
|
||||
}
|
||||
|
||||
wxDocTemplate* wxDocManager::FindTemplate(const wxClassInfo* classinfo)
|
||||
{
|
||||
for ( wxList::compatibility_iterator node = m_templates.GetFirst();
|
||||
node;
|
||||
node = node->GetNext() )
|
||||
{
|
||||
wxDocTemplate* t = wxStaticCast(node->GetData(), wxDocTemplate);
|
||||
if ( t->GetDocClassInfo() == classinfo )
|
||||
return t;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Add and remove a document from the manager's list
|
||||
void wxDocManager::AddDocument(wxDocument *doc)
|
||||
{
|
||||
|
Reference in New Issue
Block a user