]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/doctempl.tex
a bit more docs
[wxWidgets.git] / docs / latex / wx / doctempl.tex
CommitLineData
a660d684
KB
1\section{\class{wxDocTemplate}}\label{wxdoctemplate}
2
3The wxDocTemplate class is used to model the relationship between a
4document class and a view class.
5
6\wxheading{Derived from}
7
8\helpref{wxObject}{wxobject}
9
10\wxheading{See also}
11
12\helpref{wxDocTemplate overview}{wxdoctemplateoverview}, \helpref{wxDocument}{wxdocument}, \helpref{wxView}{wxview}
13
14\latexignore{\rtfignore{\wxheading{Members}}}
15
16\membersection{wxDocTemplate::m\_defaultExt}
17
18\member{wxString}{m\_defaultExt}
19
20The default extension for files of this type.
21
22\membersection{wxDocTemplate::m\_description}
23
24\member{wxString}{m\_description}
25
26A short description of this template.
27
28\membersection{wxDocTemplate::m\_directory}
29
30\member{wxString}{m\_directory}
31
32The default directory for files of this type.
33
34\membersection{wxDocTemplate::m\_docClassInfo}
35
36\member{wxClassInfo* }{m\_docClassInfo}
37
38Run-time class information that allows document instances to be constructed dynamically.
39
40\membersection{wxDocTemplate::m\_docTypeName}
41
42\member{wxString}{m\_docTypeName}
43
44The named type of the document associated with this template.
45
46\membersection{wxDocTemplate::m\_documentManager}
47
48\member{wxDocTemplate*}{m\_documentManager}
49
50A pointer to the document manager for which this template was created.
51
52\membersection{wxDocTemplate::m\_fileFilter}
53
54\member{wxString}{m\_fileFilter}
55
56The file filter (such as \verb$*.txt$) to be used in file selector dialogs.
57
58\membersection{wxDocTemplate::m\_flags}
59
60\member{long}{m\_flags}
61
62The flags passed to the constructor.
63
64\membersection{wxDocTemplate::m\_viewClassInfo}
65
66\member{wxClassInfo*}{m\_viewClassInfo}
67
68Run-time class information that allows view instances to be constructed dynamically.
69
70\membersection{wxDocTemplate::m\_viewTypeName}
71
72\member{wxString}{m\_viewTypeName}
73
74The named type of the view associated with this template.
75
76\membersection{wxDocTemplate::wxDocTemplate}
77
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}}
82
83Constructor. Create instances dynamically near the start of your application after creating
84a wxDocManager instance, and before doing any document or view operations.
85
86{\it manager} is the document manager object which manages this template.
87
88{\it descr} is a short description of what the template is for. This string will be displayed in the
89file filter list of Windows file selectors.
90
91{\it filter} is an appropriate file filter such as \verb$*.txt$.
92
93{\it dir} is the default directory to use for file selectors.
94
95{\it ext} is the default file extension (such as txt).
96
97{\it docTypeName} is a name that should be unique for a given type of document, used for
98gathering a list of views relevant to a particular document.
99
100{\it viewTypeName} is a name that should be unique for a given view.
101
102{\it docClassInfo} is a pointer to the run-time document class information as returned
103by the CLASSINFO macro, e.g. CLASSINFO(MyDocumentClass). If this is not supplied,
104you will need to derive a new wxDocTemplate class and override the CreateDocument
105member to return a new document instance on demand.
106
107{\it viewClassInfo} is a pointer to the run-time view class information as returned
108by the CLASSINFO macro, e.g. CLASSINFO(MyViewClass). If this is not supplied,
109you will need to derive a new wxDocTemplate class and override the CreateView
110member to return a new view instance on demand.
111
112{\it flags} is a bit list of the following:
113
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.
118\end{itemize}
119
120\membersection{wxDocTemplate::\destruct{wxDocTemplate}}
121
122\func{void}{\destruct{wxDocTemplate}}{\void}
123
124Destructor.
125
126\membersection{wxDocTemplate::CreateDocument}
127
128\func{wxDocument *}{CreateDocument}{\param{const wxString\& }{path}, \param{long}{ flags = 0}}
129
130Creates a new instance of the associated document class. If you have not supplied
131a wxClassInfo parameter to the template constructor, you will need to override this
132function to return an appropriate document instance.
133
134\membersection{wxDocTemplate::CreateView}
135
136\func{wxView *}{CreateView}{\param{wxDocument *}{doc}, \param{long}{ flags = 0}}
137
138Creates a new instance of the associated view class. If you have not supplied
139a wxClassInfo parameter to the template constructor, you will need to override this
140function to return an appropriate view instance.
141
142\membersection{wxDocTemplate::GetDefaultExtension}
143
144\func{wxString}{GetDefaultExtension}{\void}
145
146Returns the default file extension for the document data, as passed to the document template constructor.
147
148\membersection{wxDocTemplate::GetDescription}
149
150\func{wxString}{GetDescription}{\void}
151
152Returns the text description of this template, as passed to the document template constructor.
153
154\membersection{wxDocTemplate::GetDirectory}
155
156\func{wxString}{GetDirectory}{\void}
157
158Returns the default directory, as passed to the document template constructor.
159
160\membersection{wxDocTemplate::GetDocumentManager}
161
162\func{wxDocManager *}{GetDocumentManager}{\void}
163
164Returns a pointer to the document manager instance for which this template was created.
165
166\membersection{wxDocTemplate::GetDocumentName}
167
168\func{wxString}{GetDocumentName}{\void}
169
170Returns the document type name, as passed to the document template constructor.
171
172\membersection{wxDocTemplate::GetFileFilter}
173
174\func{wxString}{GetFileFilter}{\void}
175
176Returns the file filter, as passed to the document template constructor.
177
178\membersection{wxDocTemplate::GetFlags}
179
180\func{long}{GetFlags}{\void}
181
182Returns the flags, as passed to the document template constructor.
183
184\membersection{wxDocTemplate::GetViewName}
185
186\func{wxString}{GetViewName}{\void}
187
188Returns the view type name, as passed to the document template constructor.
189
190\membersection{wxDocTemplate::IsVisible}
191
192\func{bool}{IsVisible}{\void}
193
194Returns TRUE if the document template can be shown in user dialogs, FALSE otherwise.
195
196\membersection{wxDocTemplate::SetDefaultExtension}
197
198\func{void}{SetDefaultExtension}{\param{const wxString\& }{ext}}
199
200Sets the default file extension.
201
202\membersection{wxDocTemplate::SetDescription}
203
204\func{void}{SetDescription}{\param{const wxString\& }{descr}}
205
206Sets the template description.
207
208\membersection{wxDocTemplate::SetDirectory}
209
210\func{void}{SetDirectory}{\param{const wxString\& }{dir}}
211
212Sets the default directory.
213
214\membersection{wxDocTemplate::SetDocumentManager}
215
216\func{void}{SetDocumentManager}{\param{wxDocManager *}{manager}}
217
218Sets the pointer to the document manager instance for which this template was created.
219Should not be called by the application.
220
221\membersection{wxDocTemplate::SetFileFilter}
222
223\func{void}{SetFileFilter}{\param{const wxString\& }{filter}}
224
225Sets the file filter.
226
227\membersection{wxDocTemplate::SetFlags}
228
229\func{void}{SetFlags}{\param{long }{flags}}
230
231Sets the internal document template flags (see the constructor description for more details).
232
233