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