]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/doctempl.tex
Some manual updates; in MDI sample, child frames now have default size/position ...
[wxWidgets.git] / docs / latex / wx / doctempl.tex
1 \section{\class{wxDocTemplate}}\label{wxdoctemplate}
2
3 The wxDocTemplate class is used to model the relationship between a
4 document 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
20 The default extension for files of this type.
21
22 \membersection{wxDocTemplate::m\_description}
23
24 \member{wxString}{m\_description}
25
26 A short description of this template.
27
28 \membersection{wxDocTemplate::m\_directory}
29
30 \member{wxString}{m\_directory}
31
32 The default directory for files of this type.
33
34 \membersection{wxDocTemplate::m\_docClassInfo}
35
36 \member{wxClassInfo* }{m\_docClassInfo}
37
38 Run-time class information that allows document instances to be constructed dynamically.
39
40 \membersection{wxDocTemplate::m\_docTypeName}
41
42 \member{wxString}{m\_docTypeName}
43
44 The named type of the document associated with this template.
45
46 \membersection{wxDocTemplate::m\_documentManager}
47
48 \member{wxDocTemplate*}{m\_documentManager}
49
50 A pointer to the document manager for which this template was created.
51
52 \membersection{wxDocTemplate::m\_fileFilter}
53
54 \member{wxString}{m\_fileFilter}
55
56 The 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
62 The flags passed to the constructor.
63
64 \membersection{wxDocTemplate::m\_viewClassInfo}
65
66 \member{wxClassInfo*}{m\_viewClassInfo}
67
68 Run-time class information that allows view instances to be constructed dynamically.
69
70 \membersection{wxDocTemplate::m\_viewTypeName}
71
72 \member{wxString}{m\_viewTypeName}
73
74 The 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
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.
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
89 file 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
98 gathering 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
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.
106
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.
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
124 Destructor.
125
126 \membersection{wxDocTemplate::CreateDocument}
127
128 \func{wxDocument *}{CreateDocument}{\param{const wxString\& }{path}, \param{long}{ flags = 0}}
129
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.
133
134 \membersection{wxDocTemplate::CreateView}
135
136 \func{wxView *}{CreateView}{\param{wxDocument *}{doc}, \param{long}{ flags = 0}}
137
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.
141
142 \membersection{wxDocTemplate::GetDefaultExtension}
143
144 \func{wxString}{GetDefaultExtension}{\void}
145
146 Returns 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
152 Returns 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
158 Returns the default directory, as passed to the document template constructor.
159
160 \membersection{wxDocTemplate::GetDocumentManager}
161
162 \func{wxDocManager *}{GetDocumentManager}{\void}
163
164 Returns 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
170 Returns the document type name, as passed to the document template constructor.
171
172 \membersection{wxDocTemplate::GetFileFilter}
173
174 \func{wxString}{GetFileFilter}{\void}
175
176 Returns the file filter, as passed to the document template constructor.
177
178 \membersection{wxDocTemplate::GetFlags}
179
180 \func{long}{GetFlags}{\void}
181
182 Returns the flags, as passed to the document template constructor.
183
184 \membersection{wxDocTemplate::GetViewName}
185
186 \func{wxString}{GetViewName}{\void}
187
188 Returns the view type name, as passed to the document template constructor.
189
190 \membersection{wxDocTemplate::IsVisible}
191
192 \func{bool}{IsVisible}{\void}
193
194 Returns 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
200 Sets the default file extension.
201
202 \membersection{wxDocTemplate::SetDescription}
203
204 \func{void}{SetDescription}{\param{const wxString\& }{descr}}
205
206 Sets the template description.
207
208 \membersection{wxDocTemplate::SetDirectory}
209
210 \func{void}{SetDirectory}{\param{const wxString\& }{dir}}
211
212 Sets the default directory.
213
214 \membersection{wxDocTemplate::SetDocumentManager}
215
216 \func{void}{SetDocumentManager}{\param{wxDocManager *}{manager}}
217
218 Sets the pointer to the document manager instance for which this template was created.
219 Should not be called by the application.
220
221 \membersection{wxDocTemplate::SetFileFilter}
222
223 \func{void}{SetFileFilter}{\param{const wxString\& }{filter}}
224
225 Sets the file filter.
226
227 \membersection{wxDocTemplate::SetFlags}
228
229 \func{void}{SetFlags}{\param{long }{flags}}
230
231 Sets the internal document template flags (see the constructor description for more details).
232
233