]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/xmlres.tex
Patch #1459942: typos.
[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
JS
37
38\func{}{wxXmlResource}{\param{const wxString\& }{filemask}, \param{int }{flags = wxXRC\_USE\_LOCALE}}
39
40Constructor.
d958c9bd 41
bd330a69
JS
42\docparam{filemask}{The XRC file, archive file, or wildcard specification that will be used to
43load all resource files inside a zip archive.}
44
45\docparam{flags}{wxXRC\_USE\_LOCALE: translatable strings will be translated via \_().
46wxXRC\_NO\_SUBCLASSING: subclass property of object nodes will be ignored
47(useful for previews in XRC editors).}
d958c9bd
JS
48
49\func{}{wxXmlResource}{\param{int }{flags = wxXRC\_USE\_LOCALE}}
50
51Constructor.
d958c9bd 52
bd330a69
JS
53\docparam{flags}{wxXRC\_USE\_LOCALE: translatable strings will be translated via \_().
54wxXRC\_NO\_SUBCLASSING: subclass property of object nodes will be ignored
cd900c59
VZ
55(useful for previews in XRC editors). wxXRC\_NO\_RELOADING will prevent the
56XRC files from being reloaded from disk in case they have been modified there
57since being last loaded (may slightly speed up loading them).}
d958c9bd 58
60fd818a 59
d958c9bd
JS
60\membersection{wxXmlResource::\destruct{wxXmlResource}}\label{wxxmlresourcedtor}
61
62\func{}{\destruct{wxXmlResource}}{\void}
63
64Destructor.
65
60fd818a 66
d958c9bd
JS
67\membersection{wxXmlResource::AddHandler}\label{wxxmlresourceaddhandler}
68
69\func{void}{AddHandler}{\param{wxXmlResourceHandler* }{handler}}
70
bd330a69
JS
71Initializes only a specific handler (or custom handler). Convention says
72that the handler name is equal to the control's name plus 'XmlHandler', for example
d958c9bd 73wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler. The XML resource compiler
bd330a69 74(wxxrc) can create include file that contains initialization code for
d958c9bd
JS
75all controls used within the resource.
76
60fd818a 77
d958c9bd
JS
78\membersection{wxXmlResource::AttachUnknownControl}\label{wxxmlresourceattachunknowncontrol}
79
80\func{bool}{AttachUnknownControl}{\param{const wxString\& }{name}, \param{wxWindow* }{control}, \param{wxWindow* }{parent = NULL}}
81
82Attaches an unknown control to the given panel/window/dialog.
83Unknown controls are used in conjunction with <object class="unknown">.
84
60fd818a 85
d958c9bd
JS
86\membersection{wxXmlResource::ClearHandlers}\label{wxxmlresourceclearhandlers}
87
88\func{void}{ClearHandlers}{\void}
89
bd330a69 90Removes all handlers.
d958c9bd 91
60fd818a 92
d958c9bd
JS
93\membersection{wxXmlResource::CompareVersion}\label{wxxmlresourcecompareversion}
94
95\constfunc{int}{CompareVersion}{\param{int }{major}, \param{int }{minor}, \param{int }{release}, \param{int }{revision}}
96
bd330a69
JS
97Compares the XRC version to the argument. Returns -1 if the XRC version
98is less than the argument, +1 if greater, and 0 if they equal.
d958c9bd 99
60fd818a 100
d958c9bd
JS
101\membersection{wxXmlResource::Get}\label{wxxmlresourceget}
102
103\func{wxXmlResource*}{Get}{\void}
104
d958c9bd
JS
105Gets the global resources object or creates one if none exists.
106
60fd818a 107
d958c9bd
JS
108\membersection{wxXmlResource::GetFlags}\label{wxxmlresourcegetflags}
109
110\func{int}{GetFlags}{\void}
111
112Returns flags, which may be a bitlist of wxXRC\_USE\_LOCALE and wxXRC\_NO\_SUBCLASSING.
113
60fd818a 114
d958c9bd
JS
115\membersection{wxXmlResource::GetVersion}\label{wxxmlresourcegetversion}
116
117\constfunc{long}{GetVersion}{\void}
118
7af3ca16 119Returns version information (a.b.c.d = d+ 256*c + 256\textasciicircum2*b + 256\textasciitilde3*a).
d958c9bd 120
60fd818a 121
094eb71a 122\membersection{wxXmlResource::GetXRCID}\label{wxxmlresourcegetxmlid}
d958c9bd 123
094eb71a 124\func{int}{GetXRCID}{\param{const wxChar* }{str\_id}}
d958c9bd 125
bd330a69 126Returns a numeric ID that is equivalent to the string ID used in an XML
d958c9bd 127resource. To be used in event tables.
9ecce691 128The macro {\tt XRCID(name)} is provided for convenience.
d958c9bd 129
60fd818a 130
d958c9bd
JS
131\membersection{wxXmlResource::InitAllHandlers}\label{wxxmlresourceinitallhandlers}
132
133\func{void}{InitAllHandlers}{\void}
134
bd330a69 135Initializes handlers for all supported controls/windows. This will
d958c9bd 136make the executable quite big because it forces linking against
fc2171bd 137most of the wxWidgets library.
d958c9bd 138
60fd818a 139
d958c9bd
JS
140\membersection{wxXmlResource::Load}\label{wxxmlresourceload}
141
142\func{bool}{Load}{\param{const wxString\& }{filemask}}
143
144Loads resources from XML files that match given filemask.
145This method understands VFS (see filesys.h).
146
60fd818a 147
d958c9bd
JS
148\membersection{wxXmlResource::LoadBitmap}\label{wxxmlresourceloadbitmap}
149
150\func{wxBitmap}{LoadBitmap}{\param{const wxString\& }{name}}
151
152Loads a bitmap resource from a file.
153
60fd818a 154
d958c9bd
JS
155\membersection{wxXmlResource::LoadDialog}\label{wxxmlresourceloaddialog}
156
157\func{wxDialog*}{LoadDialog}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}
158
bd330a69 159Loads a dialog. {\it dlg} points to a parent window (if any).
d958c9bd
JS
160
161\func{bool}{LoadDialog}{\param{wxDialog* }{dlg}, \param{wxWindow* }{parent}, \param{const wxString\& }{name}}
162
bd330a69
JS
163Loads a dialog. {\it dlg} points to parent window (if any).
164
165This form is used to finish creation of an already existing instance (the main reason
166for this is that you may want to use derived class with a new event table).
d958c9bd 167
bd330a69
JS
168Example:
169
170\begin{verbatim}
171 MyDialog dlg;
172 wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog");
173 dlg->ShowModal();
174\end{verbatim}
d958c9bd 175
60fd818a 176
d958c9bd
JS
177\membersection{wxXmlResource::LoadFrame}\label{wxxmlresourceloadframe}
178
179\func{bool}{LoadFrame}{\param{wxFrame* }{frame}, \param{wxWindow* }{parent}, \param{const wxString\& }{name}}
180
181Loads a frame.
182
60fd818a 183
d958c9bd
JS
184\membersection{wxXmlResource::LoadIcon}\label{wxxmlresourceloadicon}
185
186\func{wxIcon}{LoadIcon}{\param{const wxString\& }{name}}
187
188Loads an icon resource from a file.
189
60fd818a 190
d958c9bd
JS
191\membersection{wxXmlResource::LoadMenu}\label{wxxmlresourceloadmenu}
192
193\func{wxMenu*}{LoadMenu}{\param{const wxString\& }{name}}
194
195Loads menu from resource. Returns NULL on failure.
196
60fd818a 197
d958c9bd
JS
198\membersection{wxXmlResource::LoadMenuBar}\label{wxxmlresourceloadmenubar}
199
200\func{wxMenuBar*}{LoadMenuBar}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}
201
bd330a69 202Loads a menubar from resource. Returns NULL on failure.
d958c9bd
JS
203
204\func{wxMenuBar*}{LoadMenuBar}{\param{const wxString\& }{name}}
205
bd330a69 206Loads a menubar from resource. Returns NULL on failure.
d958c9bd 207
60fd818a 208
d958c9bd
JS
209\membersection{wxXmlResource::LoadPanel}\label{wxxmlresourceloadpanel}
210
211\func{wxPanel*}{LoadPanel}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}
212
bd330a69 213Loads a panel. {\it panel} points to parent window (if any).
d958c9bd
JS
214
215\func{bool}{LoadPanel}{\param{wxPanel* }{panel}, \param{wxWindow* }{parent}, \param{const wxString\& }{name}}
216
bd330a69
JS
217Loads a panel. {\it panel} points to parent window (if any). This form
218is used to finish creation of an already existing instance.
d958c9bd 219
60fd818a 220
d958c9bd
JS
221\membersection{wxXmlResource::LoadToolBar}\label{wxxmlresourceloadtoolbar}
222
223\func{wxToolBar*}{LoadToolBar}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}
224
225Loads a toolbar.
226
60fd818a 227
d958c9bd
JS
228\membersection{wxXmlResource::Set}\label{wxxmlresourceset}
229
230\func{wxXmlResource*}{Set}{\param{wxXmlResource* }{res}}
231
232Sets the global resources object and returns a pointer to the previous one (may be NULL).
233
60fd818a 234
2b5f62a0
VZ
235\membersection{wxXmlResource::SetFlags}\label{wxxmlresourcesetflags}
236
9a75ba66 237\func{void}{SetFlags}{\param{int }{flags}}
2b5f62a0
VZ
238
239Sets flags (bitlist of wxXRC\_USE\_LOCALE and wxXRC\_NO\_SUBCLASSING).
240
60fd818a
VZ
241
242\membersection{wxXmlResource::Unload}\label{wxxmlresourceunload}
243
244\func{bool}{Unload}{\param{const wxString\& }{filename}}
245
246This function unloads a resource previously loaded by
247\helpref{Load()}{wxxmlresourceload}.
248
249Returns \true if the resource was successfully unloaded and \false if it hasn't
250been found in the list of loaded resources.
251