+DocStr(wxSizerFlags,
+"Normally, when you add an item to a sizer via `wx.Sizer.Add`, you have
+to specify a lot of flags and parameters which can be unwieldy. This
+is where wx.SizerFlags comes in: it allows you to specify all
+parameters using the named methods instead. For example, instead of::
+
+ sizer.Add(ctrl, 0, wx.EXPAND | wx.ALL, 10)
+
+you can now write::
+
+ sizer.AddF(ctrl, wx.SizerFlags().Expand().Border(wx.ALL, 10))
+
+This is more readable and also allows you to create wx.SizerFlags
+objects which can be reused for several sizer items.::
+
+ flagsExpand = wx.SizerFlags(1)
+ flagsExpand.Expand().Border(wx.ALL, 10)
+ sizer.AddF(ctrl1, flagsExpand)
+ sizer.AddF(ctrl2, flagsExpand)
+
+Note that by specification, all methods of wx.SizerFlags return the
+wx.SizerFlags object itself allowing chaining multiple method calls
+like in the examples above.", "");
+
+class wxSizerFlags
+{
+public:
+ // construct the flags object initialized with the given proportion (0 by
+ // default)
+ DocCtorStr(
+ wxSizerFlags(int proportion = 0),
+ "Constructs the flags object with the specified proportion.", "");
+
+ ~wxSizerFlags();
+
+ // This typemap ensures that the returned object is the same
+ // Python instance as what was passed in as `self`, instead of
+ // creating a new proxy as SWIG would normally do.
+ %typemap(out) wxSizerFlags& { $result = $self; Py_INCREF($result); }
+
+ DocDeclStr(
+ wxSizerFlags& , Proportion(int proportion),
+ "Sets the item's proportion value.", "");
+
+ DocDeclStr(
+ wxSizerFlags& , Align(int alignment),
+ "Sets the item's alignment", "");
+
+ DocDeclStr(
+ wxSizerFlags& , Expand(),
+ "Sets the wx.EXPAND flag, which will cause the item to be expanded to
+fill as much space as it is given by the sizer.", "");
+
+ DocDeclStr(
+ wxSizerFlags& , Centre(),
+ "Same as `Center` for those with an alternate dialect of English.", "");
+
+ DocDeclStr(
+ wxSizerFlags& , Center(),
+ "Sets the centering alignment flags.", "");
+
+ DocDeclStr(
+ wxSizerFlags& , Left(),
+ "Aligns the object to the left, a shortcut for calling
+Align(wx.ALIGN_LEFT)", "");
+
+ DocDeclStr(
+ wxSizerFlags& , Right(),
+ "Aligns the object to the right, a shortcut for calling
+Align(wx.ALIGN_RIGHT)", "");
+
+ DocDeclStr(
+ wxSizerFlags& , Top(),
+ "Aligns the object to the top of the available space, a shortcut for
+calling Align(wx.ALIGN_TOP)", "");
+
+ DocDeclStr(
+ wxSizerFlags& , Bottom(),
+ "Aligns the object to the bottom of the available space, a shortcut for
+calling Align(wx.ALIGN_BOTTOM)", "");
+
+ DocDeclStr(
+ wxSizerFlags& , Shaped(),
+ "Sets the wx.SHAPED flag.", "");
+
+ DocDeclStr(
+ wxSizerFlags& , FixedMinSize(),
+ "Sets the wx.FIXED_MINSIZE flag.", "");
+
+
+
+ %extend {
+ DocDeclStr(
+ wxSizerFlags& , Border(int direction=wxALL, int borderInPixels=-1),
+ "Sets the border of the item in the direction(s) or sides given by the
+direction parameter. If the borderInPixels value is not given then
+the default border size (see `GetDefaultBorder`) will be used.", "")
+ {
+ if (borderInPixels == -1)
+ return self->Border(direction);
+ else
+ return self->Border(direction, borderInPixels);
+ }
+ }
+
+ DocDeclStr(
+ wxSizerFlags& , DoubleBorder(int direction = wxALL),
+ "Sets the border in the given direction to twice the default border
+size.", "");
+
+ DocDeclStr(
+ wxSizerFlags& , TripleBorder(int direction = wxALL),
+ "Sets the border in the given direction to three times the default
+border size.", "");
+
+ DocDeclStr(
+ wxSizerFlags& , HorzBorder(),
+ "Sets the left and right borders to the default border size.", "");
+
+ DocDeclStr(
+ wxSizerFlags& , DoubleHorzBorder(),
+ "Sets the left and right borders to twice the default border size.", "");
+
+
+ // Clear the typemap
+ %typemap(out) wxSizerFlags& ;
+
+
+
+ DocDeclStr(
+ static int , GetDefaultBorder(),
+ "Returns the default border size used by the other border methods", "");
+
+
+ DocDeclStr(
+ int , GetProportion() const,
+ "Returns the proportion value to be used in the sizer item.", "");
+
+ DocDeclStr(
+ int , GetFlags() const,
+ "Returns the flags value to be used in the sizer item.", "");
+
+ DocDeclStr(
+ int , GetBorderInPixels() const,
+ "Returns the border value in pixels to be used in the sizer item.", "");
+};
+
+//---------------------------------------------------------------------------
+