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