X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bc29c5e0e116edd9552cf023711b13e3495bcfaf..85bc0351f76f6d3f00460a167fc108b900e0725c:/utils/wxPython/src/gtk/misc.py?ds=sidebyside diff --git a/utils/wxPython/src/gtk/misc.py b/utils/wxPython/src/gtk/misc.py index c5066c288e..6632857793 100644 --- a/utils/wxPython/src/gtk/misc.py +++ b/utils/wxPython/src/gtk/misc.py @@ -196,6 +196,18 @@ class wxRectPtr : def GetRight(self, *_args, **_kwargs): val = apply(miscc.wxRect_GetRight,(self,) + _args, _kwargs) return val + def SetLeft(self, *_args, **_kwargs): + val = apply(miscc.wxRect_SetLeft,(self,) + _args, _kwargs) + return val + def SetRight(self, *_args, **_kwargs): + val = apply(miscc.wxRect_SetRight,(self,) + _args, _kwargs) + return val + def SetTop(self, *_args, **_kwargs): + val = apply(miscc.wxRect_SetTop,(self,) + _args, _kwargs) + return val + def SetBottom(self, *_args, **_kwargs): + val = apply(miscc.wxRect_SetBottom,(self,) + _args, _kwargs) + return val def asTuple(self, *_args, **_kwargs): val = apply(miscc.wxRect_asTuple,(self,) + _args, _kwargs) return val @@ -227,6 +239,44 @@ class wxRectPtr : return "" % (self.this,) def __str__(self): return str(self.asTuple()) def __repr__(self): return str(self.asTuple()) + + # override the __getattr__ made by SWIG + def __getattr__(self, name): + d = { + 'x' : miscc.wxRect_x_get, + 'y' : miscc.wxRect_y_get, + 'width' : miscc.wxRect_width_get, + 'height' : miscc.wxRect_height_get, + 'top' : miscc.wxRect_GetTop, + 'bottom' : miscc.wxRect_GetBottom, + 'left' : miscc.wxRect_GetLeft, + 'right' : miscc.wxRect_GetRight, + } + try: + func = d[name] + except KeyError: + raise AttributeError,name + return func(self) + + # and also the __setattr__ + def __setattr__(self, name, value): + d = { + 'x' : miscc.wxRect_x_set, + 'y' : miscc.wxRect_y_set, + 'width' : miscc.wxRect_width_set, + 'height' : miscc.wxRect_height_set, + 'top' : miscc.wxRect_SetTop, + 'bottom' : miscc.wxRect_SetBottom, + 'left' : miscc.wxRect_SetLeft, + 'right' : miscc.wxRect_SetRight, + } + try: + func = d[name] + except KeyError: + self.__dict__[name] = value + return + func(self, value) + class wxRect(wxRectPtr): def __init__(self,*_args,**_kwargs): self.this = apply(miscc.new_wxRect,_args,_kwargs) @@ -242,8 +292,11 @@ class wxPyTimerPtr : def __del__(self,miscc=miscc): if self.thisown == 1 : miscc.delete_wxPyTimer(self) - def Interval(self, *_args, **_kwargs): - val = apply(miscc.wxPyTimer_Interval,(self,) + _args, _kwargs) + def GetInterval(self, *_args, **_kwargs): + val = apply(miscc.wxPyTimer_GetInterval,(self,) + _args, _kwargs) + return val + def IsOneShot(self, *_args, **_kwargs): + val = apply(miscc.wxPyTimer_IsOneShot,(self,) + _args, _kwargs) return val def Start(self, *_args, **_kwargs): val = apply(miscc.wxPyTimer_Start,(self,) + _args, _kwargs) @@ -381,6 +434,9 @@ class wxRegionPtr : def ContainsRect(self, *_args, **_kwargs): val = apply(miscc.wxRegion_ContainsRect,(self,) + _args, _kwargs) return val + def ContainsRectDim(self, *_args, **_kwargs): + val = apply(miscc.wxRegion_ContainsRectDim,(self,) + _args, _kwargs) + return val def GetBox(self, *_args, **_kwargs): val = apply(miscc.wxRegion_GetBox,(self,) + _args, _kwargs) if val: val = wxRectPtr(val) ; val.thisown = 1 @@ -388,18 +444,42 @@ class wxRegionPtr : def Intersect(self, *_args, **_kwargs): val = apply(miscc.wxRegion_Intersect,(self,) + _args, _kwargs) return val + def IntersectRect(self, *_args, **_kwargs): + val = apply(miscc.wxRegion_IntersectRect,(self,) + _args, _kwargs) + return val + def IntersectRegion(self, *_args, **_kwargs): + val = apply(miscc.wxRegion_IntersectRegion,(self,) + _args, _kwargs) + return val def IsEmpty(self, *_args, **_kwargs): val = apply(miscc.wxRegion_IsEmpty,(self,) + _args, _kwargs) return val + def Union(self, *_args, **_kwargs): + val = apply(miscc.wxRegion_Union,(self,) + _args, _kwargs) + return val + def UnionRect(self, *_args, **_kwargs): + val = apply(miscc.wxRegion_UnionRect,(self,) + _args, _kwargs) + return val + def UnionRegion(self, *_args, **_kwargs): + val = apply(miscc.wxRegion_UnionRegion,(self,) + _args, _kwargs) + return val def Subtract(self, *_args, **_kwargs): val = apply(miscc.wxRegion_Subtract,(self,) + _args, _kwargs) return val - def Union(self, *_args, **_kwargs): - val = apply(miscc.wxRegion_Union,(self,) + _args, _kwargs) + def SubtractRect(self, *_args, **_kwargs): + val = apply(miscc.wxRegion_SubtractRect,(self,) + _args, _kwargs) + return val + def SubtractRegion(self, *_args, **_kwargs): + val = apply(miscc.wxRegion_SubtractRegion,(self,) + _args, _kwargs) return val def Xor(self, *_args, **_kwargs): val = apply(miscc.wxRegion_Xor,(self,) + _args, _kwargs) return val + def XorRect(self, *_args, **_kwargs): + val = apply(miscc.wxRegion_XorRect,(self,) + _args, _kwargs) + return val + def XorRegion(self, *_args, **_kwargs): + val = apply(miscc.wxRegion_XorRegion,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxRegion(wxRegionPtr): @@ -504,10 +584,29 @@ class wxAcceleratorTable(wxAcceleratorTablePtr): +class wxBusyInfoPtr : + def __init__(self,this): + self.this = this + self.thisown = 0 + def __del__(self,miscc=miscc): + if self.thisown == 1 : + miscc.delete_wxBusyInfo(self) + def __repr__(self): + return "" % (self.this,) +class wxBusyInfo(wxBusyInfoPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(miscc.new_wxBusyInfo,_args,_kwargs) + self.thisown = 1 + + + + #-------------- FUNCTION WRAPPERS ------------------ +wxIntersectRect = miscc.wxIntersectRect + wxNewId = miscc.wxNewId wxRegisterId = miscc.wxRegisterId @@ -548,6 +647,8 @@ wxEnableTopLevelWindows = miscc.wxEnableTopLevelWindows wxGetResource = miscc.wxGetResource +wxStripMenuCodes = miscc.wxStripMenuCodes + #-------------- VARIABLE WRAPPERS ------------------