X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0dabb2a2c6ae27df135da4752b00579346bb74fc..8ec09aacc6d8a0ef8c8e3910c46258bc20f0734b:/wxPython/contrib/activex/activex.py diff --git a/wxPython/contrib/activex/activex.py b/wxPython/contrib/activex/activex.py index 346ea8e180..f5b06592ba 100644 --- a/wxPython/contrib/activex/activex.py +++ b/wxPython/contrib/activex/activex.py @@ -1,10 +1,59 @@ -# This file was created automatically by SWIG. +# This file was created automatically by SWIG 1.3.29. # Don't modify this file, modify the SWIG interface instead. import _activex - -import core -wx = core +import new +new_instancemethod = new.instancemethod +def _swig_setattr_nondynamic(self,class_type,name,value,static=1): + if (name == "thisown"): return self.this.own(value) + if (name == "this"): + if type(value).__name__ == 'PySwigObject': + self.__dict__[name] = value + return + method = class_type.__swig_setmethods__.get(name,None) + if method: return method(self,value) + if (not static) or hasattr(self,name): + self.__dict__[name] = value + else: + raise AttributeError("You cannot add attributes to %s" % self) + +def _swig_setattr(self,class_type,name,value): + return _swig_setattr_nondynamic(self,class_type,name,value,0) + +def _swig_getattr(self,class_type,name): + if (name == "thisown"): return self.this.own() + method = class_type.__swig_getmethods__.get(name,None) + if method: return method(self) + raise AttributeError,name + +def _swig_repr(self): + try: strthis = "proxy of " + self.this.__repr__() + except: strthis = "" + return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) + +import types +try: + _object = types.ObjectType + _newclass = 1 +except AttributeError: + class _object : pass + _newclass = 0 +del types + + +def _swig_setattr_nondynamic_method(set): + def set_attr(self,name,value): + if (name == "thisown"): return self.this.own(value) + if hasattr(self,name) or (name == "this"): + set(self,name,value) + else: + raise AttributeError("You cannot add attributes to %s" % self) + return set_attr + + +import _core +wx = _core +__docfilter__ = wx.__DocFilter(globals()) #--------------------------------------------------------------------------- class CLSID(object): @@ -15,11 +64,11 @@ class CLSID(object): 'WordPad.Document.1') or a classID string, (such as '{CA8A9783-280D-11CF-A24D-444553540000}'). """ - def __repr__(self): - return "<%s.%s; proxy of C++ CLSID instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) - def __init__(self, *args, **kwargs): + 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__(String id) -> CLSID + __init__(self, String id) -> CLSID This class wraps the Windows CLSID structure and is used to specify the class of the ActiveX object that is to be created. A @@ -27,39 +76,28 @@ class CLSID(object): 'WordPad.Document.1') or a classID string, (such as '{CA8A9783-280D-11CF-A24D-444553540000}'). """ - newobj = _activex.new_CLSID(*args, **kwargs) - self.this = newobj.this - self.thisown = 1 - del newobj.thisown - def __del__(self, destroy=_activex.delete_CLSID): - """__del__()""" - try: - if self.thisown: destroy(self) - except: pass - + _activex.CLSID_swiginit(self,_activex.new_CLSID(*args, **kwargs)) + __swig_destroy__ = _activex.delete_CLSID + __del__ = lambda self : None; def GetCLSIDString(*args, **kwargs): - """GetCLSIDString() -> String""" + """GetCLSIDString(self) -> String""" return _activex.CLSID_GetCLSIDString(*args, **kwargs) def GetProgIDString(*args, **kwargs): - """GetProgIDString() -> String""" + """GetProgIDString(self) -> String""" return _activex.CLSID_GetProgIDString(*args, **kwargs) def __str__(self): return self.GetCLSIDString() - -class CLSIDPtr(CLSID): - def __init__(self, this): - self.this = this - if not hasattr(self,"thisown"): self.thisown = 0 - self.__class__ = CLSID -_activex.CLSID_swigregister(CLSIDPtr) +CLSID_swigregister = _activex.CLSID_swigregister +CLSID_swigregister(CLSID) #--------------------------------------------------------------------------- class ParamX(object): - def __init__(self): raise RuntimeError, "No constructor defined" - def __repr__(self): - return "<%s.%s; proxy of C++ wxParamX instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + """Proxy of C++ ParamX class""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + def __init__(self): raise AttributeError, "No constructor defined" + __repr__ = _swig_repr flags = property(_activex.ParamX_flags_get) isPtr = property(_activex.ParamX_isPtr_get) isSafeArray = property(_activex.ParamX_isSafeArray_get) @@ -74,35 +112,27 @@ class ParamX(object): isRetVal = property(_activex.ParamX_IsRetVal) - -class ParamXPtr(ParamX): - def __init__(self, this): - self.this = this - if not hasattr(self,"thisown"): self.thisown = 0 - self.__class__ = ParamX -_activex.ParamX_swigregister(ParamXPtr) +ParamX_swigregister = _activex.ParamX_swigregister +ParamX_swigregister(ParamX) class FuncX(object): - def __init__(self): raise RuntimeError, "No constructor defined" - def __repr__(self): - return "<%s.%s; proxy of C++ wxFuncX instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + """Proxy of C++ FuncX class""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + def __init__(self): raise AttributeError, "No constructor defined" + __repr__ = _swig_repr name = property(_activex.FuncX_name_get) memid = property(_activex.FuncX_memid_get) hasOut = property(_activex.FuncX_hasOut_get) retType = property(_activex.FuncX_retType_get) params = property(_activex.FuncX_params_get) - -class FuncXPtr(FuncX): - def __init__(self, this): - self.this = this - if not hasattr(self,"thisown"): self.thisown = 0 - self.__class__ = FuncX -_activex.FuncX_swigregister(FuncXPtr) +FuncX_swigregister = _activex.FuncX_swigregister +FuncX_swigregister(FuncX) class PropX(object): - def __init__(self): raise RuntimeError, "No constructor defined" - def __repr__(self): - return "<%s.%s; proxy of C++ wxPropX instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + """Proxy of C++ PropX class""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + def __init__(self): raise AttributeError, "No constructor defined" + __repr__ = _swig_repr name = property(_activex.PropX_name_get) memid = property(_activex.PropX_memid_get) type = property(_activex.PropX_type_get) @@ -112,89 +142,72 @@ class PropX(object): canSet = property(_activex.PropX_CanSet) - -class PropXPtr(PropX): - def __init__(self, this): - self.this = this - if not hasattr(self,"thisown"): self.thisown = 0 - self.__class__ = PropX -_activex.PropX_swigregister(PropXPtr) +PropX_swigregister = _activex.PropX_swigregister +PropX_swigregister(PropX) class ParamXArray(object): - def __init__(self): raise RuntimeError, "No constructor defined" - def __repr__(self): - return "<%s.%s; proxy of C++ wxParamXArray instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + """Proxy of C++ ParamXArray class""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + def __init__(self): raise AttributeError, "No constructor defined" + __repr__ = _swig_repr def __nonzero__(*args, **kwargs): - """__nonzero__() -> bool""" + """__nonzero__(self) -> bool""" return _activex.ParamXArray___nonzero__(*args, **kwargs) def __len__(*args, **kwargs): - """__len__() -> int""" + """__len__(self) -> int""" return _activex.ParamXArray___len__(*args, **kwargs) def __getitem__(*args, **kwargs): - """__getitem__(int idx) -> ParamX""" + """__getitem__(self, int idx) -> ParamX""" return _activex.ParamXArray___getitem__(*args, **kwargs) - -class ParamXArrayPtr(ParamXArray): - def __init__(self, this): - self.this = this - if not hasattr(self,"thisown"): self.thisown = 0 - self.__class__ = ParamXArray -_activex.ParamXArray_swigregister(ParamXArrayPtr) +ParamXArray_swigregister = _activex.ParamXArray_swigregister +ParamXArray_swigregister(ParamXArray) class FuncXArray(object): - def __init__(self): raise RuntimeError, "No constructor defined" - def __repr__(self): - return "<%s.%s; proxy of C++ wxFuncXArray instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + """Proxy of C++ FuncXArray class""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + def __init__(self): raise AttributeError, "No constructor defined" + __repr__ = _swig_repr def __nonzero__(*args, **kwargs): - """__nonzero__() -> bool""" + """__nonzero__(self) -> bool""" return _activex.FuncXArray___nonzero__(*args, **kwargs) def __len__(*args, **kwargs): - """__len__() -> int""" + """__len__(self) -> int""" return _activex.FuncXArray___len__(*args, **kwargs) def __getitem__(*args, **kwargs): - """__getitem__(int idx) -> FuncX""" + """__getitem__(self, int idx) -> FuncX""" return _activex.FuncXArray___getitem__(*args, **kwargs) - -class FuncXArrayPtr(FuncXArray): - def __init__(self, this): - self.this = this - if not hasattr(self,"thisown"): self.thisown = 0 - self.__class__ = FuncXArray -_activex.FuncXArray_swigregister(FuncXArrayPtr) +FuncXArray_swigregister = _activex.FuncXArray_swigregister +FuncXArray_swigregister(FuncXArray) class PropXArray(object): - def __init__(self): raise RuntimeError, "No constructor defined" - def __repr__(self): - return "<%s.%s; proxy of C++ wxPropXArray instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + """Proxy of C++ PropXArray class""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + def __init__(self): raise AttributeError, "No constructor defined" + __repr__ = _swig_repr def __nonzero__(*args, **kwargs): - """__nonzero__() -> bool""" + """__nonzero__(self) -> bool""" return _activex.PropXArray___nonzero__(*args, **kwargs) def __len__(*args, **kwargs): - """__len__() -> int""" + """__len__(self) -> int""" return _activex.PropXArray___len__(*args, **kwargs) def __getitem__(*args, **kwargs): - """__getitem__(int idx) -> PropX""" + """__getitem__(self, int idx) -> PropX""" return _activex.PropXArray___getitem__(*args, **kwargs) - -class PropXArrayPtr(PropXArray): - def __init__(self, this): - self.this = this - if not hasattr(self,"thisown"): self.thisown = 0 - self.__class__ = PropXArray -_activex.PropXArray_swigregister(PropXArrayPtr) +PropXArray_swigregister = _activex.PropXArray_swigregister +PropXArray_swigregister(PropXArray) #--------------------------------------------------------------------------- -class ActiveXWindow(core.Window): +class ActiveXWindow(_core.Window): """ ActiveXWindow derives from wxWindow and the constructor accepts a CLSID for the ActiveX Control that should be created. The @@ -206,26 +219,23 @@ class ActiveXWindow(core.Window): specified by the TypeInfo. """ - def __repr__(self): - return "<%s.%s; proxy of C++ wxActiveXWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) - def __init__(self, *args, **kwargs): + 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__(Window parent, CLSID clsId, int id=-1, Point pos=DefaultPosition, + __init__(self, Window parent, CLSID clsId, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, String name=PanelNameStr) -> ActiveXWindow Creates an ActiveX control from the clsID given and makes it act as much like a regular wx.Window as possible. """ - newobj = _activex.new_ActiveXWindow(*args, **kwargs) - self.this = newobj.this - self.thisown = 1 - del newobj.thisown + _activex.ActiveXWindow_swiginit(self,_activex.new_ActiveXWindow(*args, **kwargs)) self._setOORInfo(self) def GetCLSID(*args, **kwargs): """ - GetCLSID() -> CLSID + GetCLSID(self) -> CLSID Return the CLSID used to construct this ActiveX window """ @@ -233,7 +243,7 @@ class ActiveXWindow(core.Window): def GetAXEventCount(*args, **kwargs): """ - GetAXEventCount() -> int + GetAXEventCount(self) -> int Number of events defined for this control """ @@ -241,7 +251,7 @@ class ActiveXWindow(core.Window): def GetAXEventDesc(*args, **kwargs): """ - GetAXEventDesc(int idx) -> FuncX + GetAXEventDesc(self, int idx) -> FuncX Returns event description by index """ @@ -249,7 +259,7 @@ class ActiveXWindow(core.Window): def GetAXPropCount(*args, **kwargs): """ - GetAXPropCount() -> int + GetAXPropCount(self) -> int Number of properties defined for this control """ @@ -257,14 +267,14 @@ class ActiveXWindow(core.Window): def GetAXPropDesc(*args): """ - GetAXPropDesc(int idx) -> PropX - GetAXPropDesc(String name) -> PropX + GetAXPropDesc(self, int idx) -> PropX + GetAXPropDesc(self, String name) -> PropX """ return _activex.ActiveXWindow_GetAXPropDesc(*args) def GetAXMethodCount(*args, **kwargs): """ - GetAXMethodCount() -> int + GetAXMethodCount(self) -> int Number of methods defined for this control """ @@ -272,14 +282,14 @@ class ActiveXWindow(core.Window): def GetAXMethodDesc(*args): """ - GetAXMethodDesc(int idx) -> FuncX - GetAXMethodDesc(String name) -> FuncX + GetAXMethodDesc(self, int idx) -> FuncX + GetAXMethodDesc(self, String name) -> FuncX """ return _activex.ActiveXWindow_GetAXMethodDesc(*args) def GetAXEvents(*args, **kwargs): """ - GetAXEvents() -> FuncXArray + GetAXEvents(self) -> FuncXArray Returns a sequence of FuncX objects describing the events available for this ActiveX object. @@ -288,7 +298,7 @@ class ActiveXWindow(core.Window): def GetAXMethods(*args, **kwargs): """ - GetAXMethods() -> FuncXArray + GetAXMethods(self) -> FuncXArray Returns a sequence of FuncX objects describing the methods available for this ActiveX object. @@ -297,7 +307,7 @@ class ActiveXWindow(core.Window): def GetAXProperties(*args, **kwargs): """ - GetAXProperties() -> PropXArray + GetAXProperties(self) -> PropXArray Returns a sequence of PropX objects describing the properties available for this ActiveX object. @@ -306,7 +316,7 @@ class ActiveXWindow(core.Window): def SetAXProp(*args, **kwargs): """ - SetAXProp(String name, PyObject value) + SetAXProp(self, String name, PyObject value) Set a property of the ActiveX object by name. """ @@ -314,7 +324,7 @@ class ActiveXWindow(core.Window): def GetAXProp(*args, **kwargs): """ - GetAXProp(String name) -> PyObject + GetAXProp(self, String name) -> PyObject Get the value of an ActiveX property by name. """ @@ -322,7 +332,7 @@ class ActiveXWindow(core.Window): def _CallAXMethod(*args): """ - _CallAXMethod(String name, PyObject args) -> PyObject + _CallAXMethod(self, String name, PyObject args) -> PyObject The implementation for CallMethod. Calls an ActiveX method, by name passing the parameters given in args. @@ -336,75 +346,59 @@ class ActiveXWindow(core.Window): """ return self._CallAXMethod(name, args) - -class ActiveXWindowPtr(ActiveXWindow): - def __init__(self, this): - self.this = this - if not hasattr(self,"thisown"): self.thisown = 0 - self.__class__ = ActiveXWindow -_activex.ActiveXWindow_swigregister(ActiveXWindowPtr) +ActiveXWindow_swigregister = _activex.ActiveXWindow_swigregister +ActiveXWindow_swigregister(ActiveXWindow) #--------------------------------------------------------------------------- def RegisterActiveXEvent(*args, **kwargs): - """ + """ RegisterActiveXEvent(String eventName) -> wxEventType Creates a standard wx event ID for the given eventName. """ - return _activex.RegisterActiveXEvent(*args, **kwargs) -class ActiveXEvent(core.CommandEvent): + return _activex.RegisterActiveXEvent(*args, **kwargs) +class ActiveXEvent(_core.CommandEvent): """ An instance of ActiveXEvent is sent to the handler for all bound ActiveX events. Any event parameters from the ActiveX cntrol are turned into attributes of the Python proxy for this event object. Additionally, there is a property called eventName that will - return (suprizingly ) the name of the ActiveX event. + return (surprisingly ) the name of the ActiveX event. """ - def __init__(self): raise RuntimeError, "No constructor defined" - def __repr__(self): - return "<%s.%s; proxy of C++ wxActiveXEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') + def __init__(self): raise AttributeError, "No constructor defined" + __repr__ = _swig_repr eventName = property(_activex.ActiveXEvent_EventName) def _preCallInit(*args, **kwargs): - """_preCallInit(PyObject pyself)""" + """_preCallInit(self, PyObject pyself)""" return _activex.ActiveXEvent__preCallInit(*args, **kwargs) def _postCallCleanup(*args, **kwargs): - """_postCallCleanup(PyObject pyself)""" + """_postCallCleanup(self, PyObject pyself)""" return _activex.ActiveXEvent__postCallCleanup(*args, **kwargs) - -class ActiveXEventPtr(ActiveXEvent): - def __init__(self, this): - self.this = this - if not hasattr(self,"thisown"): self.thisown = 0 - self.__class__ = ActiveXEvent -_activex.ActiveXEvent_swigregister(ActiveXEventPtr) +ActiveXEvent_swigregister = _activex.ActiveXEvent_swigregister +ActiveXEvent_swigregister(ActiveXEvent) #--------------------------------------------------------------------------- class IEHtmlWindowBase(ActiveXWindow): - def __repr__(self): - return "<%s.%s; proxy of C++ wxIEHtmlWindowBase instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) - def __init__(self, *args, **kwargs): - newobj = _activex.new_IEHtmlWindowBase(*args, **kwargs) - self.this = newobj.this - self.thisown = 1 - del newobj.thisown + 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): + _activex.IEHtmlWindowBase_swiginit(self,_activex.new_IEHtmlWindowBase(*args, **kwargs)) + self._setOORInfo(self) + def SetCharset(*args, **kwargs): return _activex.IEHtmlWindowBase_SetCharset(*args, **kwargs) def LoadString(*args, **kwargs): return _activex.IEHtmlWindowBase_LoadString(*args, **kwargs) def LoadStream(*args, **kwargs): return _activex.IEHtmlWindowBase_LoadStream(*args, **kwargs) def GetStringSelection(*args, **kwargs): return _activex.IEHtmlWindowBase_GetStringSelection(*args, **kwargs) def GetText(*args, **kwargs): return _activex.IEHtmlWindowBase_GetText(*args, **kwargs) - -class IEHtmlWindowBasePtr(IEHtmlWindowBase): - def __init__(self, this): - self.this = this - if not hasattr(self,"thisown"): self.thisown = 0 - self.__class__ = IEHtmlWindowBase -_activex.IEHtmlWindowBase_swigregister(IEHtmlWindowBasePtr) +IEHtmlWindowBase_swigregister = _activex.IEHtmlWindowBase_swigregister +IEHtmlWindowBase_swigregister(IEHtmlWindowBase) #--------------------------------------------------------------------------- # Some helper and utility functions for ActiveX @@ -617,3 +611,4 @@ class %s(wx.activex.ActiveXWindow): #--------------------------------------------------------------------------- +