1wxXmlResource(3) Erlang Module Definition wxXmlResource(3)
2
3
4
6 wxXmlResource - Functions for wxXmlResource class
7
9 This is the main class for interacting with the XML-based resource sys‐
10 tem.
11
12 The class holds XML resources from one or more .xml files, binary files
13 or zip archive files.
14
15 Note that this is a singleton class and you'll never allocate/deallo‐
16 cate it. Just use the static get/0 getter.
17
18 See: Overview xrc, Overview xrcformat
19
20 wxWidgets docs: wxXmlResource
21
23 wxXmlResource() = wx:wx_object()
24
26 new() -> wxXmlResource()
27
28 new(Options :: [Option]) -> wxXmlResource()
29
30 Types:
31
32 Option = {flags, integer()} | {domain, unicode:chardata()}
33
34 Constructor.
35
36 new(Filemask, Options :: [Option]) -> wxXmlResource()
37
38 Types:
39
40 Filemask = unicode:chardata()
41 Option = {flags, integer()} | {domain, unicode:chardata()}
42
43 Constructor.
44
45 destroy(This :: wxXmlResource()) -> ok
46
47 Destructor.
48
49 attachUnknownControl(This, Name, Control) -> boolean()
50
51 Types:
52
53 This = wxXmlResource()
54 Name = unicode:chardata()
55 Control = wxWindow:wxWindow()
56
57 attachUnknownControl(This, Name, Control, Options :: [Option]) ->
58 boolean()
59
60 Types:
61
62 This = wxXmlResource()
63 Name = unicode:chardata()
64 Control = wxWindow:wxWindow()
65 Option = {parent, wxWindow:wxWindow()}
66
67 Attaches an unknown control to the given panel/window/dialog.
68
69 Unknown controls are used in conjunction with <object class="un‐
70 known">.
71
72 clearHandlers(This) -> ok
73
74 Types:
75
76 This = wxXmlResource()
77
78 Removes all handlers and deletes them (this means that any han‐
79 dlers added using AddHandler() (not implemented in wx) must be
80 allocated on the heap).
81
82 compareVersion(This, Major, Minor, Release, Revision) -> integer()
83
84 Types:
85
86 This = wxXmlResource()
87 Major = Minor = Release = Revision = integer()
88
89 Compares the XRC version to the argument.
90
91 Returns -1 if the XRC version is less than the argument, +1 if
92 greater, and 0 if they are equal.
93
94 get() -> wxXmlResource()
95
96 Gets the global resources object or creates one if none exists.
97
98 getFlags(This) -> integer()
99
100 Types:
101
102 This = wxXmlResource()
103
104 Returns flags, which may be a bitlist of ?wxXmlResourceFlags
105 enumeration values.
106
107 getVersion(This) -> integer()
108
109 Types:
110
111 This = wxXmlResource()
112
113 Returns version information (a.b.c.d = d + 256*c + 2562*b +
114 2563*a).
115
116 getXRCID(Str_id) -> integer()
117
118 Types:
119
120 Str_id = unicode:chardata()
121
122 getXRCID(Str_id, Options :: [Option]) -> integer()
123
124 Types:
125
126 Str_id = unicode:chardata()
127 Option = {value_if_not_found, integer()}
128
129 Returns a numeric ID that is equivalent to the string ID used in
130 an XML resource.
131
132 If an unknown str_id is requested (i.e. other than wxID_XXX or
133 integer), a new record is created which associates the given
134 string with a number.
135
136 If value_if_not_found is wxID_NONE, the number is obtained via
137 wx_misc:newId/0. Otherwise value_if_not_found is used.
138
139 Macro XRCID(name) is provided for convenient use in event ta‐
140 bles.
141
142 Note: IDs returned by XRCID() cannot be used with the
143 EVT_*_RANGE macros, because the order in which they are assigned
144 to symbolic name values is not guaranteed.
145
146 initAllHandlers(This) -> ok
147
148 Types:
149
150 This = wxXmlResource()
151
152 Initializes handlers for all supported controls/windows.
153
154 This will make the executable quite big because it forces link‐
155 ing against most of the wxWidgets library.
156
157 load(This, Filemask) -> boolean()
158
159 Types:
160
161 This = wxXmlResource()
162 Filemask = unicode:chardata()
163
164 Loads resources from XML files that match given filemask.
165
166 Example:
167
168 Note: If wxUSE_FILESYS is enabled, this method understands wx‐
169 FileSystem (not implemented in wx) URLs (see wxFileSystem::Find‐
170 First() (not implemented in wx)).
171
172 Note: If you are sure that the argument is name of single XRC
173 file (rather than an URL or a wildcard), use LoadFile() (not im‐
174 plemented in wx) instead.
175
176 See: LoadFile() (not implemented in wx), LoadAllFiles() (not im‐
177 plemented in wx)
178
179 loadBitmap(This, Name) -> wxBitmap:wxBitmap()
180
181 Types:
182
183 This = wxXmlResource()
184 Name = unicode:chardata()
185
186 Loads a bitmap resource from a file.
187
188 loadDialog(This, Parent, Name) -> wxDialog:wxDialog()
189
190 Types:
191
192 This = wxXmlResource()
193 Parent = wxWindow:wxWindow()
194 Name = unicode:chardata()
195
196 Loads a dialog.
197
198 parent points to parent window (if any).
199
200 loadDialog(This, Dlg, Parent, Name) -> boolean()
201
202 Types:
203
204 This = wxXmlResource()
205 Dlg = wxDialog:wxDialog()
206 Parent = wxWindow:wxWindow()
207 Name = unicode:chardata()
208
209 Loads a dialog.
210
211 parent points to parent window (if any).
212
213 This form is used to finish creation of an already existing in‐
214 stance (the main reason for this is that you may want to use de‐
215 rived class with a new event table). Example:
216
217 loadFrame(This, Parent, Name) -> wxFrame:wxFrame()
218
219 Types:
220
221 This = wxXmlResource()
222 Parent = wxWindow:wxWindow()
223 Name = unicode:chardata()
224
225 Loads a frame from the resource.
226
227 parent points to parent window (if any).
228
229 loadFrame(This, Frame, Parent, Name) -> boolean()
230
231 Types:
232
233 This = wxXmlResource()
234 Frame = wxFrame:wxFrame()
235 Parent = wxWindow:wxWindow()
236 Name = unicode:chardata()
237
238 Loads the contents of a frame onto an existing wxFrame.
239
240 This form is used to finish creation of an already existing in‐
241 stance (the main reason for this is that you may want to use de‐
242 rived class with a new event table).
243
244 loadIcon(This, Name) -> wxIcon:wxIcon()
245
246 Types:
247
248 This = wxXmlResource()
249 Name = unicode:chardata()
250
251 Loads an icon resource from a file.
252
253 loadMenu(This, Name) -> wxMenu:wxMenu()
254
255 Types:
256
257 This = wxXmlResource()
258 Name = unicode:chardata()
259
260 Loads menu from resource.
261
262 Returns NULL on failure.
263
264 loadMenuBar(This, Name) -> wxMenuBar:wxMenuBar()
265
266 Types:
267
268 This = wxXmlResource()
269 Name = unicode:chardata()
270
271 loadMenuBar(This, Parent, Name) -> wxMenuBar:wxMenuBar()
272
273 Types:
274
275 This = wxXmlResource()
276 Parent = wxWindow:wxWindow()
277 Name = unicode:chardata()
278
279 Loads a menubar from resource.
280
281 Returns NULL on failure.
282
283 loadPanel(This, Parent, Name) -> wxPanel:wxPanel()
284
285 Types:
286
287 This = wxXmlResource()
288 Parent = wxWindow:wxWindow()
289 Name = unicode:chardata()
290
291 Loads a panel.
292
293 parent points to the parent window.
294
295 loadPanel(This, Panel, Parent, Name) -> boolean()
296
297 Types:
298
299 This = wxXmlResource()
300 Panel = wxPanel:wxPanel()
301 Parent = wxWindow:wxWindow()
302 Name = unicode:chardata()
303
304 Loads a panel.
305
306 parent points to the parent window. This form is used to finish
307 creation of an already existing instance.
308
309 loadToolBar(This, Parent, Name) -> wxToolBar:wxToolBar()
310
311 Types:
312
313 This = wxXmlResource()
314 Parent = wxWindow:wxWindow()
315 Name = unicode:chardata()
316
317 Loads a toolbar.
318
319 set(Res) -> wxXmlResource()
320
321 Types:
322
323 Res = wxXmlResource()
324
325 Sets the global resources object and returns a pointer to the
326 previous one (may be NULL).
327
328 setFlags(This, Flags) -> ok
329
330 Types:
331
332 This = wxXmlResource()
333 Flags = integer()
334
335 Sets flags (bitlist of ?wxXmlResourceFlags enumeration values).
336
337 unload(This, Filename) -> boolean()
338
339 Types:
340
341 This = wxXmlResource()
342 Filename = unicode:chardata()
343
344 This function unloads a resource previously loaded by load/2.
345
346 Returns true if the resource was successfully unloaded and false
347 if it hasn't been found in the list of loaded resources.
348
349 xrcctrl(Window, Name, Type) -> wx:wx_object()
350
351 Types:
352
353 Window = wxWindow:wxWindow()
354 Name = string()
355 Type = atom()
356
357 Looks up a control.
358
359 Get a control with Name in a window created with XML resources.
360 You can use it to set/get values from controls. The object is
361 type casted to Type. Example:
362
363
364
365wxWidgets team. wx 2.1.4 wxXmlResource(3)