X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0dabb2a2c6ae27df135da4752b00579346bb74fc..ff006095c2cb350af9d765e9d832fc2b7944e32f:/wxPython/contrib/activex/activex.py?ds=sidebyside diff --git a/wxPython/contrib/activex/activex.py b/wxPython/contrib/activex/activex.py index 346ea8e180..dc60201f71 100644 --- a/wxPython/contrib/activex/activex.py +++ b/wxPython/contrib/activex/activex.py @@ -3,8 +3,50 @@ import _activex -import core -wx = core +def _swig_setattr_nondynamic(self,class_type,name,value,static=1): + if (name == "this"): + if isinstance(value, class_type): + self.__dict__[name] = value.this + if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown + del value.thisown + return + method = class_type.__swig_setmethods__.get(name,None) + if method: return method(self,value) + if (not static) or hasattr(self,name) or (name == "thisown"): + 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): + method = class_type.__swig_getmethods__.get(name,None) + if method: return method(self) + raise AttributeError,name + +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 hasattr(self,name) or (name in ("this", "thisown")): + 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): @@ -19,7 +61,7 @@ class CLSID(object): return "<%s.%s; proxy of C++ CLSID instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) 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 @@ -32,17 +74,17 @@ class CLSID(object): self.thisown = 1 del newobj.thisown def __del__(self, destroy=_activex.delete_CLSID): - """__del__()""" + """__del__(self)""" try: if self.thisown: destroy(self) except: pass 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() @@ -57,6 +99,7 @@ _activex.CLSID_swigregister(CLSIDPtr) #--------------------------------------------------------------------------- class ParamX(object): + """Proxy of C++ ParamX class""" 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,) @@ -83,6 +126,7 @@ class ParamXPtr(ParamX): _activex.ParamX_swigregister(ParamXPtr) class FuncX(object): + """Proxy of C++ FuncX class""" 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,) @@ -100,6 +144,7 @@ class FuncXPtr(FuncX): _activex.FuncX_swigregister(FuncXPtr) class PropX(object): + """Proxy of C++ PropX class""" 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,) @@ -121,19 +166,20 @@ class PropXPtr(PropX): _activex.PropX_swigregister(PropXPtr) class ParamXArray(object): + """Proxy of C++ ParamXArray class""" 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,) 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) @@ -145,19 +191,20 @@ class ParamXArrayPtr(ParamXArray): _activex.ParamXArray_swigregister(ParamXArrayPtr) class FuncXArray(object): + """Proxy of C++ FuncXArray class""" 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,) 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) @@ -169,19 +216,20 @@ class FuncXArrayPtr(FuncXArray): _activex.FuncXArray_swigregister(FuncXArrayPtr) class PropXArray(object): + """Proxy of C++ PropXArray class""" 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,) 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) @@ -194,7 +242,7 @@ _activex.PropXArray_swigregister(PropXArrayPtr) #--------------------------------------------------------------------------- -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 @@ -210,7 +258,7 @@ class ActiveXWindow(core.Window): return "<%s.%s; proxy of C++ wxActiveXWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) 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 @@ -225,7 +273,7 @@ class ActiveXWindow(core.Window): def GetCLSID(*args, **kwargs): """ - GetCLSID() -> CLSID + GetCLSID(self) -> CLSID Return the CLSID used to construct this ActiveX window """ @@ -233,7 +281,7 @@ class ActiveXWindow(core.Window): def GetAXEventCount(*args, **kwargs): """ - GetAXEventCount() -> int + GetAXEventCount(self) -> int Number of events defined for this control """ @@ -241,7 +289,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 +297,7 @@ class ActiveXWindow(core.Window): def GetAXPropCount(*args, **kwargs): """ - GetAXPropCount() -> int + GetAXPropCount(self) -> int Number of properties defined for this control """ @@ -257,14 +305,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 +320,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 +336,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 +345,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 +354,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 +362,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 +370,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. @@ -354,13 +402,13 @@ def RegisterActiveXEvent(*args, **kwargs): Creates a standard wx event ID for the given eventName. """ return _activex.RegisterActiveXEvent(*args, **kwargs) -class ActiveXEvent(core.CommandEvent): +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): @@ -368,11 +416,11 @@ class ActiveXEvent(core.CommandEvent): 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) @@ -393,6 +441,8 @@ class IEHtmlWindowBase(ActiveXWindow): self.this = newobj.this self.thisown = 1 del newobj.thisown + 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)