]> git.saurik.com Git - wxWidgets.git/blob - wxPython/contrib/xrc/xrc.py
fix text scrolling in GTK2 (patch 703988)
[wxWidgets.git] / wxPython / contrib / xrc / xrc.py
1 # This file was created automatically by SWIG.
2 import xrcc
3
4 from misc import *
5
6 from misc2 import *
7
8 from windows import *
9
10 from gdi import *
11
12 from fonts import *
13
14 from clip_dnd import *
15
16 from events import *
17
18 from streams import *
19
20 from utils import *
21
22 from mdi import *
23
24 from frames import *
25
26 from stattool import *
27
28 from controls import *
29
30 from controls2 import *
31
32 from windows2 import *
33
34 from cmndlgs import *
35
36 from windows3 import *
37
38 from image import *
39
40 from printfw import *
41
42 from sizers import *
43
44 from filesys import *
45
46 def XRCID(str_id):
47 return wxXmlResource_GetXRCID(str_id)
48
49 def XRCCTRL(window, str_id, *ignoreargs):
50 return window.FindWindowById(XRCID(str_id))
51
52 XMLID = XRCID
53 XMLCTRL = XRCCTRL
54
55 class wxXmlResourcePtr(wxObjectPtr):
56 def __init__(self,this):
57 self.this = this
58 self.thisown = 0
59 def __del__(self, delfunc=xrcc.delete_wxXmlResource):
60 if self.thisown == 1:
61 try:
62 delfunc(self)
63 except:
64 pass
65 def Load(self, *_args, **_kwargs):
66 val = xrcc.wxXmlResource_Load(self, *_args, **_kwargs)
67 return val
68 def LoadFromString(self, *_args, **_kwargs):
69 val = xrcc.wxXmlResource_LoadFromString(self, *_args, **_kwargs)
70 return val
71 def InitAllHandlers(self, *_args, **_kwargs):
72 val = xrcc.wxXmlResource_InitAllHandlers(self, *_args, **_kwargs)
73 return val
74 def AddHandler(self, *_args, **_kwargs):
75 val = xrcc.wxXmlResource_AddHandler(self, *_args, **_kwargs)
76 return val
77 def InsertHandler(self, *_args, **_kwargs):
78 val = xrcc.wxXmlResource_InsertHandler(self, *_args, **_kwargs)
79 return val
80 def ClearHandlers(self, *_args, **_kwargs):
81 val = xrcc.wxXmlResource_ClearHandlers(self, *_args, **_kwargs)
82 return val
83 def LoadMenu(self, *_args, **_kwargs):
84 val = xrcc.wxXmlResource_LoadMenu(self, *_args, **_kwargs)
85 return val
86 def LoadMenuBar(self, *_args, **_kwargs):
87 val = xrcc.wxXmlResource_LoadMenuBar(self, *_args, **_kwargs)
88 return val
89 def LoadMenuBarOnFrame(self, *_args, **_kwargs):
90 val = xrcc.wxXmlResource_LoadMenuBarOnFrame(self, *_args, **_kwargs)
91 return val
92 def LoadToolBar(self, *_args, **_kwargs):
93 val = xrcc.wxXmlResource_LoadToolBar(self, *_args, **_kwargs)
94 return val
95 def LoadDialog(self, *_args, **_kwargs):
96 val = xrcc.wxXmlResource_LoadDialog(self, *_args, **_kwargs)
97 if val: val = wxDialogPtr(val)
98 return val
99 def LoadOnDialog(self, *_args, **_kwargs):
100 val = xrcc.wxXmlResource_LoadOnDialog(self, *_args, **_kwargs)
101 return val
102 def LoadPanel(self, *_args, **_kwargs):
103 val = xrcc.wxXmlResource_LoadPanel(self, *_args, **_kwargs)
104 if val: val = wxPanelPtr(val)
105 return val
106 def LoadOnPanel(self, *_args, **_kwargs):
107 val = xrcc.wxXmlResource_LoadOnPanel(self, *_args, **_kwargs)
108 return val
109 def LoadFrame(self, *_args, **_kwargs):
110 val = xrcc.wxXmlResource_LoadFrame(self, *_args, **_kwargs)
111 return val
112 def LoadOnFrame(self, *_args, **_kwargs):
113 val = xrcc.wxXmlResource_LoadOnFrame(self, *_args, **_kwargs)
114 return val
115 def LoadObject(self, *_args, **_kwargs):
116 val = xrcc.wxXmlResource_LoadObject(self, *_args, **_kwargs)
117 return val
118 def LoadOnObject(self, *_args, **_kwargs):
119 val = xrcc.wxXmlResource_LoadOnObject(self, *_args, **_kwargs)
120 return val
121 def LoadBitmap(self, *_args, **_kwargs):
122 val = xrcc.wxXmlResource_LoadBitmap(self, *_args, **_kwargs)
123 if val: val = wxBitmapPtr(val) ; val.thisown = 1
124 return val
125 def LoadIcon(self, *_args, **_kwargs):
126 val = xrcc.wxXmlResource_LoadIcon(self, *_args, **_kwargs)
127 if val: val = wxIconPtr(val) ; val.thisown = 1
128 return val
129 def AttachUnknownControl(self, *_args, **_kwargs):
130 val = xrcc.wxXmlResource_AttachUnknownControl(self, *_args, **_kwargs)
131 return val
132 def GetVersion(self, *_args, **_kwargs):
133 val = xrcc.wxXmlResource_GetVersion(self, *_args, **_kwargs)
134 return val
135 def CompareVersion(self, *_args, **_kwargs):
136 val = xrcc.wxXmlResource_CompareVersion(self, *_args, **_kwargs)
137 return val
138 def GetFlags(self, *_args, **_kwargs):
139 val = xrcc.wxXmlResource_GetFlags(self, *_args, **_kwargs)
140 return val
141 def SetFlags(self, *_args, **_kwargs):
142 val = xrcc.wxXmlResource_SetFlags(self, *_args, **_kwargs)
143 return val
144 def __repr__(self):
145 return "<%s.%s instance; proxy of C++ wxXmlResource instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
146 class wxXmlResource(wxXmlResourcePtr):
147 def __init__(self,*_args,**_kwargs):
148 self.this = xrcc.new_wxXmlResource(*_args,**_kwargs)
149 self.thisown = 1
150 self.InitAllHandlers()
151
152
153
154 def wxEmptyXmlResource(*_args,**_kwargs):
155 val = wxXmlResourcePtr(xrcc.new_wxEmptyXmlResource(*_args,**_kwargs))
156 val.thisown = 1
157 val.InitAllHandlers()
158 return val
159
160
161 class wxXmlSubclassFactoryPtr :
162 def __init__(self,this):
163 self.this = this
164 self.thisown = 0
165 def _setCallbackInfo(self, *_args, **_kwargs):
166 val = xrcc.wxXmlSubclassFactory__setCallbackInfo(self, *_args, **_kwargs)
167 return val
168 def __repr__(self):
169 return "<%s.%s instance; proxy of C++ wxXmlSubclassFactory instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
170 class wxXmlSubclassFactory(wxXmlSubclassFactoryPtr):
171 def __init__(self,*_args,**_kwargs):
172 self.this = xrcc.new_wxXmlSubclassFactory(*_args,**_kwargs)
173 self.thisown = 1
174 self._setCallbackInfo(self, wxXmlSubclassFactory)
175
176
177
178
179 class wxXmlPropertyPtr :
180 def __init__(self,this):
181 self.this = this
182 self.thisown = 0
183 def GetName(self, *_args, **_kwargs):
184 val = xrcc.wxXmlProperty_GetName(self, *_args, **_kwargs)
185 return val
186 def GetValue(self, *_args, **_kwargs):
187 val = xrcc.wxXmlProperty_GetValue(self, *_args, **_kwargs)
188 return val
189 def GetNext(self, *_args, **_kwargs):
190 val = xrcc.wxXmlProperty_GetNext(self, *_args, **_kwargs)
191 if val: val = wxXmlPropertyPtr(val)
192 return val
193 def SetName(self, *_args, **_kwargs):
194 val = xrcc.wxXmlProperty_SetName(self, *_args, **_kwargs)
195 return val
196 def SetValue(self, *_args, **_kwargs):
197 val = xrcc.wxXmlProperty_SetValue(self, *_args, **_kwargs)
198 return val
199 def SetNext(self, *_args, **_kwargs):
200 val = xrcc.wxXmlProperty_SetNext(self, *_args, **_kwargs)
201 return val
202 def __repr__(self):
203 return "<%s.%s instance; proxy of C++ wxXmlProperty instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
204 class wxXmlProperty(wxXmlPropertyPtr):
205 def __init__(self,*_args,**_kwargs):
206 self.this = xrcc.new_wxXmlProperty(*_args,**_kwargs)
207 self.thisown = 1
208
209
210
211
212 class wxXmlNodePtr :
213 def __init__(self,this):
214 self.this = this
215 self.thisown = 0
216 def __del__(self, delfunc=xrcc.delete_wxXmlNode):
217 if self.thisown == 1:
218 try:
219 delfunc(self)
220 except:
221 pass
222 def AddChild(self, *_args, **_kwargs):
223 val = xrcc.wxXmlNode_AddChild(self, *_args, **_kwargs)
224 return val
225 def InsertChild(self, *_args, **_kwargs):
226 val = xrcc.wxXmlNode_InsertChild(self, *_args, **_kwargs)
227 return val
228 def RemoveChild(self, *_args, **_kwargs):
229 val = xrcc.wxXmlNode_RemoveChild(self, *_args, **_kwargs)
230 return val
231 def AddProperty(self, *_args, **_kwargs):
232 val = xrcc.wxXmlNode_AddProperty(self, *_args, **_kwargs)
233 return val
234 def AddPropertyName(self, *_args, **_kwargs):
235 val = xrcc.wxXmlNode_AddPropertyName(self, *_args, **_kwargs)
236 return val
237 def DeleteProperty(self, *_args, **_kwargs):
238 val = xrcc.wxXmlNode_DeleteProperty(self, *_args, **_kwargs)
239 return val
240 def GetType(self, *_args, **_kwargs):
241 val = xrcc.wxXmlNode_GetType(self, *_args, **_kwargs)
242 return val
243 def GetName(self, *_args, **_kwargs):
244 val = xrcc.wxXmlNode_GetName(self, *_args, **_kwargs)
245 return val
246 def GetContent(self, *_args, **_kwargs):
247 val = xrcc.wxXmlNode_GetContent(self, *_args, **_kwargs)
248 return val
249 def GetParent(self, *_args, **_kwargs):
250 val = xrcc.wxXmlNode_GetParent(self, *_args, **_kwargs)
251 if val: val = wxXmlNodePtr(val)
252 return val
253 def GetNext(self, *_args, **_kwargs):
254 val = xrcc.wxXmlNode_GetNext(self, *_args, **_kwargs)
255 if val: val = wxXmlNodePtr(val)
256 return val
257 def GetChildren(self, *_args, **_kwargs):
258 val = xrcc.wxXmlNode_GetChildren(self, *_args, **_kwargs)
259 if val: val = wxXmlNodePtr(val)
260 return val
261 def GetProperties(self, *_args, **_kwargs):
262 val = xrcc.wxXmlNode_GetProperties(self, *_args, **_kwargs)
263 if val: val = wxXmlPropertyPtr(val)
264 return val
265 def GetPropVal(self, *_args, **_kwargs):
266 val = xrcc.wxXmlNode_GetPropVal(self, *_args, **_kwargs)
267 return val
268 def HasProp(self, *_args, **_kwargs):
269 val = xrcc.wxXmlNode_HasProp(self, *_args, **_kwargs)
270 return val
271 def SetType(self, *_args, **_kwargs):
272 val = xrcc.wxXmlNode_SetType(self, *_args, **_kwargs)
273 return val
274 def SetName(self, *_args, **_kwargs):
275 val = xrcc.wxXmlNode_SetName(self, *_args, **_kwargs)
276 return val
277 def SetContent(self, *_args, **_kwargs):
278 val = xrcc.wxXmlNode_SetContent(self, *_args, **_kwargs)
279 return val
280 def SetParent(self, *_args, **_kwargs):
281 val = xrcc.wxXmlNode_SetParent(self, *_args, **_kwargs)
282 return val
283 def SetNext(self, *_args, **_kwargs):
284 val = xrcc.wxXmlNode_SetNext(self, *_args, **_kwargs)
285 return val
286 def SetChildren(self, *_args, **_kwargs):
287 val = xrcc.wxXmlNode_SetChildren(self, *_args, **_kwargs)
288 return val
289 def SetProperties(self, *_args, **_kwargs):
290 val = xrcc.wxXmlNode_SetProperties(self, *_args, **_kwargs)
291 return val
292 def __repr__(self):
293 return "<%s.%s instance; proxy of C++ wxXmlNode instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
294 class wxXmlNode(wxXmlNodePtr):
295 def __init__(self,*_args,**_kwargs):
296 self.this = xrcc.new_wxXmlNode(*_args,**_kwargs)
297 self.thisown = 1
298
299
300
301 def wxXmlNodeEasy(*_args,**_kwargs):
302 val = wxXmlNodePtr(xrcc.new_wxXmlNodeEasy(*_args,**_kwargs))
303 val.thisown = 1
304 return val
305
306
307 class wxXmlDocumentPtr(wxObjectPtr):
308 def __init__(self,this):
309 self.this = this
310 self.thisown = 0
311 def __del__(self, delfunc=xrcc.delete_wxXmlDocument):
312 if self.thisown == 1:
313 try:
314 delfunc(self)
315 except:
316 pass
317 def Load(self, *_args, **_kwargs):
318 val = xrcc.wxXmlDocument_Load(self, *_args, **_kwargs)
319 return val
320 def LoadFromStream(self, *_args, **_kwargs):
321 val = xrcc.wxXmlDocument_LoadFromStream(self, *_args, **_kwargs)
322 return val
323 def Save(self, *_args, **_kwargs):
324 val = xrcc.wxXmlDocument_Save(self, *_args, **_kwargs)
325 return val
326 def SaveToStream(self, *_args, **_kwargs):
327 val = xrcc.wxXmlDocument_SaveToStream(self, *_args, **_kwargs)
328 return val
329 def IsOk(self, *_args, **_kwargs):
330 val = xrcc.wxXmlDocument_IsOk(self, *_args, **_kwargs)
331 return val
332 def GetRoot(self, *_args, **_kwargs):
333 val = xrcc.wxXmlDocument_GetRoot(self, *_args, **_kwargs)
334 if val: val = wxXmlNodePtr(val)
335 return val
336 def GetVersion(self, *_args, **_kwargs):
337 val = xrcc.wxXmlDocument_GetVersion(self, *_args, **_kwargs)
338 return val
339 def GetFileEncoding(self, *_args, **_kwargs):
340 val = xrcc.wxXmlDocument_GetFileEncoding(self, *_args, **_kwargs)
341 return val
342 def SetRoot(self, *_args, **_kwargs):
343 val = xrcc.wxXmlDocument_SetRoot(self, *_args, **_kwargs)
344 return val
345 def SetVersion(self, *_args, **_kwargs):
346 val = xrcc.wxXmlDocument_SetVersion(self, *_args, **_kwargs)
347 return val
348 def SetFileEncoding(self, *_args, **_kwargs):
349 val = xrcc.wxXmlDocument_SetFileEncoding(self, *_args, **_kwargs)
350 return val
351 def GetEncoding(self, *_args, **_kwargs):
352 val = xrcc.wxXmlDocument_GetEncoding(self, *_args, **_kwargs)
353 return val
354 def SetEncoding(self, *_args, **_kwargs):
355 val = xrcc.wxXmlDocument_SetEncoding(self, *_args, **_kwargs)
356 return val
357 def __repr__(self):
358 return "<%s.%s instance; proxy of C++ wxXmlDocument instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
359 class wxXmlDocument(wxXmlDocumentPtr):
360 def __init__(self,*_args,**_kwargs):
361 self.this = xrcc.new_wxXmlDocument(*_args,**_kwargs)
362 self.thisown = 1
363
364
365
366 def wxXmlDocumentFromStream(*_args,**_kwargs):
367 val = wxXmlDocumentPtr(xrcc.new_wxXmlDocumentFromStream(*_args,**_kwargs))
368 val.thisown = 1
369 return val
370
371 def wxEmptyXmlDocument(*_args,**_kwargs):
372 val = wxXmlDocumentPtr(xrcc.new_wxEmptyXmlDocument(*_args,**_kwargs))
373 val.thisown = 1
374 return val
375
376
377 class wxXmlResourceHandlerPtr(wxObjectPtr):
378 def __init__(self,this):
379 self.this = this
380 self.thisown = 0
381 def _setCallbackInfo(self, *_args, **_kwargs):
382 val = xrcc.wxXmlResourceHandler__setCallbackInfo(self, *_args, **_kwargs)
383 return val
384 def CreateResource(self, *_args, **_kwargs):
385 val = xrcc.wxXmlResourceHandler_CreateResource(self, *_args, **_kwargs)
386 return val
387 def SetParentResource(self, *_args, **_kwargs):
388 val = xrcc.wxXmlResourceHandler_SetParentResource(self, *_args, **_kwargs)
389 return val
390 def GetResource(self, *_args, **_kwargs):
391 val = xrcc.wxXmlResourceHandler_GetResource(self, *_args, **_kwargs)
392 if val: val = wxXmlResourcePtr(val)
393 return val
394 def GetNode(self, *_args, **_kwargs):
395 val = xrcc.wxXmlResourceHandler_GetNode(self, *_args, **_kwargs)
396 if val: val = wxXmlNodePtr(val)
397 return val
398 def GetClass(self, *_args, **_kwargs):
399 val = xrcc.wxXmlResourceHandler_GetClass(self, *_args, **_kwargs)
400 return val
401 def GetParent(self, *_args, **_kwargs):
402 val = xrcc.wxXmlResourceHandler_GetParent(self, *_args, **_kwargs)
403 return val
404 def GetInstance(self, *_args, **_kwargs):
405 val = xrcc.wxXmlResourceHandler_GetInstance(self, *_args, **_kwargs)
406 return val
407 def GetParentAsWindow(self, *_args, **_kwargs):
408 val = xrcc.wxXmlResourceHandler_GetParentAsWindow(self, *_args, **_kwargs)
409 return val
410 def GetInstanceAsWindow(self, *_args, **_kwargs):
411 val = xrcc.wxXmlResourceHandler_GetInstanceAsWindow(self, *_args, **_kwargs)
412 return val
413 def IsOfClass(self, *_args, **_kwargs):
414 val = xrcc.wxXmlResourceHandler_IsOfClass(self, *_args, **_kwargs)
415 return val
416 def GetNodeContent(self, *_args, **_kwargs):
417 val = xrcc.wxXmlResourceHandler_GetNodeContent(self, *_args, **_kwargs)
418 return val
419 def HasParam(self, *_args, **_kwargs):
420 val = xrcc.wxXmlResourceHandler_HasParam(self, *_args, **_kwargs)
421 return val
422 def GetParamNode(self, *_args, **_kwargs):
423 val = xrcc.wxXmlResourceHandler_GetParamNode(self, *_args, **_kwargs)
424 if val: val = wxXmlNodePtr(val)
425 return val
426 def GetParamValue(self, *_args, **_kwargs):
427 val = xrcc.wxXmlResourceHandler_GetParamValue(self, *_args, **_kwargs)
428 return val
429 def AddStyle(self, *_args, **_kwargs):
430 val = xrcc.wxXmlResourceHandler_AddStyle(self, *_args, **_kwargs)
431 return val
432 def AddWindowStyles(self, *_args, **_kwargs):
433 val = xrcc.wxXmlResourceHandler_AddWindowStyles(self, *_args, **_kwargs)
434 return val
435 def GetStyle(self, *_args, **_kwargs):
436 val = xrcc.wxXmlResourceHandler_GetStyle(self, *_args, **_kwargs)
437 return val
438 def GetText(self, *_args, **_kwargs):
439 val = xrcc.wxXmlResourceHandler_GetText(self, *_args, **_kwargs)
440 return val
441 def GetID(self, *_args, **_kwargs):
442 val = xrcc.wxXmlResourceHandler_GetID(self, *_args, **_kwargs)
443 return val
444 def GetName(self, *_args, **_kwargs):
445 val = xrcc.wxXmlResourceHandler_GetName(self, *_args, **_kwargs)
446 return val
447 def GetBool(self, *_args, **_kwargs):
448 val = xrcc.wxXmlResourceHandler_GetBool(self, *_args, **_kwargs)
449 return val
450 def GetLong(self, *_args, **_kwargs):
451 val = xrcc.wxXmlResourceHandler_GetLong(self, *_args, **_kwargs)
452 return val
453 def GetColour(self, *_args, **_kwargs):
454 val = xrcc.wxXmlResourceHandler_GetColour(self, *_args, **_kwargs)
455 if val: val = wxColourPtr(val) ; val.thisown = 1
456 return val
457 def GetSize(self, *_args, **_kwargs):
458 val = xrcc.wxXmlResourceHandler_GetSize(self, *_args, **_kwargs)
459 if val: val = wxSizePtr(val) ; val.thisown = 1
460 return val
461 def GetPosition(self, *_args, **_kwargs):
462 val = xrcc.wxXmlResourceHandler_GetPosition(self, *_args, **_kwargs)
463 if val: val = wxPointPtr(val) ; val.thisown = 1
464 return val
465 def GetDimension(self, *_args, **_kwargs):
466 val = xrcc.wxXmlResourceHandler_GetDimension(self, *_args, **_kwargs)
467 return val
468 def GetBitmap(self, *_args, **_kwargs):
469 val = xrcc.wxXmlResourceHandler_GetBitmap(self, *_args, **_kwargs)
470 if val: val = wxBitmapPtr(val) ; val.thisown = 1
471 return val
472 def GetIcon(self, *_args, **_kwargs):
473 val = xrcc.wxXmlResourceHandler_GetIcon(self, *_args, **_kwargs)
474 if val: val = wxIconPtr(val) ; val.thisown = 1
475 return val
476 def GetFont(self, *_args, **_kwargs):
477 val = xrcc.wxXmlResourceHandler_GetFont(self, *_args, **_kwargs)
478 if val: val = wxFontPtr(val) ; val.thisown = 1
479 return val
480 def SetupWindow(self, *_args, **_kwargs):
481 val = xrcc.wxXmlResourceHandler_SetupWindow(self, *_args, **_kwargs)
482 return val
483 def CreateChildren(self, *_args, **_kwargs):
484 val = xrcc.wxXmlResourceHandler_CreateChildren(self, *_args, **_kwargs)
485 return val
486 def CreateChildrenPrivately(self, *_args, **_kwargs):
487 val = xrcc.wxXmlResourceHandler_CreateChildrenPrivately(self, *_args, **_kwargs)
488 return val
489 def CreateResFromNode(self, *_args, **_kwargs):
490 val = xrcc.wxXmlResourceHandler_CreateResFromNode(self, *_args, **_kwargs)
491 return val
492 def GetCurFileSystem(self, *_args, **_kwargs):
493 val = xrcc.wxXmlResourceHandler_GetCurFileSystem(self, *_args, **_kwargs)
494 return val
495 def __repr__(self):
496 return "<%s.%s instance; proxy of C++ wxXmlResourceHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this)
497 class wxXmlResourceHandler(wxXmlResourceHandlerPtr):
498 def __init__(self,*_args,**_kwargs):
499 self.this = xrcc.new_wxXmlResourceHandler(*_args,**_kwargs)
500 self.thisown = 1
501 self._setCallbackInfo(self, wxXmlResourceHandler)
502
503
504
505
506
507
508 #-------------- FUNCTION WRAPPERS ------------------
509
510 wxXmlResource_AddSubclassFactory = xrcc.wxXmlResource_AddSubclassFactory
511
512 wxXmlResource_GetXRCID = xrcc.wxXmlResource_GetXRCID
513
514 def wxXmlResource_Get(*_args, **_kwargs):
515 val = xrcc.wxXmlResource_Get(*_args,**_kwargs)
516 if val: val = wxXmlResourcePtr(val)
517 return val
518
519 def wxXmlResource_Set(*_args, **_kwargs):
520 val = xrcc.wxXmlResource_Set(*_args,**_kwargs)
521 if val: val = wxXmlResourcePtr(val)
522 return val
523
524
525
526 #-------------- VARIABLE WRAPPERS ------------------
527
528 wxXRC_USE_LOCALE = xrcc.wxXRC_USE_LOCALE
529 wxXRC_NO_SUBCLASSING = xrcc.wxXRC_NO_SUBCLASSING
530 wxXML_ELEMENT_NODE = xrcc.wxXML_ELEMENT_NODE
531 wxXML_ATTRIBUTE_NODE = xrcc.wxXML_ATTRIBUTE_NODE
532 wxXML_TEXT_NODE = xrcc.wxXML_TEXT_NODE
533 wxXML_CDATA_SECTION_NODE = xrcc.wxXML_CDATA_SECTION_NODE
534 wxXML_ENTITY_REF_NODE = xrcc.wxXML_ENTITY_REF_NODE
535 wxXML_ENTITY_NODE = xrcc.wxXML_ENTITY_NODE
536 wxXML_PI_NODE = xrcc.wxXML_PI_NODE
537 wxXML_COMMENT_NODE = xrcc.wxXML_COMMENT_NODE
538 wxXML_DOCUMENT_NODE = xrcc.wxXML_DOCUMENT_NODE
539 wxXML_DOCUMENT_TYPE_NODE = xrcc.wxXML_DOCUMENT_TYPE_NODE
540 wxXML_DOCUMENT_FRAG_NODE = xrcc.wxXML_DOCUMENT_FRAG_NODE
541 wxXML_NOTATION_NODE = xrcc.wxXML_NOTATION_NODE
542 wxXML_HTML_DOCUMENT_NODE = xrcc.wxXML_HTML_DOCUMENT_NODE
543
544
545 #-------------- USER INCLUDE -----------------------
546
547
548 # The global was removed in favor of static accessor functions. This is for
549 # backwards compatibility:
550 wxTheXmlResource = wxXmlResource_Get()
551
552 wx.wxXmlNodePtr = wxXmlNodePtr
553
554
555
556
557 #----------------------------------------------------------------------
558 # Create a factory for handling the subclass property of the object tag.
559
560
561 def _my_import(name):
562 mod = __import__(name)
563 components = name.split('.')
564 for comp in components[1:]:
565 mod = getattr(mod, comp)
566 return mod
567
568
569 class wxXmlSubclassFactory_Python(wxXmlSubclassFactory):
570 def __init__(self):
571 wxXmlSubclassFactory.__init__(self)
572
573 def Create(self, className):
574 assert className.find('.') != -1, "Module name must be specified!"
575 mname = className[:className.rfind('.')]
576 cname = className[className.rfind('.')+1:]
577 module = _my_import(mname)
578 klass = getattr(module, cname)
579 inst = klass()
580 return inst
581
582
583 wxXmlResource_AddSubclassFactory(wxXmlSubclassFactory_Python())
584