X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/554f62e979b12368202776c00f3ede73a822e67a..f89238b9fe8396c67b3a12a469a930c9eb6e4be6:/wxPython/src/msw/xrc.py diff --git a/wxPython/src/msw/xrc.py b/wxPython/src/msw/xrc.py index 8974874e29..5bbd09e39e 100644 --- a/wxPython/src/msw/xrc.py +++ b/wxPython/src/msw/xrc.py @@ -73,7 +73,7 @@ class XmlResource(_core.Object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr def __init__(self, *args, **kwargs): - """__init__(self, String filemask, int flags=XRC_USE_LOCALE) -> XmlResource""" + """__init__(self, String filemask, int flags=XRC_USE_LOCALE, String domain=wxEmptyString) -> XmlResource""" _xrc.XmlResource_swiginit(self,_xrc.new_XmlResource(*args, **kwargs)) self.InitAllHandlers() @@ -173,7 +173,7 @@ class XmlResource(_core.Object): return _xrc.XmlResource_AttachUnknownControl(*args, **kwargs) def GetXRCID(*args, **kwargs): - """GetXRCID(String str_id) -> int""" + """GetXRCID(String str_id, int value_if_not_found=ID_NONE) -> int""" return _xrc.XmlResource_GetXRCID(*args, **kwargs) GetXRCID = staticmethod(GetXRCID) @@ -203,8 +203,18 @@ class XmlResource(_core.Object): """SetFlags(self, int flags)""" return _xrc.XmlResource_SetFlags(*args, **kwargs) -XmlResource_swigregister = _xrc.XmlResource_swigregister -XmlResource_swigregister(XmlResource) + def GetDomain(*args, **kwargs): + """GetDomain(self) -> String""" + return _xrc.XmlResource_GetDomain(*args, **kwargs) + + def SetDomain(*args, **kwargs): + """SetDomain(self, String domain)""" + return _xrc.XmlResource_SetDomain(*args, **kwargs) + + Domain = property(GetDomain,SetDomain,doc="See `GetDomain` and `SetDomain`") + Flags = property(GetFlags,SetFlags,doc="See `GetFlags` and `SetFlags`") + Version = property(GetVersion,doc="See `GetVersion`") +_xrc.XmlResource_swigregister(XmlResource) cvar = _xrc.cvar UTF8String = cvar.UTF8String StyleString = cvar.StyleString @@ -213,9 +223,10 @@ PosString = cvar.PosString BitmapString = cvar.BitmapString IconString = cvar.IconString FontString = cvar.FontString +AnimationString = cvar.AnimationString def EmptyXmlResource(*args, **kwargs): - """EmptyXmlResource(int flags=XRC_USE_LOCALE) -> XmlResource""" + """EmptyXmlResource(int flags=XRC_USE_LOCALE, String domain=wxEmptyString) -> XmlResource""" val = _xrc.new_EmptyXmlResource(*args, **kwargs) val.InitAllHandlers() return val @@ -225,7 +236,7 @@ def XmlResource_AddSubclassFactory(*args, **kwargs): return _xrc.XmlResource_AddSubclassFactory(*args, **kwargs) def XmlResource_GetXRCID(*args, **kwargs): - """XmlResource_GetXRCID(String str_id) -> int""" + """XmlResource_GetXRCID(String str_id, int value_if_not_found=ID_NONE) -> int""" return _xrc.XmlResource_GetXRCID(*args, **kwargs) def XmlResource_Get(*args): @@ -236,8 +247,8 @@ def XmlResource_Set(*args, **kwargs): """XmlResource_Set(XmlResource res) -> XmlResource""" return _xrc.XmlResource_Set(*args, **kwargs) -def XRCID(str_id): - return XmlResource_GetXRCID(str_id) +def XRCID(str_id, value_if_not_found = wx.ID_NONE): + return XmlResource_GetXRCID(str_id, value_if_not_found) def XRCCTRL(window, str_id, *ignoreargs): return window.FindWindowById(XRCID(str_id)) @@ -257,8 +268,7 @@ class XmlSubclassFactory(object): """_setCallbackInfo(self, PyObject self, PyObject _class)""" return _xrc.XmlSubclassFactory__setCallbackInfo(*args, **kwargs) -XmlSubclassFactory_swigregister = _xrc.XmlSubclassFactory_swigregister -XmlSubclassFactory_swigregister(XmlSubclassFactory) +_xrc.XmlSubclassFactory_swigregister(XmlSubclassFactory) #--------------------------------------------------------------------------- @@ -309,8 +319,10 @@ class XmlProperty(object): """SetNext(self, XmlProperty next)""" return _xrc.XmlProperty_SetNext(*args, **kwargs) -XmlProperty_swigregister = _xrc.XmlProperty_swigregister -XmlProperty_swigregister(XmlProperty) + Name = property(GetName,SetName,doc="See `GetName` and `SetName`") + Next = property(GetNext,SetNext,doc="See `GetNext` and `SetNext`") + Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`") +_xrc.XmlProperty_swigregister(XmlProperty) class XmlNode(object): """Proxy of C++ XmlNode class""" @@ -330,7 +342,7 @@ class XmlNode(object): return _xrc.XmlNode_AddChild(*args, **kwargs) def InsertChild(*args, **kwargs): - """InsertChild(self, XmlNode child, XmlNode before_node)""" + """InsertChild(self, XmlNode child, XmlNode before_node) -> bool""" return _xrc.XmlNode_InsertChild(*args, **kwargs) def RemoveChild(*args, **kwargs): @@ -361,6 +373,18 @@ class XmlNode(object): """GetContent(self) -> String""" return _xrc.XmlNode_GetContent(*args, **kwargs) + def IsWhitespaceOnly(*args, **kwargs): + """IsWhitespaceOnly(self) -> bool""" + return _xrc.XmlNode_IsWhitespaceOnly(*args, **kwargs) + + def GetDepth(*args, **kwargs): + """GetDepth(self, XmlNode grandparent=None) -> int""" + return _xrc.XmlNode_GetDepth(*args, **kwargs) + + def GetNodeContent(*args, **kwargs): + """GetNodeContent(self) -> String""" + return _xrc.XmlNode_GetNodeContent(*args, **kwargs) + def GetParent(*args, **kwargs): """GetParent(self) -> XmlNode""" return _xrc.XmlNode_GetParent(*args, **kwargs) @@ -413,14 +437,23 @@ class XmlNode(object): """SetProperties(self, XmlProperty prop)""" return _xrc.XmlNode_SetProperties(*args, **kwargs) -XmlNode_swigregister = _xrc.XmlNode_swigregister -XmlNode_swigregister(XmlNode) + Children = property(GetChildren,SetChildren,doc="See `GetChildren` and `SetChildren`") + Content = property(GetContent,SetContent,doc="See `GetContent` and `SetContent`") + Name = property(GetName,SetName,doc="See `GetName` and `SetName`") + Next = property(GetNext,SetNext,doc="See `GetNext` and `SetNext`") + Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`") + Properties = property(GetProperties,SetProperties,doc="See `GetProperties` and `SetProperties`") + Type = property(GetType,SetType,doc="See `GetType` and `SetType`") +_xrc.XmlNode_swigregister(XmlNode) def XmlNodeEasy(*args, **kwargs): """XmlNodeEasy(int type, String name, String content=EmptyString) -> XmlNode""" val = _xrc.new_XmlNodeEasy(*args, **kwargs) return val +XML_NO_INDENTATION = _xrc.XML_NO_INDENTATION +XMLDOC_NONE = _xrc.XMLDOC_NONE +XMLDOC_KEEP_WHITESPACE_NODES = _xrc.XMLDOC_KEEP_WHITESPACE_NODES class XmlDocument(_core.Object): """Proxy of C++ XmlDocument class""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') @@ -431,19 +464,19 @@ class XmlDocument(_core.Object): __swig_destroy__ = _xrc.delete_XmlDocument __del__ = lambda self : None; def Load(*args, **kwargs): - """Load(self, String filename, String encoding=UTF8String) -> bool""" + """Load(self, String filename, String encoding=UTF8String, int flags=XMLDOC_NONE) -> bool""" return _xrc.XmlDocument_Load(*args, **kwargs) def LoadFromStream(*args, **kwargs): - """LoadFromStream(self, InputStream stream, String encoding=UTF8String) -> bool""" + """LoadFromStream(self, InputStream stream, String encoding=UTF8String, int flags=XMLDOC_NONE) -> bool""" return _xrc.XmlDocument_LoadFromStream(*args, **kwargs) def Save(*args, **kwargs): - """Save(self, String filename) -> bool""" + """Save(self, String filename, int indentstep=1) -> bool""" return _xrc.XmlDocument_Save(*args, **kwargs) def SaveToStream(*args, **kwargs): - """SaveToStream(self, OutputStream stream) -> bool""" + """SaveToStream(self, OutputStream stream, int indentstep=1) -> bool""" return _xrc.XmlDocument_SaveToStream(*args, **kwargs) def IsOk(*args, **kwargs): @@ -462,6 +495,10 @@ class XmlDocument(_core.Object): """GetFileEncoding(self) -> String""" return _xrc.XmlDocument_GetFileEncoding(*args, **kwargs) + def DetachRoot(*args, **kwargs): + """DetachRoot(self) -> XmlNode""" + return _xrc.XmlDocument_DetachRoot(*args, **kwargs) + def SetRoot(*args, **kwargs): """SetRoot(self, XmlNode node)""" return _xrc.XmlDocument_SetRoot(*args, **kwargs) @@ -474,8 +511,10 @@ class XmlDocument(_core.Object): """SetFileEncoding(self, String encoding)""" return _xrc.XmlDocument_SetFileEncoding(*args, **kwargs) -XmlDocument_swigregister = _xrc.XmlDocument_swigregister -XmlDocument_swigregister(XmlDocument) + FileEncoding = property(GetFileEncoding,SetFileEncoding,doc="See `GetFileEncoding` and `SetFileEncoding`") + Root = property(GetRoot,SetRoot,doc="See `GetRoot` and `SetRoot`") + Version = property(GetVersion,SetVersion,doc="See `GetVersion` and `SetVersion`") +_xrc.XmlDocument_swigregister(XmlDocument) def XmlDocumentFromStream(*args, **kwargs): """XmlDocumentFromStream(InputStream stream, String encoding=UTF8String) -> XmlDocument""" @@ -498,6 +537,8 @@ class XmlResourceHandler(_core.Object): _xrc.XmlResourceHandler_swiginit(self,_xrc.new_XmlResourceHandler(*args, **kwargs)) self._setCallbackInfo(self, XmlResourceHandler) + __swig_destroy__ = _xrc.delete_XmlResourceHandler + __del__ = lambda self : None; def _setCallbackInfo(*args, **kwargs): """_setCallbackInfo(self, PyObject self, PyObject _class)""" return _xrc.XmlResourceHandler__setCallbackInfo(*args, **kwargs) @@ -620,6 +661,10 @@ class XmlResourceHandler(_core.Object): """GetFont(self, String param=FontString) -> Font""" return _xrc.XmlResourceHandler_GetFont(*args, **kwargs) + def GetAnimation(*args, **kwargs): + """GetAnimation(self, String param=AnimationString) -> wxAnimation""" + return _xrc.XmlResourceHandler_GetAnimation(*args, **kwargs) + def SetupWindow(*args, **kwargs): """SetupWindow(self, Window wnd)""" return _xrc.XmlResourceHandler_SetupWindow(*args, **kwargs) @@ -640,8 +685,16 @@ class XmlResourceHandler(_core.Object): """GetCurFileSystem(self) -> FileSystem""" return _xrc.XmlResourceHandler_GetCurFileSystem(*args, **kwargs) -XmlResourceHandler_swigregister = _xrc.XmlResourceHandler_swigregister -XmlResourceHandler_swigregister(XmlResourceHandler) + Class = property(GetClass,doc="See `GetClass`") + CurFileSystem = property(GetCurFileSystem,doc="See `GetCurFileSystem`") + ID = property(GetID,doc="See `GetID`") + Instance = property(GetInstance,doc="See `GetInstance`") + Name = property(GetName,doc="See `GetName`") + Node = property(GetNode,doc="See `GetNode`") + Parent = property(GetParent,doc="See `GetParent`") + ParentAsWindow = property(GetParentAsWindow,doc="See `GetParentAsWindow`") + Resource = property(GetResource,doc="See `GetResource`") +_xrc.XmlResourceHandler_swigregister(XmlResourceHandler) #---------------------------------------------------------------------------- # The global was removed in favor of static accessor functions. This is for @@ -655,7 +708,12 @@ TheXmlResource = XmlResource_Get() def _my_import(name): - mod = __import__(name) + try: + mod = __import__(name) + except ImportError: + import traceback + print traceback.format_exc() + raise components = name.split('.') for comp in components[1:]: mod = getattr(mod, comp)