Implemented the first phase of OOR (Original Object Return). See the
text in the demo for more details of what this means, but in a nutshell methods such as wxWindow.GetParent or FindWindowById will now return a shadow object of the proper type if it can. By "proper type" I mean that if the wxWindow pointer returned from FindWindowById really points to a wxButton then the Python object constructed will be of a wxButtonPtr class instead of wxWindowPtr as before. This should reduce or eliminiate the need for wxPyTypeCast. (Woo Hoo!) The objects returned are still not the original Python object, but that is the next step. (Although it will probably only work on Python 2.1 and beyond because it will use weak references.) A few other minor tweaks and fixes and additions for things found while doing the OOR stuff. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10197 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -42,7 +42,7 @@ from filesys import *
|
||||
from utils import *
|
||||
import wx
|
||||
from oglcanvas import wxPyShapeCanvasPtr
|
||||
class wxShapeRegionPtr :
|
||||
class wxShapeRegionPtr(wxObjectPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
self.thisown = 0
|
||||
@@ -143,7 +143,7 @@ class wxShapeRegion(wxShapeRegionPtr):
|
||||
|
||||
|
||||
|
||||
class wxPyShapeEvtHandlerPtr :
|
||||
class wxPyShapeEvtHandlerPtr(wxObjectPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
self.thisown = 0
|
||||
@@ -158,18 +158,15 @@ class wxPyShapeEvtHandlerPtr :
|
||||
return val
|
||||
def GetShape(self, *_args, **_kwargs):
|
||||
val = apply(oglbasicc.wxPyShapeEvtHandler_GetShape,(self,) + _args, _kwargs)
|
||||
if val: val = wxPyShapePtr(val)
|
||||
return val
|
||||
def SetPreviousHandler(self, *_args, **_kwargs):
|
||||
val = apply(oglbasicc.wxPyShapeEvtHandler_SetPreviousHandler,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetPreviousHandler(self, *_args, **_kwargs):
|
||||
val = apply(oglbasicc.wxPyShapeEvtHandler_GetPreviousHandler,(self,) + _args, _kwargs)
|
||||
if val: val = wxPyShapeEvtHandlerPtr(val)
|
||||
return val
|
||||
def CreateNewCopy(self, *_args, **_kwargs):
|
||||
val = apply(oglbasicc.wxPyShapeEvtHandler_CreateNewCopy,(self,) + _args, _kwargs)
|
||||
if val: val = wxPyShapeEvtHandlerPtr(val)
|
||||
return val
|
||||
def base_OnDelete(self, *_args, **_kwargs):
|
||||
val = apply(oglbasicc.wxPyShapeEvtHandler_base_OnDelete,(self,) + _args, _kwargs)
|
||||
@@ -290,7 +287,6 @@ class wxPyShapePtr(wxPyShapeEvtHandlerPtr):
|
||||
return val
|
||||
def GetCanvas(self, *_args, **_kwargs):
|
||||
val = apply(oglbasicc.wxPyShape_GetCanvas,(self,) + _args, _kwargs)
|
||||
if val: val = wxPyShapeCanvasPtr(val)
|
||||
return val
|
||||
def SetCanvas(self, *_args, **_kwargs):
|
||||
val = apply(oglbasicc.wxPyShape_SetCanvas,(self,) + _args, _kwargs)
|
||||
@@ -318,14 +314,12 @@ class wxPyShapePtr(wxPyShapeEvtHandlerPtr):
|
||||
return val
|
||||
def GetParent(self, *_args, **_kwargs):
|
||||
val = apply(oglbasicc.wxPyShape_GetParent,(self,) + _args, _kwargs)
|
||||
if val: val = wxPyShapePtr(val)
|
||||
return val
|
||||
def SetParent(self, *_args, **_kwargs):
|
||||
val = apply(oglbasicc.wxPyShape_SetParent,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetTopAncestor(self, *_args, **_kwargs):
|
||||
val = apply(oglbasicc.wxPyShape_GetTopAncestor,(self,) + _args, _kwargs)
|
||||
if val: val = wxPyShapePtr(val)
|
||||
return val
|
||||
def GetChildren(self, *_args, **_kwargs):
|
||||
val = apply(oglbasicc.wxPyShape_GetChildren,(self,) + _args, _kwargs)
|
||||
@@ -350,7 +344,6 @@ class wxPyShapePtr(wxPyShapeEvtHandlerPtr):
|
||||
return val
|
||||
def GetEventHandler(self, *_args, **_kwargs):
|
||||
val = apply(oglbasicc.wxPyShape_GetEventHandler,(self,) + _args, _kwargs)
|
||||
if val: val = wxPyShapeEvtHandlerPtr(val)
|
||||
return val
|
||||
def SetEventHandler(self, *_args, **_kwargs):
|
||||
val = apply(oglbasicc.wxPyShape_SetEventHandler,(self,) + _args, _kwargs)
|
||||
@@ -668,7 +661,6 @@ class wxPyShapePtr(wxPyShapeEvtHandlerPtr):
|
||||
return val
|
||||
def CreateNewCopy(self, *_args, **_kwargs):
|
||||
val = apply(oglbasicc.wxPyShape_CreateNewCopy,(self,) + _args, _kwargs)
|
||||
if val: val = wxPyShapePtr(val)
|
||||
return val
|
||||
def Copy(self, *_args, **_kwargs):
|
||||
val = apply(oglbasicc.wxPyShape_Copy,(self,) + _args, _kwargs)
|
||||
|
Reference in New Issue
Block a user