struct wxPySizerItemInfo {
wxPySizerItemInfo()
- : window(NULL), sizer(NULL), gotSize(false),
- size(wxDefaultSize), gotPos(false), pos(-1)
+ : window(NULL), sizer(NULL), gotSize(False),
+ size(wxDefaultSize), gotPos(False), pos(-1)
{}
wxWindow* window;
// try wxSize or (w,h)
if ( checkSize && wxSize_helper(item, &sizePtr)) {
info.size = *sizePtr;
- info.gotSize = true;
+ info.gotSize = True;
}
// or a single int
if (checkIdx && PyInt_Check(item)) {
info.pos = PyInt_AsLong(item);
- info.gotPos = true;
+ info.gotPos = True;
}
}
}
wxPyUserData* data = NULL;
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();
wxPyUserData* data = NULL;
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();
wxPyUserData* data = NULL;
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();
bool Remove(PyObject* item) {
wxPyBeginBlockThreads();
- wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, true);
+ wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, True);
wxPyEndBlockThreads();
if ( info.window )
return self->Remove(info.window);
else if ( info.gotPos )
return self->Remove(info.pos);
else
- return FALSE;
+ return False;
}
- void _SetItemMinSize(PyObject* item, wxSize size) {
+ void _SetItemMinSize(PyObject* item, const wxSize& size) {
wxPyBeginBlockThreads();
- wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, true);
+ wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, True);
wxPyEndBlockThreads();
if ( info.window )
self->SetItemMinSize(info.window, size);
%pythoncode {
def AddMany(self, widgets):
for childinfo in widgets:
- if type(childinfo) != type(()):
+ if type(childinfo) != type(()) or (len(childinfo) == 2 and type(childinfo[0]) == type(1)):
childinfo = (childinfo, )
self.Add(*childinfo)
- # for backwards compatibility only, do not use in new code
+ %# for backwards compatibility only, please do not use in new code
AddWindow = AddSizer = AddSpacer = Add
PrependWindow = PrependSizer = PrependSpacer = Prepend
InsertWindow = InsertSizer = InsertSpacer = Insert
void SetDimension( int x, int y, int width, int height );
- void SetMinSize(wxSize size);
+ void SetMinSize( const wxSize &size );
wxSize GetSize();
wxPoint GetPosition();
void SetSizeHints( wxWindow *window );
void SetVirtualSizeHints( wxWindow *window );
- void Clear( bool delete_windows=FALSE );
+ void Clear( bool delete_windows=False );
void DeleteWindows();
// in the layout calculations or not.
%extend {
- void Show(PyObject* item, bool show = TRUE) {
- wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, false);
+ void Show(PyObject* item, bool show = True) {
+ wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, False);
if ( info.window )
self->Show(info.window, show);
else if ( info.sizer )
void Hide(PyObject* item) {
- wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, false);
+ wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, False);
if ( info.window )
self->Hide(info.window);
else if ( info.sizer )
bool IsShown(PyObject* item) {
- wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, false);
+ wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, False);
if ( info.window )
return self->IsShown(info.window);
else if ( info.sizer )
return self->IsShown(info.sizer);
else
- return false;
+ return False;
}
}
class wxPySizer : public wxSizer {
public:
- %addtofunc wxPySizer "self._setCallbackInfo(self, PySizer);self._setOORInfo(self)"
+ %pythonAppend wxPySizer "self._setCallbackInfo(self, PySizer);self._setOORInfo(self)"
wxPySizer();
void _setCallbackInfo(PyObject* self, PyObject* _class);
class wxBoxSizer : public wxSizer {
public:
- %addtofunc wxBoxSizer "self._setOORInfo(self)"
+ %pythonAppend wxBoxSizer "self._setOORInfo(self)"
wxBoxSizer(int orient = wxHORIZONTAL);
class wxStaticBoxSizer : public wxBoxSizer {
public:
- %addtofunc wxStaticBoxSizer "self._setOORInfo(self)"
+ %pythonAppend wxStaticBoxSizer "self._setOORInfo(self)"
wxStaticBoxSizer(wxStaticBox *box, int orient = wxHORIZONTAL);
class wxGridSizer: public wxSizer
{
public:
- %addtofunc wxGridSizer "self._setOORInfo(self)"
+ %pythonAppend wxGridSizer "self._setOORInfo(self)"
wxGridSizer( int rows=1, int cols=0, int vgap=0, int hgap=0 );
class wxFlexGridSizer: public wxGridSizer
{
public:
- %addtofunc wxFlexGridSizer "self._setOORInfo(self)"
+ %pythonAppend wxFlexGridSizer "self._setOORInfo(self)"
wxFlexGridSizer( int rows=1, int cols=0, int vgap=0, int hgap=0 );
// flexible
void SetNonFlexibleGrowMode(wxFlexSizerGrowMode mode);
wxFlexSizerGrowMode GetNonFlexibleGrowMode();
+
+ // Read-only access to the row heights and col widths arrays
+ const wxArrayInt& GetRowHeights() const;
+ const wxArrayInt& GetColWidths() const;
};
//---------------------------------------------------------------------------