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:
@@ -191,7 +191,6 @@ class wxGridCellEditorPtr :
|
||||
return val
|
||||
def GetControl(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGridCellEditor_GetControl,(self,) + _args, _kwargs)
|
||||
if val: val = wxControlPtr(val)
|
||||
return val
|
||||
def SetControl(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGridCellEditor_SetControl,(self,) + _args, _kwargs)
|
||||
@@ -370,6 +369,12 @@ class wxGridCellChoiceEditor(wxGridCellChoiceEditorPtr):
|
||||
|
||||
|
||||
class wxGridCellAttrPtr :
|
||||
Any = gridc.wxGridCellAttr_Any
|
||||
Default = gridc.wxGridCellAttr_Default
|
||||
Cell = gridc.wxGridCellAttr_Cell
|
||||
Row = gridc.wxGridCellAttr_Row
|
||||
Col = gridc.wxGridCellAttr_Col
|
||||
Merged = gridc.wxGridCellAttr_Merged
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
self.thisown = 0
|
||||
@@ -377,6 +382,9 @@ class wxGridCellAttrPtr :
|
||||
val = apply(gridc.wxGridCellAttr_Clone,(self,) + _args, _kwargs)
|
||||
if val: val = wxGridCellAttrPtr(val)
|
||||
return val
|
||||
def MergeWith(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGridCellAttr_MergeWith,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def IncRef(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGridCellAttr_IncRef,(self,) + _args, _kwargs)
|
||||
return val
|
||||
@@ -404,6 +412,9 @@ class wxGridCellAttrPtr :
|
||||
def SetEditor(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGridCellAttr_SetEditor,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetKind(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGridCellAttr_SetKind,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def HasTextColour(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGridCellAttr_HasTextColour,(self,) + _args, _kwargs)
|
||||
return val
|
||||
@@ -422,6 +433,9 @@ class wxGridCellAttrPtr :
|
||||
def HasEditor(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGridCellAttr_HasEditor,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def HasReadWriteMode(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGridCellAttr_HasReadWriteMode,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetTextColour(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGridCellAttr_GetTextColour,(self,) + _args, _kwargs)
|
||||
if val: val = wxColourPtr(val)
|
||||
@@ -525,7 +539,7 @@ class wxPyGridCellAttrProvider(wxPyGridCellAttrProviderPtr):
|
||||
|
||||
|
||||
|
||||
class wxGridTableBasePtr :
|
||||
class wxGridTableBasePtr(wxObjectPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
self.thisown = 0
|
||||
@@ -541,7 +555,6 @@ class wxGridTableBasePtr :
|
||||
return val
|
||||
def GetView(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGridTableBase_GetView,(self,) + _args, _kwargs)
|
||||
if val: val = wxGridPtr(val)
|
||||
return val
|
||||
def GetNumberRows(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGridTableBase_GetNumberRows,(self,) + _args, _kwargs)
|
||||
@@ -748,7 +761,6 @@ class wxGridTableMessagePtr :
|
||||
return val
|
||||
def GetTableObject(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGridTableMessage_GetTableObject,(self,) + _args, _kwargs)
|
||||
if val: val = wxGridTableBasePtr(val)
|
||||
return val
|
||||
def SetId(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGridTableMessage_SetId,(self,) + _args, _kwargs)
|
||||
@@ -842,7 +854,6 @@ class wxGridPtr(wxScrolledWindowPtr):
|
||||
return val
|
||||
def GetTable(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGrid_GetTable,(self,) + _args, _kwargs)
|
||||
if val: val = wxGridTableBasePtr(val)
|
||||
return val
|
||||
def SetTable(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGrid_SetTable,(self,) + _args, _kwargs)
|
||||
@@ -1031,6 +1042,12 @@ class wxGridPtr(wxScrolledWindowPtr):
|
||||
val = apply(gridc.wxGrid_GetCellHighlightColour,(self,) + _args, _kwargs)
|
||||
if val: val = wxColourPtr(val) ; val.thisown = 1
|
||||
return val
|
||||
def GetCellHighlightPenWidth(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGrid_GetCellHighlightPenWidth,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetCellHighlightROPenWidth(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGrid_GetCellHighlightROPenWidth,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetRowLabelSize(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGrid_SetRowLabelSize,(self,) + _args, _kwargs)
|
||||
return val
|
||||
@@ -1064,6 +1081,12 @@ class wxGridPtr(wxScrolledWindowPtr):
|
||||
def SetCellHighlightColour(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGrid_SetCellHighlightColour,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetCellHighlightPenWidth(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGrid_SetCellHighlightPenWidth,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetCellHighlightROPenWidth(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGrid_SetCellHighlightROPenWidth,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def EnableDragRowSize(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGrid_EnableDragRowSize,(self,) + _args, _kwargs)
|
||||
return val
|
||||
@@ -1315,6 +1338,18 @@ class wxGridPtr(wxScrolledWindowPtr):
|
||||
def SetMargins(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGrid_SetMargins,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetGridWindow(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGrid_GetGridWindow,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetGridRowLabelWindow(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGrid_GetGridRowLabelWindow,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetGridColLabelWindow(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGrid_GetGridColLabelWindow,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetGridCornerLabelWindow(self, *_args, **_kwargs):
|
||||
val = apply(gridc.wxGrid_GetGridCornerLabelWindow,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def __repr__(self):
|
||||
return "<C wxGrid instance at %s>" % (self.this,)
|
||||
class wxGrid(wxGridPtr):
|
||||
|
Reference in New Issue
Block a user