1998-05-20 10:25:30 -04:00
|
|
|
\section{\class{wxDocTemplate}}\label{wxdoctemplate}
|
|
|
|
|
|
|
|
The wxDocTemplate class is used to model the relationship between a
|
|
|
|
document class and a view class.
|
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
\helpref{wxObject}{wxobject}
|
|
|
|
|
1999-02-15 15:41:29 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/docview.h>
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxDocTemplate overview}{wxdoctemplateoverview}, \helpref{wxDocument}{wxdocument}, \helpref{wxView}{wxview}
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::m\_defaultExt}\label{wxdoctemplatemdefaultext}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\member{wxString}{m\_defaultExt}
|
|
|
|
|
|
|
|
The default extension for files of this type.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::m\_description}\label{wxdoctemplatemdescription}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\member{wxString}{m\_description}
|
|
|
|
|
|
|
|
A short description of this template.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::m\_directory}\label{wxdoctemplatemdirectory}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\member{wxString}{m\_directory}
|
|
|
|
|
|
|
|
The default directory for files of this type.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::m\_docClassInfo}\label{wxdoctemplatemdocclassinfo}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\member{wxClassInfo* }{m\_docClassInfo}
|
|
|
|
|
|
|
|
Run-time class information that allows document instances to be constructed dynamically.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::m\_docTypeName}\label{wxdoctemplatemdoctypename}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\member{wxString}{m\_docTypeName}
|
|
|
|
|
|
|
|
The named type of the document associated with this template.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::m\_documentManager}\label{wxdoctemplatedocumentmanager}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\member{wxDocTemplate*}{m\_documentManager}
|
|
|
|
|
|
|
|
A pointer to the document manager for which this template was created.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::m\_fileFilter}\label{wxdoctemplatemfilefilter}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\member{wxString}{m\_fileFilter}
|
|
|
|
|
2002-05-05 10:24:07 -04:00
|
|
|
The file filter (such as {\tt *.txt}) to be used in file selector dialogs.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::m\_flags}\label{wxdoctemplatemflags}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\member{long}{m\_flags}
|
|
|
|
|
|
|
|
The flags passed to the constructor.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::m\_viewClassInfo}\label{wxdoctemplatemviewclassinfo}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\member{wxClassInfo*}{m\_viewClassInfo}
|
|
|
|
|
|
|
|
Run-time class information that allows view instances to be constructed dynamically.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::m\_viewTypeName}\label{wxdoctemplatemviewtypename}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\member{wxString}{m\_viewTypeName}
|
|
|
|
|
|
|
|
The named type of the view associated with this template.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::wxDocTemplate}\label{wxdoctemplatector}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{}{wxDocTemplate}{\param{wxDocManager* }{manager}, \param{const wxString\& }{descr}, \param{const wxString\& }{filter},
|
|
|
|
\param{const wxString\& }{dir}, \param{const wxString\& }{ext}, \param{const wxString\& }{docTypeName},
|
|
|
|
\param{const wxString\& }{viewTypeName}, \param{wxClassInfo* }{docClassInfo = NULL},
|
|
|
|
\param{wxClassInfo* }{viewClassInfo = NULL}, \param{long}{ flags = wxDEFAULT\_TEMPLATE\_FLAGS}}
|
|
|
|
|
|
|
|
Constructor. Create instances dynamically near the start of your application after creating
|
|
|
|
a wxDocManager instance, and before doing any document or view operations.
|
|
|
|
|
|
|
|
{\it manager} is the document manager object which manages this template.
|
|
|
|
|
|
|
|
{\it 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.
|
|
|
|
|
2002-05-05 10:24:07 -04:00
|
|
|
{\it filter} is an appropriate file filter such as {\tt *.txt}.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
{\it dir} is the default directory to use for file selectors.
|
|
|
|
|
|
|
|
{\it ext} is the default file extension (such as txt).
|
|
|
|
|
|
|
|
{\it 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.
|
|
|
|
|
|
|
|
{\it viewTypeName} is a name that should be unique for a given view.
|
|
|
|
|
|
|
|
{\it docClassInfo} is a pointer to the run-time document class information as returned
|
|
|
|
by the CLASSINFO macro, e.g. CLASSINFO(MyDocumentClass). If this is not supplied,
|
|
|
|
you will need to derive a new wxDocTemplate class and override the CreateDocument
|
|
|
|
member to return a new document instance on demand.
|
|
|
|
|
|
|
|
{\it viewClassInfo} is a pointer to the run-time view class information as returned
|
|
|
|
by the CLASSINFO macro, e.g. CLASSINFO(MyViewClass). If this is not supplied,
|
|
|
|
you will need to derive a new wxDocTemplate class and override the CreateView
|
|
|
|
member to return a new view instance on demand.
|
|
|
|
|
|
|
|
{\it flags} is a bit list of the following:
|
|
|
|
|
|
|
|
\begin{itemize}\itemsep=0pt
|
|
|
|
\item wxTEMPLATE\_VISIBLE The template may be displayed to the user in dialogs.
|
|
|
|
\item wxTEMPLATE\_INVISIBLE The template may not be displayed to the user in dialogs.
|
|
|
|
\item wxDEFAULT\_TEMPLATE\_FLAGS Defined as wxTEMPLATE\_VISIBLE.
|
|
|
|
\end{itemize}
|
|
|
|
|
2002-12-27 13:30:48 -05:00
|
|
|
\perlnote{In wxPerl {\tt docClassInfo} and {\tt viewClassInfo} can be
|
|
|
|
either {\tt Wx::ClassInfo} objects or strings which contain the name
|
|
|
|
of the perl packages which are to be used as {\tt Wx::Document} and
|
|
|
|
{\tt Wx::View} classes (they must have a constructor named {\tt
|
2004-02-21 20:16:32 -05:00
|
|
|
new}):
|
|
|
|
|
2002-12-27 13:30:48 -05:00
|
|
|
\indented{2cm}{\begin{twocollist}
|
|
|
|
\twocolitem{{\bf Wx::DocTemplate->new( docmgr, descr, filter, dir,
|
|
|
|
ext, docTypeName, viewTypeName, docClassInfo, viewClassInfo, flags
|
|
|
|
)}}{ will construct document and view objects from the class information}
|
|
|
|
\twocolitem{{\bf Wx::DocTemplate->new( docmgr, descr, filter, dir,
|
|
|
|
ext, docTypeName, viewTypeName, docClassName, viewClassName, flags
|
|
|
|
)}}{ will construct document and view objects from perl packages}
|
|
|
|
\twocolitem{{\bf Wx::DocTemplate->new( docmgr, descr, filter, dir,
|
|
|
|
ext, docTypeName, viewTypeName )}}{
|
|
|
|
{\tt Wx::DocTemplate::CreateDocument()} and
|
|
|
|
{\tt Wx::DocTemplate::CreateView()} must be overridden}
|
|
|
|
\end{twocollist}}}
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::\destruct{wxDocTemplate}}\label{wxdoctemplatedtor}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{void}{\destruct{wxDocTemplate}}{\void}
|
|
|
|
|
|
|
|
Destructor.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::CreateDocument}\label{wxdoctemplatecreatedocument}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{wxDocument *}{CreateDocument}{\param{const wxString\& }{path}, \param{long}{ flags = 0}}
|
|
|
|
|
|
|
|
Creates a new instance of the associated document class. If you have not supplied
|
|
|
|
a wxClassInfo parameter to the template constructor, you will need to override this
|
|
|
|
function to return an appropriate document instance.
|
|
|
|
|
2004-06-03 10:19:39 -04:00
|
|
|
This function calls wxDocTemplate::InitDocument which in turns
|
|
|
|
calls wxDocument::OnCreate.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::CreateView}\label{wxdoctemplatecreateview}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{wxView *}{CreateView}{\param{wxDocument *}{doc}, \param{long}{ flags = 0}}
|
|
|
|
|
|
|
|
Creates a new instance of the associated view class. If you have not supplied
|
|
|
|
a wxClassInfo parameter to the template constructor, you will need to override this
|
|
|
|
function to return an appropriate view instance.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::GetDefaultExtension}\label{wxdoctemplategetdefaultextension}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{wxString}{GetDefaultExtension}{\void}
|
|
|
|
|
|
|
|
Returns the default file extension for the document data, as passed to the document template constructor.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::GetDescription}\label{wxdoctemplategetdescription}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{wxString}{GetDescription}{\void}
|
|
|
|
|
|
|
|
Returns the text description of this template, as passed to the document template constructor.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::GetDirectory}\label{wxdoctemplategetdirectory}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{wxString}{GetDirectory}{\void}
|
|
|
|
|
|
|
|
Returns the default directory, as passed to the document template constructor.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::GetDocumentManager}\label{wxdoctemplategetdocumentmanager}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{wxDocManager *}{GetDocumentManager}{\void}
|
|
|
|
|
|
|
|
Returns a pointer to the document manager instance for which this template was created.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::GetDocumentName}\label{wxdoctemplategetdocumentname}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{wxString}{GetDocumentName}{\void}
|
|
|
|
|
|
|
|
Returns the document type name, as passed to the document template constructor.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::GetFileFilter}\label{wxdoctemplategetfilefilter}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{wxString}{GetFileFilter}{\void}
|
|
|
|
|
|
|
|
Returns the file filter, as passed to the document template constructor.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::GetFlags}\label{wxdoctemplategetflags}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{long}{GetFlags}{\void}
|
|
|
|
|
|
|
|
Returns the flags, as passed to the document template constructor.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::GetViewName}\label{wxdoctemplategetviewname}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{wxString}{GetViewName}{\void}
|
|
|
|
|
|
|
|
Returns the view type name, as passed to the document template constructor.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::InitDocument}\label{wxdoctemplateinitdocument}
|
2004-06-03 10:19:39 -04:00
|
|
|
|
|
|
|
\func{bool}{InitDocument}{\param{wxDocument* }{doc}, \param{const wxString\& }{path}, \param{long}{ flags = 0}}
|
|
|
|
|
|
|
|
Initialises the document, calling wxDocument::OnCreate. This is called from
|
|
|
|
wxDocTemplate::CreateDocument.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::IsVisible}\label{wxdoctemplateisvisible}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{bool}{IsVisible}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true if the document template can be shown in user dialogs, false otherwise.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::SetDefaultExtension}\label{wxdoctemplatesetdefaultextension}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{void}{SetDefaultExtension}{\param{const wxString\& }{ext}}
|
|
|
|
|
|
|
|
Sets the default file extension.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::SetDescription}\label{wxdoctemplatesetdescription}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{void}{SetDescription}{\param{const wxString\& }{descr}}
|
|
|
|
|
|
|
|
Sets the template description.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::SetDirectory}\label{wxdoctemplatesetdirectory}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{void}{SetDirectory}{\param{const wxString\& }{dir}}
|
|
|
|
|
|
|
|
Sets the default directory.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::SetDocumentManager}\label{wxdoctemplatesetdocumentmanager}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{void}{SetDocumentManager}{\param{wxDocManager *}{manager}}
|
|
|
|
|
|
|
|
Sets the pointer to the document manager instance for which this template was created.
|
|
|
|
Should not be called by the application.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::SetFileFilter}\label{wxdoctemplatesetfilefilter}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{void}{SetFileFilter}{\param{const wxString\& }{filter}}
|
|
|
|
|
|
|
|
Sets the file filter.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxDocTemplate::SetFlags}\label{wxdoctemplatesetflags}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{void}{SetFlags}{\param{long }{flags}}
|
|
|
|
|
|
|
|
Sets the internal document template flags (see the constructor description for more details).
|
|
|
|
|