Changes needed to be able to build with SWIG 1.3.24, 1.3.27 as well as

the upcoming 1.3.28, using #if statements on SWIG_VERSION.

Adjustments to ownership of SWIG objects, add some destructors and
explicitly disown non-window objects when their ownership is
transfered to a C++ object.

Since all window objects are owned by their parent, or by themselves,
always set their thisown attribute to False.

Explicitly set thisown to False after any Destroy() methods are
called, so SWIG doesn't try to destroy them again.

Etc.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2006-01-29 02:09:45 +00:00
parent 9a3fba2459
commit 214c4fbea5
32 changed files with 391 additions and 181 deletions

View File

@@ -73,7 +73,8 @@ class wxGBPosition
{
public:
wxGBPosition(int row=0, int col=0);
~wxGBPosition();
int GetRow() const;
int GetCol() const;
void SetRow(int row);
@@ -143,6 +144,8 @@ public:
colspan. The default is (1,1). (Meaning that the item occupies one
cell in each direction.", "");
~wxGBSpan();
int GetRowspan() const;
int GetColspan() const;
void SetRowspan(int rowspan);
@@ -218,6 +221,9 @@ item can be used in a Sizer.
You will probably never need to create a wx.GBSizerItem directly as they
are created automatically when the sizer's Add method is called.", "");
~wxGBSizerItem();
%extend {
DocStr(wxGBSizerItem( wxWindow *window, const wxGBPosition& pos,const wxGBSpan& span,int flag,int border,PyObject* userData=NULL ),
"Construct a `wx.GBSizerItem` for a window.", "");
@@ -241,6 +247,7 @@ are created automatically when the sizer's Add method is called.", "");
DocStr(wxGBSizerItem( wxSizer *sizer,const wxGBPosition& pos,const wxGBSpan& span,int flag,int border,PyObject* userData=NULL ),
"Construct a `wx.GBSizerItem` for a sizer", "");
%disownarg( wxSizer *sizer );
%RenameCtor(GBSizerItemSizer, wxGBSizerItem( wxSizer *sizer,
const wxGBPosition& pos,
const wxGBSpan& span,
@@ -256,6 +263,7 @@ are created automatically when the sizer's Add method is called.", "");
}
return new wxGBSizerItem(sizer, pos, span, flag, border, data);
}
%cleardisown( wxSizer *sizer );
DocStr(wxGBSizerItem( int width,int height,const wxGBPosition& pos,const wxGBSpan& span,int flag,int border,PyObject* userData=NULL),
@@ -392,6 +400,8 @@ position, False if something was already there.
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false);
if ( userData && (info.window || info.sizer || info.gotSize) )
data = new wxPyUserData(userData);
if ( info.sizer )
PyObject_SetAttrString(item,"thisown",Py_False);
wxPyEndBlockThreads(blocked);
// Now call the real Add method if a valid item type was found
@@ -405,7 +415,8 @@ position, False if something was already there.
return NULL;
}
}
%disownarg( wxGBSizerItem *item );
DocDeclAStrName(
wxGBSizerItem* , Add( wxGBSizerItem *item ),
"Add(self, GBSizerItem item) -> wx.GBSizerItem",
@@ -413,6 +424,7 @@ position, False if something was already there.
the item was successfully placed at its given cell position, False if
something was already there.", "",
AddItem);
%cleardisown( wxGBSizerItem *item );
DocDeclStr(
wxSize , GetCellSize(int row, int col) const,