+ %disownarg( wxSizerItem *item );
+
+ DocDeclAStrName(
+ wxSizerItem* , Add( wxSizerItem *item ),
+ "AddItem(self, SizerItem item)",
+ "Adds a `wx.SizerItem` to the sizer.", "",
+ AddItem);
+
+ DocDeclAStrName(
+ wxSizerItem* , Insert( size_t index, wxSizerItem *item ),
+ "InsertItem(self, int index, SizerItem item)",
+ "Inserts a `wx.SizerItem` to the sizer at the position given by *index*.", "",
+ InsertItem);
+
+ DocDeclAStrName(
+ wxSizerItem* , Prepend( wxSizerItem *item ),
+ "PrependItem(self, SizerItem item)",
+ "Prepends a `wx.SizerItem` to the sizer.", "",
+ PrependItem);
+
+ %cleardisown( wxSizerItem *item );
+
+
+ %pythoncode {
+ def AddMany(self, items):
+ """
+ AddMany is a convenience method for adding several items
+ to a sizer at one time. Simply pass it a list of tuples,
+ where each tuple consists of the parameters that you
+ would normally pass to the `Add` method.
+ """
+ for item in items:
+ if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
+ item = (item, )
+ self.Add(*item)
+
+ def AddSpacer(self, *args, **kw):
+ """AddSpacer(int size) --> SizerItem
+
+ Add a spacer that is (size,size) pixels.
+ """
+ if args and type(args[0]) == int:
+ return self.Add( (args[0],args[0] ), 0)
+ else: %# otherwise stay compatible with old AddSpacer
+ return self.Add(*args, **kw)
+ def PrependSpacer(self, *args, **kw):
+ """PrependSpacer(int size) --> SizerItem
+
+ Prepend a spacer that is (size, size) pixels."""
+ if args and type(args[0]) == int:
+ return self.Prepend( (args[0],args[0] ), 0)
+ else: %# otherwise stay compatible with old PrependSpacer
+ return self.Prepend(*args, **kw)
+ def InsertSpacer(self, index, *args, **kw):
+ """InsertSpacer(int index, int size) --> SizerItem
+
+ Insert a spacer at position index that is (size, size) pixels."""
+ if args and type(args[0]) == int:
+ return self.Insert( index, (args[0],args[0] ), 0)
+ else: %# otherwise stay compatible with old InsertSpacer
+ return self.Insert(index, *args, **kw)
+
+
+ def AddStretchSpacer(self, prop=1):
+ """AddStretchSpacer(int prop=1) --> SizerItem
+
+ Add a stretchable spacer."""
+ return self.Add((0,0), prop)
+ def PrependStretchSpacer(self, prop=1):
+ """PrependStretchSpacer(int prop=1) --> SizerItem
+
+ Prepend a stretchable spacer."""
+ return self.Prepend((0,0), prop)
+ def InsertStretchSpacer(self, index, prop=1):
+ """InsertStretchSpacer(int index, int prop=1) --> SizerItem
+
+ Insert a stretchable spacer."""
+ return self.Insert(index, (0,0), prop)
+
+
+ %# for backwards compatibility only, please do not use in new code
+ def AddWindow(self, *args, **kw):
+ """Compatibility alias for `Add`."""
+ return self.Add(*args, **kw)
+ def AddSizer(self, *args, **kw):
+ """Compatibility alias for `Add`."""
+ return self.Add(*args, **kw)
+
+ def PrependWindow(self, *args, **kw):
+ """Compatibility alias for `Prepend`."""
+ return self.Prepend(*args, **kw)
+ def PrependSizer(self, *args, **kw):
+ """Compatibility alias for `Prepend`."""
+ return self.Prepend(*args, **kw)
+
+ def InsertWindow(self, *args, **kw):
+ """Compatibility alias for `Insert`."""
+ return self.Insert(*args, **kw)
+ def InsertSizer(self, *args, **kw):
+ """Compatibility alias for `Insert`."""
+ return self.Insert(*args, **kw)
+
+ def RemoveWindow(self, *args, **kw):
+ """Compatibility alias for `Remove`."""
+ return self.Remove(*args, **kw)
+ def RemoveSizer(self, *args, **kw):
+ """Compatibility alias for `Remove`."""
+ return self.Remove(*args, **kw)
+ def RemovePos(self, *args, **kw):
+ """Compatibility alias for `Remove`."""
+ return self.Remove(*args, **kw)
+
+ }
+
+
+ DocDeclStr(
+ void , SetDimension( int x, int y, int width, int height ),
+ "Call this to force the sizer to take the given dimension and thus
+force the items owned by the sizer to resize themselves according to
+the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
+methods.", "");
+
+ DocDeclStr(
+ void , SetMinSize( const wxSize &size ),
+ "Call this to give the sizer a minimal size. Normally, the sizer will
+calculate its minimal size based purely on how much space its children
+need. After calling this method `GetMinSize` will return either the
+minimal size as requested by its children or the minimal size set
+here, depending on which is bigger.", "");
+
+
+ DocDeclStr(
+ wxSize , GetSize(),
+ "Returns the current size of the space managed by the sizer.", "");
+
+ DocDeclStr(
+ wxPoint , GetPosition(),
+ "Returns the current position of the sizer's managed space.", "");
+
+ DocDeclStr(
+ wxSize , GetMinSize(),
+ "Returns the minimal size of the sizer. This is either the combined
+minimal size of all the children and their borders or the minimal size
+set by SetMinSize, depending on which is bigger.", "");