]>
Commit | Line | Data |
---|---|---|
d56cebe7 | 1 | # This file was created automatically by SWIG. |
d14a1e28 RD |
2 | # Don't modify this file, modify the SWIG interface instead. |
3 | ||
4 | import _xrc | |
5 | ||
6 | import core | |
7 | wx = core | |
8 | #--------------------------------------------------------------------------- | |
9 | ||
10 | WX_XMLRES_CURRENT_VERSION_MAJOR = _xrc.WX_XMLRES_CURRENT_VERSION_MAJOR | |
11 | WX_XMLRES_CURRENT_VERSION_MINOR = _xrc.WX_XMLRES_CURRENT_VERSION_MINOR | |
12 | WX_XMLRES_CURRENT_VERSION_RELEASE = _xrc.WX_XMLRES_CURRENT_VERSION_RELEASE | |
13 | WX_XMLRES_CURRENT_VERSION_REVISION = _xrc.WX_XMLRES_CURRENT_VERSION_REVISION | |
14 | XRC_USE_LOCALE = _xrc.XRC_USE_LOCALE | |
15 | XRC_NO_SUBCLASSING = _xrc.XRC_NO_SUBCLASSING | |
16 | class XmlResource(core.Object): | |
e811c8ce RD |
17 | def __repr__(self): |
18 | return "<%s.%s; proxy of C++ wxXmlResource instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 19 | def __init__(self, *args, **kwargs): |
196addbf | 20 | """__init__(String filemask, int flags=XRC_USE_LOCALE) -> XmlResource""" |
d14a1e28 RD |
21 | newobj = _xrc.new_XmlResource(*args, **kwargs) |
22 | self.this = newobj.this | |
23 | self.thisown = 1 | |
24 | del newobj.thisown | |
25 | self.InitAllHandlers() | |
e811c8ce | 26 | |
d14a1e28 | 27 | def __del__(self, destroy=_xrc.delete_XmlResource): |
e811c8ce | 28 | """__del__()""" |
d14a1e28 RD |
29 | try: |
30 | if self.thisown: destroy(self) | |
31 | except: pass | |
e811c8ce RD |
32 | |
33 | def Load(*args, **kwargs): | |
196addbf | 34 | """Load(String filemask) -> bool""" |
e811c8ce RD |
35 | return _xrc.XmlResource_Load(*args, **kwargs) |
36 | ||
37 | def LoadFromString(*args, **kwargs): | |
196addbf | 38 | """LoadFromString(String data) -> bool""" |
e811c8ce RD |
39 | return _xrc.XmlResource_LoadFromString(*args, **kwargs) |
40 | ||
41 | def InitAllHandlers(*args, **kwargs): | |
42 | """InitAllHandlers()""" | |
43 | return _xrc.XmlResource_InitAllHandlers(*args, **kwargs) | |
44 | ||
45 | def AddHandler(*args, **kwargs): | |
46 | """AddHandler(XmlResourceHandler handler)""" | |
47 | return _xrc.XmlResource_AddHandler(*args, **kwargs) | |
48 | ||
49 | def InsertHandler(*args, **kwargs): | |
50 | """InsertHandler(XmlResourceHandler handler)""" | |
51 | return _xrc.XmlResource_InsertHandler(*args, **kwargs) | |
52 | ||
53 | def ClearHandlers(*args, **kwargs): | |
54 | """ClearHandlers()""" | |
55 | return _xrc.XmlResource_ClearHandlers(*args, **kwargs) | |
56 | ||
57 | def AddSubclassFactory(*args, **kwargs): | |
58 | """XmlResource.AddSubclassFactory(XmlSubclassFactory factory)""" | |
59 | return _xrc.XmlResource_AddSubclassFactory(*args, **kwargs) | |
60 | ||
61 | AddSubclassFactory = staticmethod(AddSubclassFactory) | |
62 | def LoadMenu(*args, **kwargs): | |
196addbf | 63 | """LoadMenu(String name) -> Menu""" |
e811c8ce RD |
64 | return _xrc.XmlResource_LoadMenu(*args, **kwargs) |
65 | ||
66 | def LoadMenuBar(*args, **kwargs): | |
196addbf | 67 | """LoadMenuBar(String name) -> MenuBar""" |
e811c8ce RD |
68 | return _xrc.XmlResource_LoadMenuBar(*args, **kwargs) |
69 | ||
70 | def LoadMenuBarOnFrame(*args, **kwargs): | |
196addbf | 71 | """LoadMenuBarOnFrame(Window parent, String name) -> MenuBar""" |
e811c8ce RD |
72 | return _xrc.XmlResource_LoadMenuBarOnFrame(*args, **kwargs) |
73 | ||
74 | def LoadToolBar(*args, **kwargs): | |
196addbf | 75 | """LoadToolBar(Window parent, String name) -> wxToolBar""" |
e811c8ce RD |
76 | return _xrc.XmlResource_LoadToolBar(*args, **kwargs) |
77 | ||
78 | def LoadDialog(*args, **kwargs): | |
196addbf | 79 | """LoadDialog(Window parent, String name) -> wxDialog""" |
e811c8ce RD |
80 | return _xrc.XmlResource_LoadDialog(*args, **kwargs) |
81 | ||
82 | def LoadOnDialog(*args, **kwargs): | |
196addbf | 83 | """LoadOnDialog(wxDialog dlg, Window parent, String name) -> bool""" |
e811c8ce RD |
84 | return _xrc.XmlResource_LoadOnDialog(*args, **kwargs) |
85 | ||
86 | def LoadPanel(*args, **kwargs): | |
196addbf | 87 | """LoadPanel(Window parent, String name) -> wxPanel""" |
e811c8ce RD |
88 | return _xrc.XmlResource_LoadPanel(*args, **kwargs) |
89 | ||
90 | def LoadOnPanel(*args, **kwargs): | |
196addbf | 91 | """LoadOnPanel(wxPanel panel, Window parent, String name) -> bool""" |
e811c8ce RD |
92 | return _xrc.XmlResource_LoadOnPanel(*args, **kwargs) |
93 | ||
94 | def LoadFrame(*args, **kwargs): | |
196addbf | 95 | """LoadFrame(Window parent, String name) -> wxFrame""" |
e811c8ce RD |
96 | return _xrc.XmlResource_LoadFrame(*args, **kwargs) |
97 | ||
98 | def LoadOnFrame(*args, **kwargs): | |
196addbf | 99 | """LoadOnFrame(wxFrame frame, Window parent, String name) -> bool""" |
e811c8ce RD |
100 | return _xrc.XmlResource_LoadOnFrame(*args, **kwargs) |
101 | ||
102 | def LoadObject(*args, **kwargs): | |
196addbf | 103 | """LoadObject(Window parent, String name, String classname) -> Object""" |
e811c8ce RD |
104 | return _xrc.XmlResource_LoadObject(*args, **kwargs) |
105 | ||
106 | def LoadOnObject(*args, **kwargs): | |
196addbf | 107 | """LoadOnObject(Object instance, Window parent, String name, String classname) -> bool""" |
e811c8ce RD |
108 | return _xrc.XmlResource_LoadOnObject(*args, **kwargs) |
109 | ||
110 | def LoadBitmap(*args, **kwargs): | |
196addbf | 111 | """LoadBitmap(String name) -> Bitmap""" |
e811c8ce RD |
112 | return _xrc.XmlResource_LoadBitmap(*args, **kwargs) |
113 | ||
114 | def LoadIcon(*args, **kwargs): | |
196addbf | 115 | """LoadIcon(String name) -> wxIcon""" |
e811c8ce RD |
116 | return _xrc.XmlResource_LoadIcon(*args, **kwargs) |
117 | ||
118 | def AttachUnknownControl(*args, **kwargs): | |
196addbf | 119 | """AttachUnknownControl(String name, Window control, Window parent=None) -> bool""" |
e811c8ce RD |
120 | return _xrc.XmlResource_AttachUnknownControl(*args, **kwargs) |
121 | ||
122 | def GetXRCID(*args, **kwargs): | |
196addbf | 123 | """XmlResource.GetXRCID(String str_id) -> int""" |
e811c8ce RD |
124 | return _xrc.XmlResource_GetXRCID(*args, **kwargs) |
125 | ||
126 | GetXRCID = staticmethod(GetXRCID) | |
127 | def GetVersion(*args, **kwargs): | |
128 | """GetVersion() -> long""" | |
129 | return _xrc.XmlResource_GetVersion(*args, **kwargs) | |
130 | ||
131 | def CompareVersion(*args, **kwargs): | |
132 | """CompareVersion(int major, int minor, int release, int revision) -> int""" | |
133 | return _xrc.XmlResource_CompareVersion(*args, **kwargs) | |
134 | ||
135 | def Get(*args, **kwargs): | |
136 | """XmlResource.Get() -> XmlResource""" | |
137 | return _xrc.XmlResource_Get(*args, **kwargs) | |
138 | ||
139 | Get = staticmethod(Get) | |
140 | def Set(*args, **kwargs): | |
141 | """XmlResource.Set(XmlResource res) -> XmlResource""" | |
142 | return _xrc.XmlResource_Set(*args, **kwargs) | |
143 | ||
144 | Set = staticmethod(Set) | |
145 | def GetFlags(*args, **kwargs): | |
146 | """GetFlags() -> int""" | |
147 | return _xrc.XmlResource_GetFlags(*args, **kwargs) | |
148 | ||
149 | def SetFlags(*args, **kwargs): | |
150 | """SetFlags(int flags)""" | |
151 | return _xrc.XmlResource_SetFlags(*args, **kwargs) | |
152 | ||
d56cebe7 | 153 | |
d14a1e28 RD |
154 | class XmlResourcePtr(XmlResource): |
155 | def __init__(self, this): | |
156 | self.this = this | |
157 | if not hasattr(self,"thisown"): self.thisown = 0 | |
158 | self.__class__ = XmlResource | |
159 | _xrc.XmlResource_swigregister(XmlResourcePtr) | |
d56cebe7 | 160 | |
d14a1e28 | 161 | def EmptyXmlResource(*args, **kwargs): |
e811c8ce | 162 | """EmptyXmlResource(int flags=XRC_USE_LOCALE) -> XmlResource""" |
d14a1e28 RD |
163 | val = _xrc.new_EmptyXmlResource(*args, **kwargs) |
164 | val.thisown = 1 | |
165 | val.InitAllHandlers() | |
166 | return val | |
d56cebe7 | 167 | |
e811c8ce RD |
168 | def XmlResource_AddSubclassFactory(*args, **kwargs): |
169 | """XmlResource_AddSubclassFactory(XmlSubclassFactory factory)""" | |
170 | return _xrc.XmlResource_AddSubclassFactory(*args, **kwargs) | |
d56cebe7 | 171 | |
e811c8ce | 172 | def XmlResource_GetXRCID(*args, **kwargs): |
196addbf | 173 | """XmlResource_GetXRCID(String str_id) -> int""" |
e811c8ce | 174 | return _xrc.XmlResource_GetXRCID(*args, **kwargs) |
d56cebe7 | 175 | |
e811c8ce RD |
176 | def XmlResource_Get(*args, **kwargs): |
177 | """XmlResource_Get() -> XmlResource""" | |
178 | return _xrc.XmlResource_Get(*args, **kwargs) | |
d56cebe7 | 179 | |
e811c8ce RD |
180 | def XmlResource_Set(*args, **kwargs): |
181 | """XmlResource_Set(XmlResource res) -> XmlResource""" | |
182 | return _xrc.XmlResource_Set(*args, **kwargs) | |
d56cebe7 | 183 | |
c6c593e8 | 184 | def XRCID(str_id): |
e811c8ce | 185 | return XmlResource_GetXRCID(str_id) |
d56cebe7 | 186 | |
c6c593e8 RD |
187 | def XRCCTRL(window, str_id, *ignoreargs): |
188 | return window.FindWindowById(XRCID(str_id)) | |
d56cebe7 | 189 | |
d14a1e28 | 190 | #--------------------------------------------------------------------------- |
d56cebe7 | 191 | |
d14a1e28 | 192 | class XmlSubclassFactory(object): |
e811c8ce RD |
193 | def __repr__(self): |
194 | return "<%s.%s; proxy of C++ wxPyXmlSubclassFactory instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 195 | def __init__(self, *args, **kwargs): |
e811c8ce | 196 | """__init__() -> XmlSubclassFactory""" |
d14a1e28 RD |
197 | newobj = _xrc.new_XmlSubclassFactory(*args, **kwargs) |
198 | self.this = newobj.this | |
d56cebe7 | 199 | self.thisown = 1 |
d14a1e28 RD |
200 | del newobj.thisown |
201 | self._setCallbackInfo(self, XmlSubclassFactory) | |
e811c8ce RD |
202 | |
203 | def _setCallbackInfo(*args, **kwargs): | |
204 | """_setCallbackInfo(PyObject self, PyObject _class)""" | |
205 | return _xrc.XmlSubclassFactory__setCallbackInfo(*args, **kwargs) | |
206 | ||
1e4a197e | 207 | |
d14a1e28 RD |
208 | class XmlSubclassFactoryPtr(XmlSubclassFactory): |
209 | def __init__(self, this): | |
628c7f79 | 210 | self.this = this |
d14a1e28 RD |
211 | if not hasattr(self,"thisown"): self.thisown = 0 |
212 | self.__class__ = XmlSubclassFactory | |
213 | _xrc.XmlSubclassFactory_swigregister(XmlSubclassFactoryPtr) | |
214 | ||
215 | #--------------------------------------------------------------------------- | |
216 | ||
217 | XML_ELEMENT_NODE = _xrc.XML_ELEMENT_NODE | |
218 | XML_ATTRIBUTE_NODE = _xrc.XML_ATTRIBUTE_NODE | |
219 | XML_TEXT_NODE = _xrc.XML_TEXT_NODE | |
220 | XML_CDATA_SECTION_NODE = _xrc.XML_CDATA_SECTION_NODE | |
221 | XML_ENTITY_REF_NODE = _xrc.XML_ENTITY_REF_NODE | |
222 | XML_ENTITY_NODE = _xrc.XML_ENTITY_NODE | |
223 | XML_PI_NODE = _xrc.XML_PI_NODE | |
224 | XML_COMMENT_NODE = _xrc.XML_COMMENT_NODE | |
225 | XML_DOCUMENT_NODE = _xrc.XML_DOCUMENT_NODE | |
226 | XML_DOCUMENT_TYPE_NODE = _xrc.XML_DOCUMENT_TYPE_NODE | |
227 | XML_DOCUMENT_FRAG_NODE = _xrc.XML_DOCUMENT_FRAG_NODE | |
228 | XML_NOTATION_NODE = _xrc.XML_NOTATION_NODE | |
229 | XML_HTML_DOCUMENT_NODE = _xrc.XML_HTML_DOCUMENT_NODE | |
230 | class XmlProperty(object): | |
e811c8ce RD |
231 | def __repr__(self): |
232 | return "<%s.%s; proxy of C++ wxXmlProperty instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 233 | def __init__(self, *args, **kwargs): |
0df68c9f | 234 | """ |
196addbf | 235 | __init__(String name=EmptyString, String value=EmptyString, |
0df68c9f RD |
236 | XmlProperty next=None) -> XmlProperty |
237 | """ | |
d14a1e28 RD |
238 | newobj = _xrc.new_XmlProperty(*args, **kwargs) |
239 | self.this = newobj.this | |
628c7f79 | 240 | self.thisown = 1 |
d14a1e28 | 241 | del newobj.thisown |
e811c8ce | 242 | def GetName(*args, **kwargs): |
196addbf | 243 | """GetName() -> String""" |
e811c8ce RD |
244 | return _xrc.XmlProperty_GetName(*args, **kwargs) |
245 | ||
246 | def GetValue(*args, **kwargs): | |
196addbf | 247 | """GetValue() -> String""" |
e811c8ce RD |
248 | return _xrc.XmlProperty_GetValue(*args, **kwargs) |
249 | ||
250 | def GetNext(*args, **kwargs): | |
251 | """GetNext() -> XmlProperty""" | |
252 | return _xrc.XmlProperty_GetNext(*args, **kwargs) | |
253 | ||
254 | def SetName(*args, **kwargs): | |
196addbf | 255 | """SetName(String name)""" |
e811c8ce RD |
256 | return _xrc.XmlProperty_SetName(*args, **kwargs) |
257 | ||
258 | def SetValue(*args, **kwargs): | |
196addbf | 259 | """SetValue(String value)""" |
e811c8ce RD |
260 | return _xrc.XmlProperty_SetValue(*args, **kwargs) |
261 | ||
262 | def SetNext(*args, **kwargs): | |
263 | """SetNext(XmlProperty next)""" | |
264 | return _xrc.XmlProperty_SetNext(*args, **kwargs) | |
265 | ||
628c7f79 | 266 | |
d14a1e28 RD |
267 | class XmlPropertyPtr(XmlProperty): |
268 | def __init__(self, this): | |
628c7f79 | 269 | self.this = this |
d14a1e28 RD |
270 | if not hasattr(self,"thisown"): self.thisown = 0 |
271 | self.__class__ = XmlProperty | |
272 | _xrc.XmlProperty_swigregister(XmlPropertyPtr) | |
273 | ||
274 | class XmlNode(object): | |
e811c8ce RD |
275 | def __repr__(self): |
276 | return "<%s.%s; proxy of C++ wxXmlNode instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 277 | def __init__(self, *args, **kwargs): |
0df68c9f | 278 | """ |
196addbf RD |
279 | __init__(XmlNode parent=None, int type=0, String name=EmptyString, |
280 | String content=EmptyString, XmlProperty props=None, | |
281 | XmlNode next=None) -> XmlNode | |
0df68c9f | 282 | """ |
d14a1e28 RD |
283 | newobj = _xrc.new_XmlNode(*args, **kwargs) |
284 | self.this = newobj.this | |
628c7f79 | 285 | self.thisown = 1 |
d14a1e28 RD |
286 | del newobj.thisown |
287 | def __del__(self, destroy=_xrc.delete_XmlNode): | |
e811c8ce | 288 | """__del__()""" |
d14a1e28 RD |
289 | try: |
290 | if self.thisown: destroy(self) | |
291 | except: pass | |
e811c8ce RD |
292 | |
293 | def AddChild(*args, **kwargs): | |
294 | """AddChild(XmlNode child)""" | |
295 | return _xrc.XmlNode_AddChild(*args, **kwargs) | |
296 | ||
297 | def InsertChild(*args, **kwargs): | |
298 | """InsertChild(XmlNode child, XmlNode before_node)""" | |
299 | return _xrc.XmlNode_InsertChild(*args, **kwargs) | |
300 | ||
301 | def RemoveChild(*args, **kwargs): | |
302 | """RemoveChild(XmlNode child) -> bool""" | |
303 | return _xrc.XmlNode_RemoveChild(*args, **kwargs) | |
304 | ||
305 | def AddProperty(*args, **kwargs): | |
306 | """AddProperty(XmlProperty prop)""" | |
307 | return _xrc.XmlNode_AddProperty(*args, **kwargs) | |
308 | ||
309 | def AddPropertyName(*args, **kwargs): | |
196addbf | 310 | """AddPropertyName(String name, String value)""" |
e811c8ce RD |
311 | return _xrc.XmlNode_AddPropertyName(*args, **kwargs) |
312 | ||
313 | def DeleteProperty(*args, **kwargs): | |
196addbf | 314 | """DeleteProperty(String name) -> bool""" |
e811c8ce RD |
315 | return _xrc.XmlNode_DeleteProperty(*args, **kwargs) |
316 | ||
317 | def GetType(*args, **kwargs): | |
196addbf | 318 | """GetType() -> int""" |
e811c8ce RD |
319 | return _xrc.XmlNode_GetType(*args, **kwargs) |
320 | ||
321 | def GetName(*args, **kwargs): | |
196addbf | 322 | """GetName() -> String""" |
e811c8ce RD |
323 | return _xrc.XmlNode_GetName(*args, **kwargs) |
324 | ||
325 | def GetContent(*args, **kwargs): | |
196addbf | 326 | """GetContent() -> String""" |
e811c8ce RD |
327 | return _xrc.XmlNode_GetContent(*args, **kwargs) |
328 | ||
329 | def GetParent(*args, **kwargs): | |
330 | """GetParent() -> XmlNode""" | |
331 | return _xrc.XmlNode_GetParent(*args, **kwargs) | |
332 | ||
333 | def GetNext(*args, **kwargs): | |
334 | """GetNext() -> XmlNode""" | |
335 | return _xrc.XmlNode_GetNext(*args, **kwargs) | |
336 | ||
337 | def GetChildren(*args, **kwargs): | |
338 | """GetChildren() -> XmlNode""" | |
339 | return _xrc.XmlNode_GetChildren(*args, **kwargs) | |
340 | ||
341 | def GetProperties(*args, **kwargs): | |
342 | """GetProperties() -> XmlProperty""" | |
343 | return _xrc.XmlNode_GetProperties(*args, **kwargs) | |
344 | ||
345 | def GetPropVal(*args, **kwargs): | |
196addbf | 346 | """GetPropVal(String propName, String defaultVal) -> String""" |
e811c8ce RD |
347 | return _xrc.XmlNode_GetPropVal(*args, **kwargs) |
348 | ||
349 | def HasProp(*args, **kwargs): | |
196addbf | 350 | """HasProp(String propName) -> bool""" |
e811c8ce RD |
351 | return _xrc.XmlNode_HasProp(*args, **kwargs) |
352 | ||
353 | def SetType(*args, **kwargs): | |
196addbf | 354 | """SetType(int type)""" |
e811c8ce RD |
355 | return _xrc.XmlNode_SetType(*args, **kwargs) |
356 | ||
357 | def SetName(*args, **kwargs): | |
196addbf | 358 | """SetName(String name)""" |
e811c8ce RD |
359 | return _xrc.XmlNode_SetName(*args, **kwargs) |
360 | ||
361 | def SetContent(*args, **kwargs): | |
196addbf | 362 | """SetContent(String con)""" |
e811c8ce RD |
363 | return _xrc.XmlNode_SetContent(*args, **kwargs) |
364 | ||
365 | def SetParent(*args, **kwargs): | |
366 | """SetParent(XmlNode parent)""" | |
367 | return _xrc.XmlNode_SetParent(*args, **kwargs) | |
368 | ||
369 | def SetNext(*args, **kwargs): | |
370 | """SetNext(XmlNode next)""" | |
371 | return _xrc.XmlNode_SetNext(*args, **kwargs) | |
372 | ||
373 | def SetChildren(*args, **kwargs): | |
374 | """SetChildren(XmlNode child)""" | |
375 | return _xrc.XmlNode_SetChildren(*args, **kwargs) | |
376 | ||
377 | def SetProperties(*args, **kwargs): | |
378 | """SetProperties(XmlProperty prop)""" | |
379 | return _xrc.XmlNode_SetProperties(*args, **kwargs) | |
380 | ||
628c7f79 | 381 | |
d14a1e28 RD |
382 | class XmlNodePtr(XmlNode): |
383 | def __init__(self, this): | |
384 | self.this = this | |
385 | if not hasattr(self,"thisown"): self.thisown = 0 | |
386 | self.__class__ = XmlNode | |
387 | _xrc.XmlNode_swigregister(XmlNodePtr) | |
628c7f79 | 388 | |
d14a1e28 | 389 | def XmlNodeEasy(*args, **kwargs): |
196addbf | 390 | """XmlNodeEasy(int type, String name, String content=EmptyString) -> XmlNode""" |
d14a1e28 | 391 | val = _xrc.new_XmlNodeEasy(*args, **kwargs) |
628c7f79 RD |
392 | val.thisown = 1 |
393 | return val | |
394 | ||
d14a1e28 | 395 | class XmlDocument(core.Object): |
e811c8ce RD |
396 | def __repr__(self): |
397 | return "<%s.%s; proxy of C++ wxXmlDocument instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 398 | def __init__(self, *args, **kwargs): |
196addbf | 399 | """__init__(String filename, String encoding=wxPyUTF8String) -> XmlDocument""" |
d14a1e28 RD |
400 | newobj = _xrc.new_XmlDocument(*args, **kwargs) |
401 | self.this = newobj.this | |
628c7f79 | 402 | self.thisown = 1 |
d14a1e28 RD |
403 | del newobj.thisown |
404 | def __del__(self, destroy=_xrc.delete_XmlDocument): | |
e811c8ce | 405 | """__del__()""" |
d14a1e28 RD |
406 | try: |
407 | if self.thisown: destroy(self) | |
408 | except: pass | |
e811c8ce RD |
409 | |
410 | def Load(*args, **kwargs): | |
196addbf | 411 | """Load(String filename, String encoding=wxPyUTF8String) -> bool""" |
e811c8ce RD |
412 | return _xrc.XmlDocument_Load(*args, **kwargs) |
413 | ||
414 | def LoadFromStream(*args, **kwargs): | |
196addbf | 415 | """LoadFromStream(InputStream stream, String encoding=wxPyUTF8String) -> bool""" |
e811c8ce RD |
416 | return _xrc.XmlDocument_LoadFromStream(*args, **kwargs) |
417 | ||
418 | def Save(*args, **kwargs): | |
196addbf | 419 | """Save(String filename) -> bool""" |
e811c8ce RD |
420 | return _xrc.XmlDocument_Save(*args, **kwargs) |
421 | ||
422 | def SaveToStream(*args, **kwargs): | |
423 | """SaveToStream(OutputStream stream) -> bool""" | |
424 | return _xrc.XmlDocument_SaveToStream(*args, **kwargs) | |
425 | ||
426 | def IsOk(*args, **kwargs): | |
427 | """IsOk() -> bool""" | |
428 | return _xrc.XmlDocument_IsOk(*args, **kwargs) | |
429 | ||
430 | def GetRoot(*args, **kwargs): | |
431 | """GetRoot() -> XmlNode""" | |
432 | return _xrc.XmlDocument_GetRoot(*args, **kwargs) | |
433 | ||
434 | def GetVersion(*args, **kwargs): | |
196addbf | 435 | """GetVersion() -> String""" |
e811c8ce RD |
436 | return _xrc.XmlDocument_GetVersion(*args, **kwargs) |
437 | ||
438 | def GetFileEncoding(*args, **kwargs): | |
196addbf | 439 | """GetFileEncoding() -> String""" |
e811c8ce RD |
440 | return _xrc.XmlDocument_GetFileEncoding(*args, **kwargs) |
441 | ||
442 | def SetRoot(*args, **kwargs): | |
443 | """SetRoot(XmlNode node)""" | |
444 | return _xrc.XmlDocument_SetRoot(*args, **kwargs) | |
445 | ||
446 | def SetVersion(*args, **kwargs): | |
196addbf | 447 | """SetVersion(String version)""" |
e811c8ce RD |
448 | return _xrc.XmlDocument_SetVersion(*args, **kwargs) |
449 | ||
450 | def SetFileEncoding(*args, **kwargs): | |
196addbf | 451 | """SetFileEncoding(String encoding)""" |
e811c8ce RD |
452 | return _xrc.XmlDocument_SetFileEncoding(*args, **kwargs) |
453 | ||
628c7f79 | 454 | |
d14a1e28 RD |
455 | class XmlDocumentPtr(XmlDocument): |
456 | def __init__(self, this): | |
457 | self.this = this | |
458 | if not hasattr(self,"thisown"): self.thisown = 0 | |
459 | self.__class__ = XmlDocument | |
460 | _xrc.XmlDocument_swigregister(XmlDocumentPtr) | |
628c7f79 | 461 | |
d14a1e28 | 462 | def XmlDocumentFromStream(*args, **kwargs): |
196addbf | 463 | """XmlDocumentFromStream(InputStream stream, String encoding=wxPyUTF8String) -> XmlDocument""" |
d14a1e28 | 464 | val = _xrc.new_XmlDocumentFromStream(*args, **kwargs) |
628c7f79 RD |
465 | val.thisown = 1 |
466 | return val | |
467 | ||
d14a1e28 | 468 | def EmptyXmlDocument(*args, **kwargs): |
e811c8ce | 469 | """EmptyXmlDocument() -> XmlDocument""" |
d14a1e28 | 470 | val = _xrc.new_EmptyXmlDocument(*args, **kwargs) |
628c7f79 RD |
471 | val.thisown = 1 |
472 | return val | |
473 | ||
d14a1e28 | 474 | #--------------------------------------------------------------------------- |
628c7f79 | 475 | |
d14a1e28 | 476 | class XmlResourceHandler(core.Object): |
e811c8ce RD |
477 | def __repr__(self): |
478 | return "<%s.%s; proxy of C++ wxPyXmlResourceHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 479 | def __init__(self, *args, **kwargs): |
e811c8ce | 480 | """__init__() -> XmlResourceHandler""" |
d14a1e28 RD |
481 | newobj = _xrc.new_XmlResourceHandler(*args, **kwargs) |
482 | self.this = newobj.this | |
628c7f79 | 483 | self.thisown = 1 |
d14a1e28 RD |
484 | del newobj.thisown |
485 | self._setCallbackInfo(self, XmlResourceHandler) | |
e811c8ce RD |
486 | |
487 | def _setCallbackInfo(*args, **kwargs): | |
488 | """_setCallbackInfo(PyObject self, PyObject _class)""" | |
489 | return _xrc.XmlResourceHandler__setCallbackInfo(*args, **kwargs) | |
490 | ||
491 | def CreateResource(*args, **kwargs): | |
492 | """CreateResource(XmlNode node, Object parent, Object instance) -> Object""" | |
493 | return _xrc.XmlResourceHandler_CreateResource(*args, **kwargs) | |
494 | ||
495 | def SetParentResource(*args, **kwargs): | |
496 | """SetParentResource(XmlResource res)""" | |
497 | return _xrc.XmlResourceHandler_SetParentResource(*args, **kwargs) | |
498 | ||
499 | def GetResource(*args, **kwargs): | |
500 | """GetResource() -> XmlResource""" | |
501 | return _xrc.XmlResourceHandler_GetResource(*args, **kwargs) | |
502 | ||
503 | def GetNode(*args, **kwargs): | |
504 | """GetNode() -> XmlNode""" | |
505 | return _xrc.XmlResourceHandler_GetNode(*args, **kwargs) | |
506 | ||
507 | def GetClass(*args, **kwargs): | |
196addbf | 508 | """GetClass() -> String""" |
e811c8ce RD |
509 | return _xrc.XmlResourceHandler_GetClass(*args, **kwargs) |
510 | ||
511 | def GetParent(*args, **kwargs): | |
512 | """GetParent() -> Object""" | |
513 | return _xrc.XmlResourceHandler_GetParent(*args, **kwargs) | |
514 | ||
515 | def GetInstance(*args, **kwargs): | |
516 | """GetInstance() -> Object""" | |
517 | return _xrc.XmlResourceHandler_GetInstance(*args, **kwargs) | |
518 | ||
519 | def GetParentAsWindow(*args, **kwargs): | |
520 | """GetParentAsWindow() -> Window""" | |
521 | return _xrc.XmlResourceHandler_GetParentAsWindow(*args, **kwargs) | |
522 | ||
523 | def GetInstanceAsWindow(*args, **kwargs): | |
524 | """GetInstanceAsWindow() -> Window""" | |
525 | return _xrc.XmlResourceHandler_GetInstanceAsWindow(*args, **kwargs) | |
526 | ||
527 | def IsOfClass(*args, **kwargs): | |
196addbf | 528 | """IsOfClass(XmlNode node, String classname) -> bool""" |
e811c8ce RD |
529 | return _xrc.XmlResourceHandler_IsOfClass(*args, **kwargs) |
530 | ||
531 | def GetNodeContent(*args, **kwargs): | |
196addbf | 532 | """GetNodeContent(XmlNode node) -> String""" |
e811c8ce RD |
533 | return _xrc.XmlResourceHandler_GetNodeContent(*args, **kwargs) |
534 | ||
535 | def HasParam(*args, **kwargs): | |
196addbf | 536 | """HasParam(String param) -> bool""" |
e811c8ce RD |
537 | return _xrc.XmlResourceHandler_HasParam(*args, **kwargs) |
538 | ||
539 | def GetParamNode(*args, **kwargs): | |
196addbf | 540 | """GetParamNode(String param) -> XmlNode""" |
e811c8ce RD |
541 | return _xrc.XmlResourceHandler_GetParamNode(*args, **kwargs) |
542 | ||
543 | def GetParamValue(*args, **kwargs): | |
196addbf | 544 | """GetParamValue(String param) -> String""" |
e811c8ce RD |
545 | return _xrc.XmlResourceHandler_GetParamValue(*args, **kwargs) |
546 | ||
547 | def AddStyle(*args, **kwargs): | |
196addbf | 548 | """AddStyle(String name, int value)""" |
e811c8ce RD |
549 | return _xrc.XmlResourceHandler_AddStyle(*args, **kwargs) |
550 | ||
551 | def AddWindowStyles(*args, **kwargs): | |
552 | """AddWindowStyles()""" | |
553 | return _xrc.XmlResourceHandler_AddWindowStyles(*args, **kwargs) | |
554 | ||
555 | def GetStyle(*args, **kwargs): | |
196addbf | 556 | """GetStyle(String param=wxPyStyleString, int defaults=0) -> int""" |
e811c8ce RD |
557 | return _xrc.XmlResourceHandler_GetStyle(*args, **kwargs) |
558 | ||
559 | def GetText(*args, **kwargs): | |
196addbf | 560 | """GetText(String param, bool translate=True) -> String""" |
e811c8ce RD |
561 | return _xrc.XmlResourceHandler_GetText(*args, **kwargs) |
562 | ||
563 | def GetID(*args, **kwargs): | |
564 | """GetID() -> int""" | |
565 | return _xrc.XmlResourceHandler_GetID(*args, **kwargs) | |
566 | ||
567 | def GetName(*args, **kwargs): | |
196addbf | 568 | """GetName() -> String""" |
e811c8ce RD |
569 | return _xrc.XmlResourceHandler_GetName(*args, **kwargs) |
570 | ||
571 | def GetBool(*args, **kwargs): | |
196addbf | 572 | """GetBool(String param, bool defaultv=False) -> bool""" |
e811c8ce RD |
573 | return _xrc.XmlResourceHandler_GetBool(*args, **kwargs) |
574 | ||
575 | def GetLong(*args, **kwargs): | |
196addbf | 576 | """GetLong(String param, long defaultv=0) -> long""" |
e811c8ce RD |
577 | return _xrc.XmlResourceHandler_GetLong(*args, **kwargs) |
578 | ||
579 | def GetColour(*args, **kwargs): | |
196addbf | 580 | """GetColour(String param) -> Colour""" |
e811c8ce RD |
581 | return _xrc.XmlResourceHandler_GetColour(*args, **kwargs) |
582 | ||
583 | def GetSize(*args, **kwargs): | |
196addbf | 584 | """GetSize(String param=wxPySizeString) -> Size""" |
e811c8ce RD |
585 | return _xrc.XmlResourceHandler_GetSize(*args, **kwargs) |
586 | ||
587 | def GetPosition(*args, **kwargs): | |
196addbf | 588 | """GetPosition(String param=wxPyPosString) -> Point""" |
e811c8ce RD |
589 | return _xrc.XmlResourceHandler_GetPosition(*args, **kwargs) |
590 | ||
591 | def GetDimension(*args, **kwargs): | |
196addbf | 592 | """GetDimension(String param, int defaultv=0) -> int""" |
e811c8ce RD |
593 | return _xrc.XmlResourceHandler_GetDimension(*args, **kwargs) |
594 | ||
595 | def GetBitmap(*args, **kwargs): | |
0df68c9f | 596 | """ |
196addbf RD |
597 | GetBitmap(String param=wxPyBitmapString, wxArtClient defaultArtClient=wxART_OTHER, |
598 | Size size=DefaultSize) -> Bitmap | |
0df68c9f | 599 | """ |
e811c8ce RD |
600 | return _xrc.XmlResourceHandler_GetBitmap(*args, **kwargs) |
601 | ||
602 | def GetIcon(*args, **kwargs): | |
0df68c9f | 603 | """ |
196addbf | 604 | GetIcon(String param=wxPyIconString, wxArtClient defaultArtClient=wxART_OTHER, |
0df68c9f RD |
605 | Size size=DefaultSize) -> wxIcon |
606 | """ | |
e811c8ce RD |
607 | return _xrc.XmlResourceHandler_GetIcon(*args, **kwargs) |
608 | ||
609 | def GetFont(*args, **kwargs): | |
196addbf | 610 | """GetFont(String param=wxPyFontString) -> Font""" |
e811c8ce RD |
611 | return _xrc.XmlResourceHandler_GetFont(*args, **kwargs) |
612 | ||
613 | def SetupWindow(*args, **kwargs): | |
614 | """SetupWindow(Window wnd)""" | |
615 | return _xrc.XmlResourceHandler_SetupWindow(*args, **kwargs) | |
616 | ||
617 | def CreateChildren(*args, **kwargs): | |
618 | """CreateChildren(Object parent, bool this_hnd_only=False)""" | |
619 | return _xrc.XmlResourceHandler_CreateChildren(*args, **kwargs) | |
620 | ||
621 | def CreateChildrenPrivately(*args, **kwargs): | |
622 | """CreateChildrenPrivately(Object parent, XmlNode rootnode=None)""" | |
623 | return _xrc.XmlResourceHandler_CreateChildrenPrivately(*args, **kwargs) | |
624 | ||
625 | def CreateResFromNode(*args, **kwargs): | |
626 | """CreateResFromNode(XmlNode node, Object parent, Object instance=None) -> Object""" | |
627 | return _xrc.XmlResourceHandler_CreateResFromNode(*args, **kwargs) | |
628 | ||
629 | def GetCurFileSystem(*args, **kwargs): | |
630 | """GetCurFileSystem() -> FileSystem""" | |
631 | return _xrc.XmlResourceHandler_GetCurFileSystem(*args, **kwargs) | |
632 | ||
ce914f73 | 633 | |
d14a1e28 RD |
634 | class XmlResourceHandlerPtr(XmlResourceHandler): |
635 | def __init__(self, this): | |
636 | self.this = this | |
637 | if not hasattr(self,"thisown"): self.thisown = 0 | |
638 | self.__class__ = XmlResourceHandler | |
639 | _xrc.XmlResourceHandler_swigregister(XmlResourceHandlerPtr) | |
ce914f73 | 640 | |
d14a1e28 | 641 | #---------------------------------------------------------------------------- |
ce914f73 RD |
642 | # The global was removed in favor of static accessor functions. This is for |
643 | # backwards compatibility: | |
628c7f79 | 644 | |
d14a1e28 | 645 | TheXmlResource = XmlResource_Get() |
1e4a197e RD |
646 | |
647 | ||
d14a1e28 | 648 | #---------------------------------------------------------------------------- |
1e4a197e RD |
649 | # Create a factory for handling the subclass property of the object tag. |
650 | ||
651 | ||
652 | def _my_import(name): | |
653 | mod = __import__(name) | |
654 | components = name.split('.') | |
655 | for comp in components[1:]: | |
656 | mod = getattr(mod, comp) | |
657 | return mod | |
658 | ||
659 | ||
d14a1e28 | 660 | class XmlSubclassFactory_Python(XmlSubclassFactory): |
1e4a197e | 661 | def __init__(self): |
d14a1e28 | 662 | XmlSubclassFactory.__init__(self) |
1e4a197e RD |
663 | |
664 | def Create(self, className): | |
665 | assert className.find('.') != -1, "Module name must be specified!" | |
666 | mname = className[:className.rfind('.')] | |
667 | cname = className[className.rfind('.')+1:] | |
668 | module = _my_import(mname) | |
669 | klass = getattr(module, cname) | |
670 | inst = klass() | |
671 | return inst | |
672 | ||
673 | ||
d14a1e28 RD |
674 | XmlResource_AddSubclassFactory(XmlSubclassFactory_Python()) |
675 | ||
676 | #---------------------------------------------------------------------------- | |
677 | ||
1e4a197e | 678 |