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