]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/contrib/xrc/xrc.py
Added generic LoadObject methods that can load any classtype from a
[wxWidgets.git] / wxPython / contrib / xrc / xrc.py
index aa703e2e0c1b5b156729e0b9ad7d6e4ebce3ce77..2837e83749f3f76428d5a6da0214aa1bea1267d1 100644 (file)
@@ -9,6 +9,8 @@ from windows import *
 
 from gdi import *
 
+from fonts import *
+
 from clip_dnd import *
 
 from events import *
@@ -41,12 +43,14 @@ from sizers import *
 
 from filesys import *
 
-def XMLID(str_id):
-    return wxXmlResource_GetXMLID(str_id)
+def XRCID(str_id):
+    return wxXmlResource_GetXRCID(str_id)
 
-def XMLCTRL(window, str_id, *args):
-    return window.FindWindowById(XMLID(str_id))
+def XRCCTRL(window, str_id, *ignoreargs):
+    return window.FindWindowById(XRCID(str_id))
 
+XMLID = XRCID
+XMLCTRL = XRCCTRL
 
 class wxXmlResourcePtr(wxObjectPtr):
     def __init__(self,this):
@@ -58,6 +62,9 @@ class wxXmlResourcePtr(wxObjectPtr):
     def Load(self, *_args, **_kwargs):
         val = apply(xrcc.wxXmlResource_Load,(self,) + _args, _kwargs)
         return val
+    def LoadFromString(self, *_args, **_kwargs):
+        val = apply(xrcc.wxXmlResource_LoadFromString,(self,) + _args, _kwargs)
+        return val
     def InitAllHandlers(self, *_args, **_kwargs):
         val = apply(xrcc.wxXmlResource_InitAllHandlers,(self,) + _args, _kwargs)
         return val
@@ -73,6 +80,9 @@ class wxXmlResourcePtr(wxObjectPtr):
     def LoadMenuBar(self, *_args, **_kwargs):
         val = apply(xrcc.wxXmlResource_LoadMenuBar,(self,) + _args, _kwargs)
         return val
+    def LoadMenuBarOnFrame(self, *_args, **_kwargs):
+        val = apply(xrcc.wxXmlResource_LoadMenuBarOnFrame,(self,) + _args, _kwargs)
+        return val
     def LoadToolBar(self, *_args, **_kwargs):
         val = apply(xrcc.wxXmlResource_LoadToolBar,(self,) + _args, _kwargs)
         return val
@@ -114,14 +124,16 @@ class wxXmlResourcePtr(wxObjectPtr):
         return "<C wxXmlResource instance at %s>" % (self.this,)
 class wxXmlResource(wxXmlResourcePtr):
     def __init__(self,*_args,**_kwargs):
-        self.this = apply(xrcc.new_wxXmlResourceEmpty,_args,_kwargs)
+        self.this = apply(xrcc.new_wxXmlResource,_args,_kwargs)
         self.thisown = 1
+        self.InitAllHandlers()
 
 
 
-def wxXmlResource(*_args,**_kwargs):
-    val = wxXmlResourcePtr(apply(xrcc.new_wxXmlResource,_args,_kwargs))
+def wxEmptyXmlResource(*_args,**_kwargs):
+    val = wxXmlResourcePtr(apply(xrcc.new_wxEmptyXmlResource,_args,_kwargs))
     val.thisown = 1
+    val.InitAllHandlers()
     return val
 
 
@@ -129,7 +141,7 @@ def wxXmlResource(*_args,**_kwargs):
 
 #-------------- FUNCTION WRAPPERS ------------------
 
-wxXmlResource_GetXMLID = xrcc.wxXmlResource_GetXMLID
+wxXmlResource_GetXRCID = xrcc.wxXmlResource_GetXRCID
 
 def wxXmlResource_Get(*_args, **_kwargs):
     val = apply(xrcc.wxXmlResource_Get,_args,_kwargs)