X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c368d904fc27d35ae1e533155e2154dc496432e4..95e9b72bf4c4da413f28dd4f559dc14a83c292f8:/wxPython/contrib/ogl/oglcanvas.py?ds=sidebyside diff --git a/wxPython/contrib/ogl/oglcanvas.py b/wxPython/contrib/ogl/oglcanvas.py index 2467d6f08d..a2a67b2cae 100644 --- a/wxPython/contrib/ogl/oglcanvas.py +++ b/wxPython/contrib/ogl/oglcanvas.py @@ -15,6 +15,8 @@ from events import * from streams import * +from utils import * + from mdi import * from frames import * @@ -39,15 +41,12 @@ from sizers import * from filesys import * -from utils import * +from oglbasic import * import wx -class wxDiagramPtr : +class wxDiagramPtr(wxObjectPtr): def __init__(self,this): self.this = this self.thisown = 0 - def __del__(self,oglcanvasc=oglcanvasc): - if self.thisown == 1 : - oglcanvasc.delete_wxDiagram(self) def AddShape(self, *_args, **_kwargs): val = apply(oglcanvasc.wxDiagram_AddShape,(self,) + _args, _kwargs) return val @@ -62,11 +61,9 @@ class wxDiagramPtr : return val def FindShape(self, *_args, **_kwargs): val = apply(oglcanvasc.wxDiagram_FindShape,(self,) + _args, _kwargs) - if val: val = wxPyShapePtr(val) return val def GetCanvas(self, *_args, **_kwargs): val = apply(oglcanvasc.wxDiagram_GetCanvas,(self,) + _args, _kwargs) - if val: val = wxPyShapeCanvasPtr(val) return val def GetCount(self, *_args, **_kwargs): val = apply(oglcanvasc.wxDiagram_GetCount,(self,) + _args, _kwargs) @@ -151,8 +148,8 @@ class wxPyShapeCanvasPtr(wxScrolledWindowPtr): def __init__(self,this): self.this = this self.thisown = 0 - def _setSelf(self, *_args, **_kwargs): - val = apply(oglcanvasc.wxPyShapeCanvas__setSelf,(self,) + _args, _kwargs) + def _setCallbackInfo(self, *_args, **_kwargs): + val = apply(oglcanvasc.wxPyShapeCanvas__setCallbackInfo,(self,) + _args, _kwargs) return val def AddShape(self, *_args, **_kwargs): val = apply(oglcanvasc.wxPyShapeCanvas_AddShape,(self,) + _args, _kwargs) @@ -165,7 +162,6 @@ class wxPyShapeCanvasPtr(wxScrolledWindowPtr): return val def GetDiagram(self, *_args, **_kwargs): val = apply(oglcanvasc.wxPyShapeCanvas_GetDiagram,(self,) + _args, _kwargs) - if val: val = wxDiagramPtr(val) return val def GetQuickEditMode(self, *_args, **_kwargs): val = apply(oglcanvasc.wxPyShapeCanvas_GetQuickEditMode,(self,) + _args, _kwargs) @@ -215,9 +211,8 @@ class wxPyShapeCanvas(wxPyShapeCanvasPtr): def __init__(self,*_args,**_kwargs): self.this = apply(oglcanvasc.new_wxPyShapeCanvas,_args,_kwargs) self.thisown = 1 - self._setSelf(self, wxPyShapeCanvas) - #wx._StdWindowCallbacks(self) - #wx._StdOnScrollCallbacks(self) + self._setCallbackInfo(self, wxPyShapeCanvas) + self._setOORInfo(self)