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@10202 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2001-05-18 05:20:01 +00:00
parent 419c299ae5
commit 9df61a29d2
50 changed files with 4883 additions and 2445 deletions

View File

@@ -19,7 +19,7 @@ from controls import *
from events import *
import wx
class wxPrintDataPtr :
class wxPrintDataPtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
@@ -157,7 +157,7 @@ class wxPrintData(wxPrintDataPtr):
class wxPageSetupDialogDataPtr :
class wxPageSetupDialogDataPtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
@@ -286,7 +286,7 @@ class wxPageSetupDialog(wxPageSetupDialogPtr):
class wxPrintDialogDataPtr :
class wxPrintDialogDataPtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
@@ -380,7 +380,6 @@ class wxPrintDialogPtr(wxDialogPtr):
return val
def GetPrintDC(self, *_args, **_kwargs):
val = apply(printfwc.wxPrintDialog_GetPrintDC,(self,) + _args, _kwargs)
if val: val = wxDCPtr(val) ; val.thisown = 1
return val
def ShowModal(self, *_args, **_kwargs):
val = apply(printfwc.wxPrintDialog_ShowModal,(self,) + _args, _kwargs)
@@ -396,7 +395,7 @@ class wxPrintDialog(wxPrintDialogPtr):
class wxPrintoutPtr :
class wxPrintoutPtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
@@ -408,7 +407,6 @@ class wxPrintoutPtr :
return val
def GetDC(self, *_args, **_kwargs):
val = apply(printfwc.wxPrintout_GetDC,(self,) + _args, _kwargs)
if val: val = wxDCPtr(val)
return val
def GetPageSizeMM(self, *_args, **_kwargs):
val = apply(printfwc.wxPrintout_GetPageSizeMM,(self,) + _args, _kwargs)
@@ -457,7 +455,7 @@ class wxPrintout(wxPrintoutPtr):
class wxPrinterPtr :
class wxPrinterPtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
@@ -476,7 +474,6 @@ class wxPrinterPtr :
return val
def PrintDialog(self, *_args, **_kwargs):
val = apply(printfwc.wxPrinter_PrintDialog,(self,) + _args, _kwargs)
if val: val = wxDCPtr(val)
return val
def ReportError(self, *_args, **_kwargs):
val = apply(printfwc.wxPrinter_ReportError,(self,) + _args, _kwargs)
@@ -494,20 +491,18 @@ class wxPrinter(wxPrinterPtr):
class wxPrintPreviewPtr :
class wxPrintPreviewPtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def GetCanvas(self, *_args, **_kwargs):
val = apply(printfwc.wxPrintPreview_GetCanvas,(self,) + _args, _kwargs)
if val: val = wxWindowPtr(val)
return val
def GetCurrentPage(self, *_args, **_kwargs):
val = apply(printfwc.wxPrintPreview_GetCurrentPage,(self,) + _args, _kwargs)
return val
def GetFrame(self, *_args, **_kwargs):
val = apply(printfwc.wxPrintPreview_GetFrame,(self,) + _args, _kwargs)
if val: val = wxFramePtr(val)
return val
def GetMaxPage(self, *_args, **_kwargs):
val = apply(printfwc.wxPrintPreview_GetMaxPage,(self,) + _args, _kwargs)
@@ -521,11 +516,9 @@ class wxPrintPreviewPtr :
return val
def GetPrintout(self, *_args, **_kwargs):
val = apply(printfwc.wxPrintPreview_GetPrintout,(self,) + _args, _kwargs)
if val: val = wxPrintoutPtr(val)
return val
def GetPrintoutForPrinting(self, *_args, **_kwargs):
val = apply(printfwc.wxPrintPreview_GetPrintoutForPrinting,(self,) + _args, _kwargs)
if val: val = wxPrintoutPtr(val)
return val
def GetZoom(self, *_args, **_kwargs):
val = apply(printfwc.wxPrintPreview_GetZoom,(self,) + _args, _kwargs)