File: xmlres.tex

package info (click to toggle)
wxwidgets2.8 2.8.10.1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 239,052 kB
  • ctags: 289,550
  • sloc: cpp: 1,838,857; xml: 396,717; python: 282,506; ansic: 126,171; makefile: 51,406; sh: 14,581; asm: 299; sql: 258; lex: 194; perl: 139; yacc: 128; pascal: 95; php: 39; lisp: 38; tcl: 24; haskell: 20; java: 18; cs: 18; erlang: 17; ruby: 16; ada: 9; ml: 9; csh: 9
file content (286 lines) | stat: -rw-r--r-- 9,318 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
%
% automatically generated by HelpGen $Revision: 49515 $ from
% xmlres.h at 22/Jan/02 23:08:28
%

\section{\class{wxXmlResource}}\label{wxxmlresource}

This is the main class for interacting with the XML-based resource system.

The class holds XML resources from one or more .xml files, binary files or zip archive files.

See \helpref{XML-based resource system overview}{xrcoverview} for details.

\wxheading{Derived from}

\helpref{wxObject}{wxobject}

\wxheading{Include files}

<wx/xrc/xmlres.h>

\wxheading{Constants}

\begin{verbatim}
enum wxXmlResourceFlags
{
    wxXRC_USE_LOCALE     = 1,
    wxXRC_NO_SUBCLASSING = 2,
    wxXRC_NO_RELOADING   = 4
};
\end{verbatim}

\latexignore{\rtfignore{\wxheading{Members}}}


\membersection{wxXmlResource::wxXmlResource}\label{wxxmlresourcector}

\func{}{wxXmlResource}{\param{const wxString\& }{filemask}, 
    \param{int }{flags = wxXRC\_USE\_LOCALE},
    \param{const wxString& }{domain = wxEmptyString}}

Constructor.

\docparam{filemask}{The XRC file, archive file, or wildcard specification that will be used to
load all resource files inside a zip archive.}

\docparam{flags}{wxXRC\_USE\_LOCALE: translatable strings will be translated via \_().
wxXRC\_NO\_SUBCLASSING: subclass property of object nodes will be ignored
(useful for previews in XRC editors).}

\docparam{domain}{The name of the gettext catalog to search for
  translatable strings.  By default all loaded catalogs will be
  searched.  This provides a way to allow the strings to only come
  from a specific catalog.}

\func{}{wxXmlResource}{\param{int }{flags = wxXRC\_USE\_LOCALE},
    \param{const wxString& }{domain = wxEmptyString}}

Constructor.

\docparam{flags}{wxXRC\_USE\_LOCALE: translatable strings will be translated via \_().
wxXRC\_NO\_SUBCLASSING: subclass property of object nodes will be ignored
(useful for previews in XRC editors). wxXRC\_NO\_RELOADING will prevent the
XRC files from being reloaded from disk in case they have been modified there
since being last loaded (may slightly speed up loading them).}

\docparam{domain}{The name of the gettext catalog to search for
  translatable strings.  By default all loaded catalogs will be
  searched.  This provides a way to allow the strings to only come
  from a specific catalog.}


\membersection{wxXmlResource::\destruct{wxXmlResource}}\label{wxxmlresourcedtor}

\func{}{\destruct{wxXmlResource}}{\void}

Destructor.


\membersection{wxXmlResource::AddHandler}\label{wxxmlresourceaddhandler}

\func{void}{AddHandler}{\param{wxXmlResourceHandler* }{handler}}

Initializes only a specific handler (or custom handler). Convention says
that the handler name is equal to the control's name plus 'XmlHandler', for example
wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler. The XML resource compiler
(wxxrc) can create include file that contains initialization code for
all controls used within the resource. Note that this handler should be
allocated on the heap, since it will be delete by 
\helpref{ClearHandlers}{wxxmlresourceclearhandlers} later.


\membersection{wxXmlResource::AttachUnknownControl}\label{wxxmlresourceattachunknowncontrol}

\func{bool}{AttachUnknownControl}{\param{const wxString\& }{name}, \param{wxWindow* }{control}, \param{wxWindow* }{parent = NULL}}

Attaches an unknown control to the given panel/window/dialog.
Unknown controls are used in conjunction with <object class="unknown">.


\membersection{wxXmlResource::ClearHandlers}\label{wxxmlresourceclearhandlers}

\func{void}{ClearHandlers}{\void}

Removes all handlers and deletes them (this means that any handlers added using 
\helpref{AddHandler}{wxxmlresourceaddhandler} must be allocated on the heap).


\membersection{wxXmlResource::CompareVersion}\label{wxxmlresourcecompareversion}

\constfunc{int}{CompareVersion}{\param{int }{major}, \param{int }{minor}, \param{int }{release}, \param{int }{revision}}

Compares the XRC version to the argument. Returns -1 if the XRC version
is less than the argument, +1 if greater, and 0 if they equal.


\membersection{wxXmlResource::Get}\label{wxxmlresourceget}

\func{wxXmlResource*}{Get}{\void}

Gets the global resources object or creates one if none exists.


\membersection{wxXmlResource::GetFlags}\label{wxxmlresourcegetflags}

\func{int}{GetFlags}{\void}

Returns flags, which may be a bitlist of wxXRC\_USE\_LOCALE and wxXRC\_NO\_SUBCLASSING.


\membersection{wxXmlResource::GetVersion}\label{wxxmlresourcegetversion}

