The DocTemplate class is used to model the relationship between a
document class and a view class.
DocTemplate overview, Document, View
Stringm_defaultExt
The default extension for files of this type.
Stringm_description
A short description of this template.
Stringm_directory
The default directory for files of this type.
ClassInfo* m_docClassInfo
Run-time class information that allows document instances to be constructed dynamically.
Stringm_docTypeName
The named type of the document associated with this template.
DocTemplate*m_documentManager
A pointer to the document manager for which this template was created.
Stringm_fileFilter
The file filter (such as *.txt
) to be used in file selector dialogs.
longm_flags
The flags passed to the constructor.
ClassInfo*m_viewClassInfo
Run-time class information that allows view instances to be constructed dynamically.
Stringm_viewTypeName
The named type of the view associated with this template.
Constructor. Create instances dynamically near the start of your application after creating
a DocManager instance, and before doing any document or view operations.
manager is the document manager object which manages this template.
descr is a short description of what the template is for. This string will be displayed in the
file filter list of Windows file selectors.
filter is an appropriate file filter such as *.txt
.
dir is the default directory to use for file selectors.
ext is the default file extension (such as txt).
docTypeName is a name that should be unique for a given type of document, used for
gathering a list of views relevant to a particular document.
viewTypeName is a name that should be unique for a given view.
docClassInfo is a pointer to the run-time document class information as returned
by the CLASSINFO macro, e.g. CLASSINFO. If this is not supplied,
you will need to derive a new DocTemplate class and override the CreateDocument
member to return a new document instance on demand.
viewClassInfo is a pointer to the run-time view class information as returned
by the CLASSINFO macro, e.g. CLASSINFO. If this is not supplied,
you will need to derive a new DocTemplate class and override the CreateView
member to return a new view instance on demand.
flags is a bit list of the following:
):
2cm
|Wx::DocTemplate→new( docmgr, descr, filter, dir,ext, docTypeName, viewTypeName, docClassInfo, viewClassInfo, flags)| will construct document and view objects from the class information|
|Wx::DocTemplate→new( docmgr, descr, filter, dir,ext, docTypeName, viewTypeName, docClassName, viewClassName, flags)| will construct document and view objects from perl packages|
|Wx::DocTemplate→new( docmgr, descr, filter, dir,ext, docTypeName, viewTypeName )|Wx::DocTemplate::CreateDocument()
and@Wx::DocTemplate::CreateView()@ must be overridden|
Destructor.
Creates a new instance of the associated document class. If you have not supplied
a ClassInfo parameter to the template constructor, you will need to override this
function to return an appropriate document instance.
This function calls DocTemplate::InitDocument which in turns
calls Document::OnCreate.
Creates a new instance of the associated view class. If you have not supplied
a ClassInfo parameter to the template constructor, you will need to override this
function to return an appropriate view instance.
Returns the default file extension for the document data, as passed to the document template constructor.
Returns the text description of this template, as passed to the document template constructor.
Returns the default directory, as passed to the document template constructor.
Returns a pointer to the document manager instance for which this template was created.
Returns the document type name, as passed to the document template constructor.
Returns the file filter, as passed to the document template constructor.
Returns the flags, as passed to the document template constructor.
Returns the view type name, as passed to the document template constructor.
Initialises the document, calling Document::OnCreate. This is called from
DocTemplate::CreateDocument.
Returns true if the document template can be shown in user dialogs, false otherwise.
Sets the default file extension.
Sets the template description.
Sets the default directory.
Sets the pointer to the document manager instance for which this template was created.
Should not be called by the application.
Sets the file filter.
Sets the internal document template flags (see the constructor description for more details).
[This page automatically generated from the Textile source at 2023-06-03 08:07:33 +0000]