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