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