\constfunc{long}{GetVersion}{\void}

Returns version information (a.b.c.d = d+ 256*c + 256\textasciicircum2*b + 256\textasciitilde3*a).


\membersection{wxXmlResource::GetXRCID}\label{wxxmlresourcegetxmlid}

\func{int}{GetXRCID}{\param{const wxChar* }{str\_id}, \param{int }{value\_if\_not\_found = -2}}

Returns a numeric ID that is equivalent to the string ID used in an XML
resource. If an unknown \arg{str\_id} is requested (i.e. other than wxID\_XXX
or integer), a new record is created which associates the given string with
a number. If \arg{value\_if\_not\_found} is \texttt{wxID\_NONE}, the number is obtained via
\helpref{wxNewId()}{wxnewid}. Otherwise \arg{value\_if\_not\_found} is used.
Macro {\tt XRCID(name)} is provided for convenient use in event tables.

\membersection{wxXmlResource::InitAllHandlers}\label{wxxmlresourceinitallhandlers}

\func{void}{InitAllHandlers}{\void}

Initializes handlers for all supported controls/windows. This will
make the executable quite big because it forces linking against
most of the wxWidgets library.


\membersection{wxXmlResource::Load}\label{wxxmlresourceload}

\func{bool}{Load}{\param{const wxString\& }{filemask}}

Loads resources from XML files that match given filemask.
This method understands VFS (see filesys.h).


\membersection{wxXmlResource::LoadBitmap}\label{wxxmlresourceloadbitmap}

\func{wxBitmap}{LoadBitmap}{\param{const wxString\& }{name}}

Loads a bitmap resource from a file.


\membersection{wxXmlResource::LoadDialog}\label{wxxmlresourceloaddialog}

\func{wxDialog*}{LoadDialog}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}

Loads a dialog. {\it dlg} points to a parent window (if any).

\func{bool}{LoadDialog}{\param{wxDialog* }{dlg}, \param{wxWindow* }{parent}, \param{const wxString\& }{name}}

Loads a dialog. {\it dlg} points to parent window (if any).

This form is used to finish creation of an already existing instance (the main reason
for this is that you may want to use derived class with a new event table).

Example:

\begin{verbatim}
  MyDialog dlg;
  wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog");
  dlg.ShowModal();
\end{verbatim}


\membersection{wxXmlResource::LoadFrame}\label{wxxmlresourceloadframe}

\func{bool}{LoadFrame}{\param{wxFrame* }{frame}, \param{wxWindow* }{parent}, \param{const wxString\& }{name}}

Loads a frame.


\membersection{wxXmlResource::LoadIcon}\label{wxxmlresourceloadicon}

\func{wxIcon}{LoadIcon}{\param{const wxString\& }{name}}

Loads an icon resource from a file.


\membersection{wxXmlResource::LoadMenu}\label{wxxmlresourceloadmenu}

\func{wxMenu*}{LoadMenu}{\param{const wxString\& }{name}}

Loads menu from resource. Returns NULL on failure.


\membersection{wxXmlResource::LoadMenuBar}\label{wxxmlresourceloadmenubar}

\func{wxMenuBar*}{LoadMenuBar}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}

Loads a menubar from resource. Returns NULL on failure.

\func{wxMenuBar*}{LoadMenuBar}{\param{const wxString\& }{name}}

Loads a menubar from resource. Returns NULL on failure.


\membersection{wxXmlResource::LoadPanel}\label{wxxmlresourceloadpanel}

\func{wxPanel*}{LoadPanel}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}

Loads a panel. {\it panel} points to parent window (if any).

\func{bool}{LoadPanel}{\param{wxPanel* }{panel}, \param{wxWindow* }{parent}, \param{const wxString\& }{name}}

Loads a panel. {\it panel} points to parent window (if any). This form
is used to finish creation of an already existing instance.


\membersection{wxXmlResource::LoadToolBar}\label{wxxmlresourceloadtoolbar}

\func{wxToolBar*}{LoadToolBar}{\param{wxWindow* }{parent}, \param{const wxString\& }{name}}

Loads a toolbar.


\membersection{wxXmlResource::Set}\label{wxxmlresourceset}

\func{wxXmlResource*}{Set}{\param{wxXmlResource* }{res}}

Sets the global resources object and returns a pointer to the previous one (may be NULL).


\membersection{wxXmlResource::SetFlags}\label{wxxmlresourcesetflags}

\func{void}{SetFlags}{\param{int }{flags}}

Sets flags (bitlist of wxXRC\_USE\_LOCALE and wxXRC\_NO\_SUBCLASSING).


\membersection{wxXmlResource::Unload}\label{wxxmlresourceunload}

\func{bool}{Unload}{\param{const wxString\& }{filename}}

This function unloads a resource previously loaded by 
\helpref{Load()}{wxxmlresourceload}.

Returns \true if the resource was successfully unloaded and \false if it hasn't
been found in the list of loaded resources.



\membersection{wxXmlResource::GetDomain}\label{wxxmlresourcegetdomain}

\func{wxChar*}{GetDomain}{}

Returns the domain (message catalog) that will be used to load
translatable strings in the XRC.


\membersection{wxXmlResource::SetDomain}\label{wxxmlresourcesetdomain}

\func{wxChar*}{SetDomain}{\param{const wxChar* }{domain}}

Sets the domain (message catalog) that will be used to load
translatable strings in the XRC.