1 \section{\class{wxDocTemplate
}}\label{wxdoctemplate
}
3 The wxDocTemplate class is used to model the relationship between a
4 document class and a view class.
6 \wxheading{Derived from
}
8 \helpref{wxObject
}{wxobject
}
12 \helpref{wxDocTemplate overview
}{wxdoctemplateoverview
},
\helpref{wxDocument
}{wxdocument
},
\helpref{wxView
}{wxview
}
14 \latexignore{\rtfignore{\wxheading{Members
}}}
16 \membersection{wxDocTemplate::m
\_defaultExt}
18 \member{wxString
}{m
\_defaultExt}
20 The default extension for files of this type.
22 \membersection{wxDocTemplate::m
\_description}
24 \member{wxString
}{m
\_description}
26 A short description of this template.
28 \membersection{wxDocTemplate::m
\_directory}
30 \member{wxString
}{m
\_directory}
32 The default directory for files of this type.
34 \membersection{wxDocTemplate::m
\_docClassInfo}
36 \member{wxClassInfo*
}{m
\_docClassInfo}
38 Run-time class information that allows
document instances to be constructed dynamically.
40 \membersection{wxDocTemplate::m
\_docTypeName}
42 \member{wxString
}{m
\_docTypeName}
44 The named type of the
document associated with this template.
46 \membersection{wxDocTemplate::m
\_documentManager}
48 \member{wxDocTemplate*
}{m
\_documentManager}
50 A pointer to the
document manager for which this template was created.
52 \membersection{wxDocTemplate::m
\_fileFilter}
54 \member{wxString
}{m
\_fileFilter}
56 The file filter (such as
\verb$*.txt$) to be used in file selector dialogs.
58 \membersection{wxDocTemplate::m
\_flags}
60 \member{long
}{m
\_flags}
62 The flags passed to the constructor.
64 \membersection{wxDocTemplate::m
\_viewClassInfo}
66 \member{wxClassInfo*
}{m
\_viewClassInfo}
68 Run-time class information that allows view instances to be constructed dynamically.
70 \membersection{wxDocTemplate::m
\_viewTypeName}
72 \member{wxString
}{m
\_viewTypeName}
74 The named type of the view associated with this template.
76 \membersection{wxDocTemplate::wxDocTemplate
}
78 \func{}{wxDocTemplate
}{\param{wxDocManager*
}{manager
},
\param{const wxString\&
}{descr
},
\param{const wxString\&
}{filter
},
79 \param{const wxString\&
}{dir
},
\param{const wxString\&
}{ext
},
\param{const wxString\&
}{docTypeName
},
80 \param{const wxString\&
}{viewTypeName
},
\param{wxClassInfo*
}{docClassInfo = NULL
},
81 \param{wxClassInfo*
}{viewClassInfo = NULL
},
\param{long
}{ flags = wxDEFAULT
\_TEMPLATE\_FLAGS}}
83 Constructor. Create instances dynamically near the start of your application after creating
84 a wxDocManager instance, and before doing any
document or view operations.
86 {\it manager
} is the
document manager object which manages this template.
88 {\it descr
} is a short description of what the template is for. This string will be displayed in the
89 file filter list of Windows file selectors.
91 {\it filter
} is an appropriate file filter such as
\verb$*.txt$.
93 {\it dir
} is the default directory to use for file selectors.
95 {\it ext
} is the default file extension (such as txt).
97 {\it docTypeName
} is a name that should be unique for a given type of
document, used for
98 gathering a list of views relevant to a particular
document.
100 {\it viewTypeName
} is a name that should be unique for a given view.
102 {\it docClassInfo
} is a pointer to the run-time
document class information as returned
103 by the CLASSINFO macro, e.g. CLASSINFO(MyDocumentClass). If this is not supplied,
104 you will need to derive a new wxDocTemplate class and override the CreateDocument
105 member to return a new
document instance on demand.
107 {\it viewClassInfo
} is a pointer to the run-time view class information as returned
108 by the CLASSINFO macro, e.g. CLASSINFO(MyViewClass). If this is not supplied,
109 you will need to derive a new wxDocTemplate class and override the CreateView
110 member to return a new view instance on demand.
112 {\it flags
} is a bit list of the following:
114 \begin{itemize
}\itemsep=
0pt
115 \item wxTEMPLATE
\_VISIBLE The template may be displayed to the user in dialogs.
116 \item wxTEMPLATE
\_INVISIBLE The template may not be displayed to the user in dialogs.
117 \item wxDEFAULT
\_TEMPLATE\_FLAGS Defined as wxTEMPLATE
\_VISIBLE.
120 \membersection{wxDocTemplate::
\destruct{wxDocTemplate
}}
122 \func{void
}{\destruct{wxDocTemplate
}}{\void}
126 \membersection{wxDocTemplate::CreateDocument
}
128 \func{wxDocument *
}{CreateDocument
}{\param{const wxString\&
}{path
},
\param{long
}{ flags =
0}}
130 Creates a new instance of the associated
document class. If you have not supplied
131 a wxClassInfo parameter to the template constructor, you will need to override this
132 function to return an appropriate
document instance.
134 \membersection{wxDocTemplate::CreateView
}
136 \func{wxView *
}{CreateView
}{\param{wxDocument *
}{doc
},
\param{long
}{ flags =
0}}
138 Creates a new instance of the associated view class. If you have not supplied
139 a wxClassInfo parameter to the template constructor, you will need to override this
140 function to return an appropriate view instance.
142 \membersection{wxDocTemplate::GetDefaultExtension
}
144 \func{wxString
}{GetDefaultExtension
}{\void}
146 Returns the default file extension for the
document data, as passed to the
document template constructor.
148 \membersection{wxDocTemplate::GetDescription
}
150 \func{wxString
}{GetDescription
}{\void}
152 Returns the text description of this template, as passed to the
document template constructor.
154 \membersection{wxDocTemplate::GetDirectory
}
156 \func{wxString
}{GetDirectory
}{\void}
158 Returns the default directory, as passed to the
document template constructor.
160 \membersection{wxDocTemplate::GetDocumentManager
}
162 \func{wxDocManager *
}{GetDocumentManager
}{\void}
164 Returns a pointer to the
document manager instance for which this template was created.
166 \membersection{wxDocTemplate::GetDocumentName
}
168 \func{wxString
}{GetDocumentName
}{\void}
170 Returns the
document type name, as passed to the
document template constructor.
172 \membersection{wxDocTemplate::GetFileFilter
}
174 \func{wxString
}{GetFileFilter
}{\void}
176 Returns the file filter, as passed to the
document template constructor.
178 \membersection{wxDocTemplate::GetFlags
}
180 \func{long
}{GetFlags
}{\void}
182 Returns the flags, as passed to the
document template constructor.
184 \membersection{wxDocTemplate::GetViewName
}
186 \func{wxString
}{GetViewName
}{\void}
188 Returns the view type name, as passed to the
document template constructor.
190 \membersection{wxDocTemplate::IsVisible
}
192 \func{bool
}{IsVisible
}{\void}
194 Returns TRUE if the
document template can be shown in user dialogs, FALSE otherwise.
196 \membersection{wxDocTemplate::SetDefaultExtension
}
198 \func{void
}{SetDefaultExtension
}{\param{const wxString\&
}{ext
}}
200 Sets the default file extension.
202 \membersection{wxDocTemplate::SetDescription
}
204 \func{void
}{SetDescription
}{\param{const wxString\&
}{descr
}}
206 Sets the template description.
208 \membersection{wxDocTemplate::SetDirectory
}
210 \func{void
}{SetDirectory
}{\param{const wxString\&
}{dir
}}
212 Sets the default directory.
214 \membersection{wxDocTemplate::SetDocumentManager
}
216 \func{void
}{SetDocumentManager
}{\param{wxDocManager *
}{manager
}}
218 Sets the pointer to the
document manager instance for which this template was created.
219 Should not be called by the application.
221 \membersection{wxDocTemplate::SetFileFilter
}
223 \func{void
}{SetFileFilter
}{\param{const wxString\&
}{filter
}}
225 Sets the file filter.
227 \membersection{wxDocTemplate::SetFlags
}
229 \func{void
}{SetFlags
}{\param{long
}{flags
}}
231 Sets the internal
document template flags (see the constructor description for more details).