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