X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3ea6e0ec63b235fcd6ae6a44b9ad2c18a87b6024..42f8298f6f42d5d63bb3caf65682b7d9d9f8b702:/wxPython/src/_gbsizer.i?ds=sidebyside diff --git a/wxPython/src/_gbsizer.i b/wxPython/src/_gbsizer.i index 76989c4f50..483c92f441 100644 --- a/wxPython/src/_gbsizer.i +++ b/wxPython/src/_gbsizer.i @@ -42,7 +42,7 @@ bool wxGBPosition_helper(PyObject* source, wxGBPosition** obj) { if (source == Py_None) { **obj = wxGBPosition(-1,-1); - return True; + return true; } return wxPyTwoIntItem_helper(source, obj, wxT("wxGBPosition")); } @@ -51,7 +51,7 @@ bool wxGBSpan_helper(PyObject* source, wxGBSpan** obj) { if (source == Py_None) { **obj = wxGBSpan(-1,-1); - return True; + return true; } return wxPyTwoIntItem_helper(source, obj, wxT("wxGBSpan")); } @@ -80,8 +80,8 @@ public: void SetCol(int col); // %extend { -// bool __eq__(const wxGBPosition* other) { return other ? (*self == *other) : False; } -// bool __ne__(const wxGBPosition* other) { return other ? (*self != *other) : True; } +// bool __eq__(const wxGBPosition* other) { return other ? (*self == *other) : false; } +// bool __ne__(const wxGBPosition* other) { return other ? (*self != *other) : true; } // } bool operator==(const wxGBPosition& other); @@ -149,8 +149,8 @@ cell in each direction.", ""); void SetColspan(int colspan); // %extend { -// bool __eq__(const wxGBSpan* other) { return other ? (*self == *other) : False; } -// bool __ne__(const wxGBSpan* other) { return other ? (*self != *other) : True; } +// bool __eq__(const wxGBSpan* other) { return other ? (*self == *other) : false; } +// bool __ne__(const wxGBSpan* other) { return other ? (*self != *other) : true; } // } bool operator==(const wxGBSpan& other); bool operator!=(const wxGBSpan& other); @@ -221,12 +221,13 @@ are created automatically when the sizer's Add method is called.", ""); %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.", ""); - %name(GBSizerItemWindow) wxGBSizerItem( wxWindow *window, - const wxGBPosition& pos, - const wxGBSpan& span, - int flag, - int border, - PyObject* userData=NULL ) + + %RenameCtor(GBSizerItemWindow, wxGBSizerItem( wxWindow *window, + const wxGBPosition& pos, + const wxGBSpan& span, + int flag, + int border, + PyObject* userData=NULL )) { wxPyUserData* data = NULL; if ( userData ) { @@ -240,12 +241,12 @@ 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", ""); - %name(GBSizerItemSizer) wxGBSizerItem( wxSizer *sizer, - const wxGBPosition& pos, - const wxGBSpan& span, - int flag, - int border, - PyObject* userData=NULL ) + %RenameCtor(GBSizerItemSizer, wxGBSizerItem( wxSizer *sizer, + const wxGBPosition& pos, + const wxGBSpan& span, + int flag, + int border, + PyObject* userData=NULL )) { wxPyUserData* data = NULL; if ( userData ) { @@ -259,13 +260,13 @@ are created automatically when the sizer's Add method is called.", ""); DocStr(wxGBSizerItem( int width,int height,const wxGBPosition& pos,const wxGBSpan& span,int flag,int border,PyObject* userData=NULL), "Construct a `wx.GBSizerItem` for a spacer.", ""); - %name(GBSizerItemSpacer) wxGBSizerItem( int width, - int height, - const wxGBPosition& pos, - const wxGBSpan& span, - int flag, - int border, - PyObject* userData=NULL) + %RenameCtor(GBSizerItemSpacer, wxGBSizerItem( int width, + int height, + const wxGBPosition& pos, + const wxGBSpan& span, + int flag, + int border, + PyObject* userData=NULL)) { wxPyUserData* data = NULL; if ( userData ) { @@ -359,6 +360,8 @@ positioned at, adjusted for spanning. class wxGridBagSizer : public wxFlexGridSizer { public: + %pythonAppend wxGridBagSizer "self._setOORInfo(self)" + DocCtorStr( wxGridBagSizer(int vgap = 0, int hgap = 0 ), "Constructor, with optional parameters to specify the gap between the @@ -368,7 +371,7 @@ rows and columns.", ""); %extend { DocAStr(Add, "Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0, -int border=0, userData=None)", +int border=0, userData=None) -> wx.GBSizerItem", "Adds an item to the sizer at the grid cell *pos*, optionally spanning more than one row or column as specified with *span*. The remaining @@ -377,40 +380,44 @@ args behave similarly to `wx.Sizer.Add`. Returns True if the item was successfully placed at the given cell position, False if something was already there. ", ""); - bool Add( PyObject* item, - const wxGBPosition& pos, - const wxGBSpan& span = wxDefaultSpan, - int flag = 0, - int border = 0, - PyObject* userData = NULL ) { + wxGBSizerItem* Add( PyObject* item, + const wxGBPosition& pos, + const wxGBSpan& span = wxDefaultSpan, + int flag = 0, + int border = 0, + PyObject* userData = NULL ) { wxPyUserData* data = NULL; bool blocked = wxPyBeginBlockThreads(); - wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, True, False); + wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false); if ( userData && (info.window || info.sizer || info.gotSize) ) data = new wxPyUserData(userData); wxPyEndBlockThreads(blocked); // Now call the real Add method if a valid item type was found if ( info.window ) - return self->Add(info.window, pos, span, flag, border, data); + return (wxGBSizerItem*)self->Add(info.window, pos, span, flag, border, data); else if ( info.sizer ) - return self->Add(info.sizer, pos, span, flag, border, data); + return (wxGBSizerItem*)self->Add(info.sizer, pos, span, flag, border, data); else if (info.gotSize) - return self->Add(info.size.GetWidth(), info.size.GetHeight(), - pos, span, flag, border, data); - return False; + return (wxGBSizerItem*)self->Add(info.size.GetWidth(), info.size.GetHeight(), + pos, span, flag, border, data); + return NULL; } } DocDeclAStrName( - bool , Add( wxGBSizerItem *item ), - "Add(self, GBSizerItem item) -> bool", + wxGBSizerItem* , Add( wxGBSizerItem *item ), + "Add(self, GBSizerItem item) -> wx.GBSizerItem", "Add an item to the sizer using a `wx.GBSizerItem`. Returns True if the item was successfully placed at its given cell position, False if something was already there.", "", AddItem); - + + DocDeclStr( + wxSize , GetCellSize(int row, int col) const, + "Get the size of the specified cell, including hgap and +vgap. Only valid after a Layout.", ""); DocDeclStr( wxSize , GetEmptyCellSize() const,