+ Returns the default border size used by the other border methods
+ """
+ return _core_.SizerFlags_GetDefaultBorder(*args)
+
+class SizerItem(Object):
+ """
+ The wx.SizerItem class is used to track the position, size and other
+ attributes of each item managed by a `wx.Sizer`. It is not usually
+ necessary to use this class because the sizer elements can also be
+ identified by their positions or window or sizer references but
+ sometimes it may be more convenient to use wx.SizerItem directly.
+ Also, custom classes derived from `wx.PySizer` will probably need to
+ use the collection of wx.SizerItems held by wx.Sizer when calculating
+ layout.
+
+ :see: `wx.Sizer`, `wx.GBSizerItem`
+ """
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+ __repr__ = _swig_repr
+ def __init__(self, *args, **kwargs):
+ """
+ __init__(self) -> SizerItem
+
+ Constructs an empty wx.SizerItem. Either a window, sizer or spacer
+ size will need to be set before this item can be used in a Sizer.
+
+ You will probably never need to create a wx.SizerItem directly as they
+ are created automatically when the sizer's Add, Insert or Prepend
+ methods are called.
+
+ :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
+ """
+ _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
+ __swig_destroy__ = _core_.delete_SizerItem
+ __del__ = lambda self : None;
+ def DeleteWindows(*args, **kwargs):
+ """
+ DeleteWindows(self)
+
+ Destroy the window or the windows in a subsizer, depending on the type
+ of item.
+ """
+ return _core_.SizerItem_DeleteWindows(*args, **kwargs)
+
+ def DetachSizer(*args, **kwargs):
+ """
+ DetachSizer(self)
+
+ Enable deleting the SizerItem without destroying the contained sizer.
+ """
+ return _core_.SizerItem_DetachSizer(*args, **kwargs)
+
+ def GetSize(*args, **kwargs):
+ """
+ GetSize(self) -> Size
+
+ Get the current size of the item, as set in the last Layout.
+ """
+ return _core_.SizerItem_GetSize(*args, **kwargs)
+
+ def CalcMin(*args, **kwargs):
+ """
+ CalcMin(self) -> Size
+
+ Calculates the minimum desired size for the item, including any space
+ needed by borders.
+ """
+ return _core_.SizerItem_CalcMin(*args, **kwargs)
+
+ def SetDimension(*args, **kwargs):
+ """
+ SetDimension(self, Point pos, Size size)
+
+ Set the position and size of the space allocated for this item by the
+ sizer, and adjust the position and size of the item (window or
+ subsizer) to be within that space taking alignment and borders into
+ account.
+ """
+ return _core_.SizerItem_SetDimension(*args, **kwargs)
+
+ def GetMinSize(*args, **kwargs):
+ """
+ GetMinSize(self) -> Size
+
+ Get the minimum size needed for the item.
+ """
+ return _core_.SizerItem_GetMinSize(*args, **kwargs)
+
+ def GetMinSizeWithBorder(*args, **kwargs):
+ """
+ GetMinSizeWithBorder(self) -> Size
+
+ Get the minimum size needed for the item with space for the borders
+ added, if needed.
+ """
+ return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
+
+ def SetInitSize(*args, **kwargs):
+ """SetInitSize(self, int x, int y)"""
+ return _core_.SizerItem_SetInitSize(*args, **kwargs)
+
+ def SetRatioWH(*args, **kwargs):
+ """
+ SetRatioWH(self, int width, int height)
+
+ Set the ratio item attribute.
+ """
+ return _core_.SizerItem_SetRatioWH(*args, **kwargs)
+
+ def SetRatioSize(*args, **kwargs):
+ """
+ SetRatioSize(self, Size size)
+
+ Set the ratio item attribute.
+ """
+ return _core_.SizerItem_SetRatioSize(*args, **kwargs)
+
+ def SetRatio(*args, **kwargs):
+ """
+ SetRatio(self, float ratio)
+
+ Set the ratio item attribute.
+ """
+ return _core_.SizerItem_SetRatio(*args, **kwargs)
+
+ def GetRatio(*args, **kwargs):
+ """
+ GetRatio(self) -> float
+
+ Set the ratio item attribute.
+ """
+ return _core_.SizerItem_GetRatio(*args, **kwargs)
+
+ def GetRect(*args, **kwargs):
+ """
+ GetRect(self) -> Rect
+
+ Returns the rectangle that the sizer item should occupy
+ """
+ return _core_.SizerItem_GetRect(*args, **kwargs)
+
+ def IsWindow(*args, **kwargs):
+ """
+ IsWindow(self) -> bool
+
+ Is this sizer item a window?
+ """
+ return _core_.SizerItem_IsWindow(*args, **kwargs)
+
+ def IsSizer(*args, **kwargs):
+ """
+ IsSizer(self) -> bool
+
+ Is this sizer item a subsizer?
+ """
+ return _core_.SizerItem_IsSizer(*args, **kwargs)
+
+ def IsSpacer(*args, **kwargs):
+ """
+ IsSpacer(self) -> bool
+
+ Is this sizer item a spacer?
+ """
+ return _core_.SizerItem_IsSpacer(*args, **kwargs)
+
+ def SetProportion(*args, **kwargs):
+ """
+ SetProportion(self, int proportion)
+
+ Set the proportion value for this item.
+ """
+ return _core_.SizerItem_SetProportion(*args, **kwargs)
+
+ def GetProportion(*args, **kwargs):
+ """
+ GetProportion(self) -> int
+
+ Get the proportion value for this item.
+ """
+ return _core_.SizerItem_GetProportion(*args, **kwargs)
+
+ SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
+ GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
+ def SetFlag(*args, **kwargs):
+ """
+ SetFlag(self, int flag)
+
+ Set the flag value for this item.
+ """
+ return _core_.SizerItem_SetFlag(*args, **kwargs)
+
+ def GetFlag(*args, **kwargs):
+ """
+ GetFlag(self) -> int
+
+ Get the flag value for this item.
+ """
+ return _core_.SizerItem_GetFlag(*args, **kwargs)
+
+ def SetBorder(*args, **kwargs):
+ """
+ SetBorder(self, int border)
+
+ Set the border value for this item.
+ """
+ return _core_.SizerItem_SetBorder(*args, **kwargs)
+
+ def GetBorder(*args, **kwargs):
+ """
+ GetBorder(self) -> int
+
+ Get the border value for this item.
+ """
+ return _core_.SizerItem_GetBorder(*args, **kwargs)
+
+ def GetWindow(*args, **kwargs):
+ """
+ GetWindow(self) -> Window
+
+ Get the window (if any) that is managed by this sizer item.
+ """
+ return _core_.SizerItem_GetWindow(*args, **kwargs)
+
+ def GetSizer(*args, **kwargs):
+ """
+ GetSizer(self) -> Sizer
+
+ Get the subsizer (if any) that is managed by this sizer item.
+ """
+ return _core_.SizerItem_GetSizer(*args, **kwargs)
+
+ def GetSpacer(*args, **kwargs):
+ """
+ GetSpacer(self) -> Size
+
+ Get the size of the spacer managed by this sizer item.
+ """
+ return _core_.SizerItem_GetSpacer(*args, **kwargs)
+
+ def SetWindow(*args, **kwargs):
+ """
+ SetWindow(self, Window window)
+
+ Set the window to be managed by this sizer item.
+ """
+ return _core_.SizerItem_SetWindow(*args, **kwargs)
+
+ def SetSizer(*args, **kwargs):
+ """
+ SetSizer(self, Sizer sizer)
+
+ Set the subsizer to be managed by this sizer item.
+ """
+ return _core_.SizerItem_SetSizer(*args, **kwargs)
+
+ def SetSpacer(*args, **kwargs):
+ """
+ SetSpacer(self, Size size)
+
+ Set the size of the spacer to be managed by this sizer item.
+ """
+ return _core_.SizerItem_SetSpacer(*args, **kwargs)
+
+ SetWindow = wx._deprecated(SetWindow, "Use `AssignWindow` instead.")
+ SetSizer = wx._deprecated(SetSizer, "Use `AssignSizer` instead.")
+ SetSpacer = wx._deprecated(SetSpacer, "Use `AssignSpacer` instead.")
+
+ def AssignWindow(*args, **kwargs):
+ """
+ AssignWindow(self, Window window)
+
+ Set the window to be managed by this sizer item.
+ """
+ return _core_.SizerItem_AssignWindow(*args, **kwargs)
+
+ def AssignSizer(*args, **kwargs):
+ """
+ AssignSizer(self, Sizer sizer)
+
+ Set the subsizer to be managed by this sizer item.
+ """
+ return _core_.SizerItem_AssignSizer(*args, **kwargs)
+
+ def AssignSpacer(*args, **kwargs):
+ """
+ AssignSpacer(self, Size size)
+
+ Set the size of the spacer to be managed by this sizer item.
+ """
+ return _core_.SizerItem_AssignSpacer(*args, **kwargs)
+
+ def Show(*args, **kwargs):
+ """
+ Show(self, bool show)
+
+ Set the show item attribute, which sizers use to determine if the item
+ is to be made part of the layout or not. If the item is tracking a
+ window then it is shown or hidden as needed.
+ """
+ return _core_.SizerItem_Show(*args, **kwargs)
+
+ def IsShown(*args, **kwargs):
+ """
+ IsShown(self) -> bool
+
+ Is the item to be shown in the layout?
+ """
+ return _core_.SizerItem_IsShown(*args, **kwargs)
+
+ def GetPosition(*args, **kwargs):
+ """
+ GetPosition(self) -> Point
+
+ Returns the current position of the item, as set in the last Layout.
+ """
+ return _core_.SizerItem_GetPosition(*args, **kwargs)
+
+ def GetUserData(*args, **kwargs):
+ """
+ GetUserData(self) -> PyObject
+
+ Returns the userData associated with this sizer item, or None if there
+ isn't any.
+ """
+ return _core_.SizerItem_GetUserData(*args, **kwargs)
+
+ def SetUserData(*args, **kwargs):
+ """
+ SetUserData(self, PyObject userData)
+
+ Associate a Python object with this sizer item.
+ """
+ return _core_.SizerItem_SetUserData(*args, **kwargs)
+
+ Border = property(GetBorder,SetBorder,doc="See `GetBorder` and `SetBorder`")
+ Flag = property(GetFlag,SetFlag,doc="See `GetFlag` and `SetFlag`")
+ MinSize = property(GetMinSize,doc="See `GetMinSize`")
+ MinSizeWithBorder = property(GetMinSizeWithBorder,doc="See `GetMinSizeWithBorder`")
+ Position = property(GetPosition,doc="See `GetPosition`")
+ Proportion = property(GetProportion,SetProportion,doc="See `GetProportion` and `SetProportion`")
+ Ratio = property(GetRatio,SetRatio,doc="See `GetRatio` and `SetRatio`")
+ Rect = property(GetRect,doc="See `GetRect`")
+ Size = property(GetSize,doc="See `GetSize`")
+ Sizer = property(GetSizer,AssignSizer,doc="See `GetSizer` and `AssignSizer`")
+ Spacer = property(GetSpacer,AssignSpacer,doc="See `GetSpacer` and `AssignSpacer`")
+ UserData = property(GetUserData,SetUserData,doc="See `GetUserData` and `SetUserData`")
+ Window = property(GetWindow,AssignWindow,doc="See `GetWindow` and `AssignWindow`")
+_core_.SizerItem_swigregister(SizerItem)
+
+def SizerItemWindow(*args, **kwargs):
+ """
+ SizerItemWindow(Window window, int proportion, int flag, int border,
+ PyObject userData=None) -> SizerItem
+
+ Constructs a `wx.SizerItem` for tracking a window.
+ """
+ val = _core_.new_SizerItemWindow(*args, **kwargs)
+ return val
+
+def SizerItemSpacer(*args, **kwargs):
+ """
+ SizerItemSpacer(int width, int height, int proportion, int flag, int border,
+ PyObject userData=None) -> SizerItem
+
+ Constructs a `wx.SizerItem` for tracking a spacer.
+ """
+ val = _core_.new_SizerItemSpacer(*args, **kwargs)
+ return val
+
+def SizerItemSizer(*args, **kwargs):
+ """
+ SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
+ PyObject userData=None) -> SizerItem
+
+ Constructs a `wx.SizerItem` for tracking a subsizer
+ """
+ val = _core_.new_SizerItemSizer(*args, **kwargs)
+ return val
+
+class Sizer(Object):
+ """
+ wx.Sizer is the abstract base class used for laying out subwindows in
+ a window. You cannot use wx.Sizer directly; instead, you will have to
+ use one of the sizer classes derived from it such as `wx.BoxSizer`,
+ `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
+ `wx.GridBagSizer`.
+
+ The concept implemented by sizers in wxWidgets is closely related to
+ layout tools in other GUI toolkits, such as Java's AWT, the GTK
+ toolkit or the Qt toolkit. It is based upon the idea of the individual
+ subwindows reporting their minimal required size and their ability to
+ get stretched if the size of the parent window has changed. This will
+ most often mean that the programmer does not set the original size of
+ a dialog in the beginning, rather the dialog will assigned a sizer and
+ this sizer will be queried about the recommended size. The sizer in
+ turn will query its children, which can be normal windows or contorls,
+ empty space or other sizers, so that a hierarchy of sizers can be
+ constructed. Note that wxSizer does not derive from wxWindow and thus
+ do not interfere with tab ordering and requires very little resources
+ compared to a real window on screen.
+
+ What makes sizers so well fitted for use in wxWidgets is the fact that
+ every control reports its own minimal size and the algorithm can
+ handle differences in font sizes or different window (dialog item)
+ sizes on different platforms without problems. If for example the
+ standard font as well as the overall design of Mac widgets requires
+ more space than on Windows, then the initial size of a dialog using a
+ sizer will automatically be bigger on Mac than on Windows.
+ """
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
+ def __init__(self): raise AttributeError, "No constructor defined"
+ __repr__ = _swig_repr
+ __swig_destroy__ = _core_.delete_Sizer
+ __del__ = lambda self : None;
+ def _setOORInfo(*args, **kwargs):
+ """_setOORInfo(self, PyObject _self)"""
+ return _core_.Sizer__setOORInfo(*args, **kwargs)
+
+ def Add(*args, **kwargs):
+ """
+ Add(self, item, int proportion=0, int flag=0, int border=0,
+ PyObject userData=None) -> wx.SizerItem
+
+ Appends a child item to the sizer.
+ """
+ return _core_.Sizer_Add(*args, **kwargs)
+
+ def AddF(*args, **kwargs):
+ """
+ AddF(self, item, wx.SizerFlags flags) -> wx.SizerItem
+
+ Similar to `Add` but uses the `wx.SizerFlags` convenience class for
+ setting the various flags, options and borders.
+ """
+ return _core_.Sizer_AddF(*args, **kwargs)
+
+ def Insert(*args, **kwargs):
+ """
+ Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
+ PyObject userData=None) -> wx.SizerItem
+
+ Inserts a new item into the list of items managed by this sizer before
+ the item at index *before*. See `Add` for a description of the parameters.
+ """
+ return _core_.Sizer_Insert(*args, **kwargs)
+
+ def InsertF(*args, **kwargs):
+ """
+ InsertF(self, int before, item, wx.SizerFlags flags) -> wx.SizerItem
+
+ Similar to `Insert`, but uses the `wx.SizerFlags` convenience class
+ for setting the various flags, options and borders.
+ """
+ return _core_.Sizer_InsertF(*args, **kwargs)
+
+ def Prepend(*args, **kwargs):
+ """
+ Prepend(self, item, int proportion=0, int flag=0, int border=0,
+ PyObject userData=None) -> wx.SizerItem
+
+ Adds a new item to the begining of the list of sizer items managed by
+ this sizer. See `Add` for a description of the parameters.
+ """
+ return _core_.Sizer_Prepend(*args, **kwargs)
+
+ def PrependF(*args, **kwargs):
+ """
+ PrependF(self, item, wx.SizerFlags flags) -> wx.SizerItem
+
+ Similar to `Prepend` but uses the `wx.SizerFlags` convenience class
+ for setting the various flags, options and borders.
+ """
+ return _core_.Sizer_PrependF(*args, **kwargs)
+
+ def Remove(*args, **kwargs):
+ """
+ Remove(self, item) -> bool
+
+ Removes an item from the sizer and destroys it. This method does not
+ cause any layout or resizing to take place, call `Layout` to update
+ the layout on screen after removing a child from the sizer. The
+ *item* parameter can be either a window, a sizer, or the zero-based
+ index of an item to remove. Returns True if the child item was found
+ and removed.
+ """
+ return _core_.Sizer_Remove(*args, **kwargs)
+
+ def Detach(*args, **kwargs):
+ """
+ Detach(self, item) -> bool
+
+ Detaches an item from the sizer without destroying it. This method
+ does not cause any layout or resizing to take place, call `Layout` to
+ do so. The *item* parameter can be either a window, a sizer, or the
+ zero-based index of the item to be detached. Returns True if the child item
+ was found and detached.
+ """
+ return _core_.Sizer_Detach(*args, **kwargs)
+
+ def GetItem(*args, **kwargs):
+ """
+ GetItem(self, item, recursive=False) -> wx.SizerItem
+
+ Returns the `wx.SizerItem` which holds the *item* given. The *item*
+ parameter can be either a window, a sizer, or the zero-based index of
+ the item to be found.
+ """
+ return _core_.Sizer_GetItem(*args, **kwargs)
+
+ def _SetItemMinSize(*args, **kwargs):
+ """_SetItemMinSize(self, PyObject item, Size size)"""
+ return _core_.Sizer__SetItemMinSize(*args, **kwargs)
+
+ def _ReplaceWin(*args, **kwargs):
+ """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
+ return _core_.Sizer__ReplaceWin(*args, **kwargs)
+
+ def _ReplaceSizer(*args, **kwargs):
+ """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
+ return _core_.Sizer__ReplaceSizer(*args, **kwargs)
+
+ def _ReplaceItem(*args, **kwargs):
+ """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
+ return _core_.Sizer__ReplaceItem(*args, **kwargs)
+
+ def Replace(self, olditem, item, recursive=False):
+ """
+ Detaches the given ``olditem`` from the sizer and replaces it with
+ ``item`` which can be a window, sizer, or `wx.SizerItem`. The
+ detached child is destroyed only if it is not a window, (because
+ windows are owned by their parent, not the sizer.) The
+ ``recursive`` parameter can be used to search for the given
+ element recursivly in subsizers.
+
+ This method does not cause any layout or resizing to take place,
+ call `Layout` to do so.
+
+ Returns ``True`` if the child item was found and removed.
+ """
+ if isinstance(olditem, wx.Window):
+ return self._ReplaceWin(olditem, item, recursive)
+ elif isinstance(olditem, wx.Sizer):
+ return self._ReplaceSizer(olditem, item, recursive)
+ elif isinstance(olditem, int):
+ return self._ReplaceItem(olditem, item)
+ else:
+ raise TypeError("Expected Window, Sizer, or integer for first parameter.")
+
+ def SetContainingWindow(*args, **kwargs):
+ """
+ SetContainingWindow(self, Window window)
+
+ Set (or unset) the window this sizer is used in.
+ """
+ return _core_.Sizer_SetContainingWindow(*args, **kwargs)
+
+ def GetContainingWindow(*args, **kwargs):
+ """
+ GetContainingWindow(self) -> Window
+
+ Get the window this sizer is used in.
+ """
+ return _core_.Sizer_GetContainingWindow(*args, **kwargs)
+
+ def SetItemMinSize(self, item, *args):
+ """
+ SetItemMinSize(self, item, Size size)
+
+ Sets the minimum size that will be allocated for an item in the sizer.
+ The *item* parameter can be either a window, a sizer, or the
+ zero-based index of the item. If a window or sizer is given then it
+ will be searched for recursivly in subsizers if neccessary.
+ """