]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/xmlres.tex
[ 1553595 ] Doc error: wxView::OnDraw
[wxWidgets.git] / docs / latex / wx / xmlres.tex
CommitLineData
d958c9bd
JS
1%
2% automatically generated by HelpGen $Revision$ from
3% xmlres.h at 22/Jan/02 23:08:28
4%
5
d958c9bd
JS
6\section{\class{wxXmlResource}}\label{wxxmlresource}
7
bd330a69
JS
8This is the main class for interacting with the XML-based resource system.
9
10The class holds XML resources from one or more .xml files, binary files or zip archive files.
11
12See \helpref{XML-based resource system overview}{xrcoverview} for details.
d958c9bd 13
d958c9bd
JS
14\wxheading{Derived from}
15
16\helpref{wxObject}{wxobject}
17
18\wxheading{Include files}
19
bd330a69 20<wx/xrc/xmlres.h>
d958c9bd 21
cd900c59 22\wxheading{Constants}
d958c9bd 23
7af3ca16 24\begin{verbatim}
bd330a69
JS
25enum wxXmlResourceFlags
26{
e98a0358 27 wxXRC_USE_LOCALE = 1,
cd900c59
VZ
28 wxXRC_NO_SUBCLASSING = 2,
29 wxXRC_NO_RELOADING = 4
bd330a69 30};
7af3ca16 31\end{verbatim}
d958c9bd 32
bd330a69 33\latexignore{\rtfignore{\wxheading{Members}}}
d958c9bd 34
60fd818a 35
6d06e061 36\membersection{wxXmlResource::wxXmlResource}\label{wxxmlresourcector}
d958c9bd 37
d4a724d4
RD
38\func{}{wxXmlResource}{\param{const wxString\& }{filemask},
39 \param{int }{flags = wxXRC\_USE\_LOCALE},
40 \param{const wxString& }{domain = wxEmptyString}}
d958c9bd
JS
41
42Constructor.
d958c9bd 43
bd330a69
JS
44\docparam{filemask}{The XRC file, archive file, or wildcard specification that will be used to
45load all resource files inside a zip archive.}
46
47\docparam{flags}{wxXRC\_USE\_LOCALE: translatable strings will be translated via \_().
48wxXRC\_NO\_SUBCLASSING: subclass property of object nodes will be ignored
49(useful for previews in XRC editors).}
d958c9bd 50
d4a724d4
RD
51\docparam{domain}{The name of the gettext catalog to search for
52 translatable strings. By default all loaded catalogs will be
53 searched. This provides a way to allow the strings to only come
54 from a specific catalog.}
55
56\func{}{wxXmlResource}{\param{int }{flags = wxXRC\_USE\_LOCALE},
57 \param{const wxString& }{domain = wxEmptyString}}
d958c9bd
JS
58
59Constructor.
d958c9bd 60
bd330a69
JS
61\docparam{flags}{wxXRC\_USE\_LOCALE: translatable strings will be translated via \_().
62wxXRC\_NO\_SUBCLASSING: subclass property of object nodes will be ignored
cd900c59
VZ
63(useful for previews in XRC editors). wxXRC\_NO\_RELOADING will prevent the
64XRC files from being reloaded from disk in case they have been modified there
65since being last loaded (may slightly speed up loading them).}
d958c9bd 66
d4a724d4
RD
67\docparam{domain}{The name of the gettext catalog to search for
68 translatable strings. By default all loaded catalogs will be
69 searched. This provides a way to allow the strings to only come
70 from a specific catalog.}
71
60fd818a 72
d958c9bd
JS
73\membersection{wxXmlResource::\destruct{wxXmlResource}}\label{wxxmlresourcedtor}
74
75\func{}{\destruct{wxXmlResource}}{\void}
76
77Destructor.
78
60fd818a 79
d958c9bd
JS
80\membersection{wxXmlResource::AddHandler}\label{wxxmlresourceaddhandler}
81
82\func{void}{AddHandler}{\param{wxXmlResourceHandler* }{handler}}
83
bd330a69
JS
84Initializes only a specific handler (or custom handler). Convention says
85that the handler name is equal to the control's name plus 'XmlHandler', for example
d958c9bd 86wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler. The XML resource compiler
bd330a69 87(wxxrc) can create include file that contains initialization code for
154b6b0f 88all controls used within the resource. Note that this handler should be
a245fd31
VZ
89allocated on the heap, since it will be delete by
90\helpref{ClearHandlers}{wxxmlresourceclearhandlers} later.
d958c9bd 91
60fd818a 92
d958c9bd
JS
93\membersection{wxXmlResource::AttachUnknownControl}\label{wxxmlresourceattachunknowncontrol}
94
95\func{bool}{AttachUnknownControl}{\param{const wxString\& }{name}, \param{wxWindow* }{control}, \param{wxWindow* }{parent = NULL}}
96
97Attaches an unknown control to the given panel/window/dialog.
98Unknown controls are used in conjunction with <object class="unknown">.
99
60fd818a 100
d958c9bd
JS
101\membersection{wxXmlResource::ClearHandlers}\label{wxxmlresourceclearhandlers}
102
103\func{void}{ClearHandlers}{\void}
104
a245fd31
VZ
105Removes all handlers and deletes them (this means that any handlers added using
106\helpref{AddHandler}{wxxmlresourceaddhandler} must be allocated on the heap).
d958c9bd 107
60fd818a 108
d958c9bd
JS
109\membersection{wxXmlResource::CompareVersion}\label{wxxmlresourcecompareversion}
110
111\constfunc{int}{CompareVersion}{\param{int }{major}, \param{int }{minor}, \param{int }{release}, \param{int }{revision}}
112
bd330a69
JS
113Compares the XRC version to the argument. Returns -1 if the XRC version
114is less than the argument, +1 if greater, and 0 if they equal.
d958c9bd 115
60fd818a 116
d958c9bd
JS
117\membersection{wxXmlResource::Get}\label{wxxmlresourceget}
118
119\func{wxXmlResource*}{Get}{\void}
120
d958c9bd
JS
121Gets the global resources object or creates one if none exists.
122
60fd818a 123
d958c9bd
JS
124\membersection{wxXmlResource::GetFlags}\label{wxxmlresourcegetflags}
125
126\func{int}{GetFlags}{\void}
127
128Returns flags, which may be a bitlist of wxXRC\_USE\_LOCALE and wxXRC\_NO\_SUBCLASSING.
129
60fd818a 130
d958c9bd
JS
131\membersection{wxXmlResource::GetVersion}\label{wxxmlresourcegetversion}
132
133\constfunc{long}{GetVersion}{\void}
134
7af3ca16 135Returns version information (a.b.c.d = d+ 256*c + 256\textasciicircum2*b + 256\textasciitilde3*a).
d958c9bd 136
60fd818a 137
094eb71a 138\membersection{wxXmlResource::GetXRCID}\label{wxxmlresourcegetxmlid}
d958c9bd 139
9b2a7469 140\func{int}{GetXRCID}{\param{const wxChar* }{str\_id}, \param{int }{value\_if\_not\_found = -2}}
d958c9bd 141
bd330a69 142Returns a numeric ID that is equivalent to the string ID used in an XML
9b2a7469
VZ
143resource. If an unknown \arg{str\_id} is requested (i.e. other than wxID\_XXX
144or integer), a new record is created which associates the given string with
145a number. If \arg{value\_if\_not\_found} is \texttt{wxID\_NONE}, the number is obtained via
146\helpref{wxNewId()}{wxnewid}. Otherwise \arg{value\_if\_not\_found} is used.
147Macro {\tt XRCID(name)} is provided for convenient use in event tables.
60fd818a 148
d958c9bd
JS
149\membersection{wxXmlResource::InitAllHandlers}\label{wxxmlresourceinitallhandlers}
150
151\func{void}{InitAllHandlers}{\void}
152
bd330a69 153Initializes handlers for all supported controls/windows. This will
d958c9bd 154make the executable quite big because it forces linking against
fc2171bd 155most of the wxWidgets library.
d958c9bd 156
60fd818a 157
d958c9bd
JS
158\membersection{wxXmlResource::Load}\label{wxxmlresourceload}
159
160\func{bool}{Load}{\param{const wxString\& }{filemask}}
161
162Loads resources from XML files that match given filemask.
163This method understands VFS (see filesys.h).
164
60fd818a 165
d958c9bd
JS
166\membersection{wxXmlResource::LoadBitmap}\label{wxxmlresourceloadbitmap}
167
168\func{wxBitmap}{LoadBitmap}{\param{const wxString\& }{name}}
169
170Loads a bitmap resource from a file.
171
60fd818a 172
d958c9bd
JS
173\membersection{wxXmlResource::LoadDialog}\label{wxxmlresourceloaddialog}
174
175\func{wxDialog*}{LoadDialog}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}
176
bd330a69 177Loads a dialog. {\it dlg} points to a parent window (if any).
d958c9bd
JS
178
179\func{bool}{LoadDialog}{\param{wxDialog* }{dlg}, \param{wxWindow* }{parent}, \param{const wxString\& }{name}}
180
bd330a69
JS
181Loads a dialog. {\it dlg} points to parent window (if any).
182
183This form is used to finish creation of an already existing instance (the main reason
184for this is that you may want to use derived class with a new event table).
d958c9bd 185
bd330a69
JS
186Example:
187
188\begin{verbatim}
189 MyDialog dlg;
190 wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog");
191 dlg->ShowModal();
192\end{verbatim}
d958c9bd 193
60fd818a 194
d958c9bd
JS
195\membersection{wxXmlResource::LoadFrame}\label{wxxmlresourceloadframe}
196
197\func{bool}{LoadFrame}{\param{wxFrame* }{frame}, \param{wxWindow* }{parent}, \param{const wxString\& }{name}}
198
199Loads a frame.
200
60fd818a 201
d958c9bd
JS
202\membersection{wxXmlResource::LoadIcon}\label{wxxmlresourceloadicon}
203
204\func{wxIcon}{LoadIcon}{\param{const wxString\& }{name}}
205
206Loads an icon resource from a file.
207
60fd818a 208
d958c9bd
JS
209\membersection{wxXmlResource::LoadMenu}\label{wxxmlresourceloadmenu}
210
211\func{wxMenu*}{LoadMenu}{\param{const wxString\& }{name}}
212
213Loads menu from resource. Returns NULL on failure.
214
60fd818a 215
d958c9bd
JS
216\membersection{wxXmlResource::LoadMenuBar}\label{wxxmlresourceloadmenubar}
217
218\func{wxMenuBar*}{LoadMenuBar}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}
219
bd330a69 220Loads a menubar from resource. Returns NULL on failure.
d958c9bd
JS
221
222\func{wxMenuBar*}{LoadMenuBar}{\param{const wxString\& }{name}}
223
bd330a69 224Loads a menubar from resource. Returns NULL on failure.
d958c9bd 225
60fd818a 226
d958c9bd
JS
227\membersection{wxXmlResource::LoadPanel}\label{wxxmlresourceloadpanel}
228
229\func{wxPanel*}{LoadPanel}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}
230
bd330a69 231Loads a panel. {\it panel} points to parent window (if any).
d958c9bd
JS
232
233\func{bool}{LoadPanel}{\param{wxPanel* }{panel}, \param{wxWindow* }{parent}, \param{const wxString\& }{name}}
234
bd330a69
JS
235Loads a panel. {\it panel} points to parent window (if any). This form
236is used to finish creation of an already existing instance.
d958c9bd 237
60fd818a 238
d958c9bd
JS
239\membersection{wxXmlResource::LoadToolBar}\label{wxxmlresourceloadtoolbar}
240
241\func{wxToolBar*}{LoadToolBar}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}
242
243Loads a toolbar.
244
60fd818a 245
d958c9bd
JS
246\membersection{wxXmlResource::Set}\label{wxxmlresourceset}
247
248\func{wxXmlResource*}{Set}{\param{wxXmlResource* }{res}}
249
250Sets the global resources object and returns a pointer to the previous one (may be NULL).
251
60fd818a 252
2b5f62a0
VZ
253\membersection{wxXmlResource::SetFlags}\label{wxxmlresourcesetflags}
254
9a75ba66 255\func{void}{SetFlags}{\param{int }{flags}}
2b5f62a0
VZ
256
257Sets flags (bitlist of wxXRC\_USE\_LOCALE and wxXRC\_NO\_SUBCLASSING).
258
60fd818a
VZ
259
260\membersection{wxXmlResource::Unload}\label{wxxmlresourceunload}
261
262\func{bool}{Unload}{\param{const wxString\& }{filename}}
263
264This function unloads a resource previously loaded by
265\helpref{Load()}{wxxmlresourceload}.
266
267Returns \true if the resource was successfully unloaded and \false if it hasn't
268been found in the list of loaded resources.
269
d4a724d4
RD
270
271
272\membersection{wxXmlResource::GetDomain}\label{wxxmlresourcegetdomain}
273
274\func{wxChar*}{GetDomain}{}
275
276Returns the domain (message catalog) that will be used to load
277translatable strings in the XRC.
278
279
280\membersection{wxXmlResource::SetDomain}\label{wxxmlresourcesetdomain}
281
282\func{wxChar*}{SetDomain}{\param{const wxChar* }{domain}}
283
284Sets the domain (message catalog) that will be used to load
285translatable strings in the XRC.