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