Package wx :: Class SizerFlags

[frames | no frames]

## Type SizerFlags

    object --+
             |
            SizerFlags

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.

Method Summary
SizerFlags | ``__init__`(self, proportion)` Constructs the flags object with the specified proportion.
| `__del__(self)`
SizerFlags | ``Align`(self, alignment)` Sets the item's alignment
SizerFlags | ``Border`(self, direction, borderInPixels)` Sets the border of the item in the direction(s) or sides given by the direction parameter.
SizerFlags | ``Bottom`(self)` Aligns the object to the bottom of the available space, a shortcut for calling Align(wx.ALIGN_BOTTOM)
SizerFlags | ``Center`(self)` Sets the centering alignment flags.
SizerFlags | ``Centre`(self)` Same as `Center` for those with an alternate dialect of English.
SizerFlags | ``DoubleBorder`(self, direction)` Sets the border in the given direction to twice the default border size.
SizerFlags | ``DoubleHorzBorder`(self)` Sets the left and right borders to twice the default border size.
SizerFlags | ``Expand`(self)` 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.
SizerFlags | ``FixedMinSize`(self)` Sets the wx.FIXED_MINSIZE flag.
int | ``GetBorderInPixels`(self)` Returns the border value in pixels to be used in the sizer item.
int | ``GetDefaultBorder`()` Returns the default border size used by the other border methods (Static method)
int | ``GetFlags`(self)` Returns the flags value to be used in the sizer item.
int | ``GetProportion`(self)` Returns the proportion value to be used in the sizer item.
SizerFlags | ``HorzBorder`(self)` Sets the left and right borders to the default border size.
SizerFlags | ``Left`(self)` Aligns the object to the left, a shortcut for calling Align(wx.ALIGN_LEFT)
SizerFlags | ``Proportion`(self, proportion)` Sets the item's proportion value.
SizerFlags | ``Right`(self)` Aligns the object to the right, a shortcut for calling Align(wx.ALIGN_RIGHT)
SizerFlags | ``Shaped`(self)` Sets the wx.SHAPED flag.
SizerFlags | ``Top`(self)` Aligns the object to the top of the available space, a shortcut for calling Align(wx.ALIGN_TOP)
SizerFlags | ``TripleBorder`(self, direction)` Sets the border in the given direction to three times the default border size.

Property Summary
| `thisown`: The membership flag

Instance Method Details

### __init__(self, proportion=0)
(Constructor)

Constructs the flags object with the specified proportion.

  Parameters:
    `proportion`
    (type=int)

  Returns:
    SizerFlags
  Overrides:
    `__builtin__.object.__init__`

### Align(self, alignment)

Sets the item's alignment

  Parameters:
    `alignment`
    (type=int)

  Returns:
    SizerFlags

### Border(self, direction=ALL, 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.

  Parameters:
    `direction`
    (type=int)

    `borderInPixels`
    (type=int)

  Returns:
    SizerFlags

### Bottom(self)

Aligns the object to the bottom of the available space, a shortcut for calling Align(wx.ALIGN_BOTTOM)

  Returns:
    SizerFlags

### Center(self)

Sets the centering alignment flags.

  Returns:
    SizerFlags

### Centre(self)

Same as `Center` for those with an alternate dialect of English.

  Returns:
    SizerFlags

### DoubleBorder(self, direction=ALL)

Sets the border in the given direction to twice the default border size.

  Parameters:
    `direction`
    (type=int)

  Returns:
    SizerFlags

### DoubleHorzBorder(self)

Sets the left and right borders to twice the default border size.

  Returns:
    SizerFlags

### Expand(self)

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.

  Returns:
    SizerFlags

### FixedMinSize(self)

Sets the wx.FIXED_MINSIZE flag.

  Returns:
    SizerFlags

### GetBorderInPixels(self)

Returns the border value in pixels to be used in the sizer item.

  Returns:
    int

### GetFlags(self)

Returns the flags value to be used in the sizer item.

  Returns:
    int

### GetProportion(self)

Returns the proportion value to be used in the sizer item.

  Returns:
    int

### HorzBorder(self)

Sets the left and right borders to the default border size.

  Returns:
    SizerFlags

### Left(self)

Aligns the object to the left, a shortcut for calling Align(wx.ALIGN_LEFT)

  Returns:
    SizerFlags

### Proportion(self, proportion)

Sets the item's proportion value.

  Parameters:
    `proportion`
    (type=int)

  Returns:
    SizerFlags

### Right(self)

Aligns the object to the right, a shortcut for calling Align(wx.ALIGN_RIGHT)

  Returns:
    SizerFlags

### Shaped(self)

Sets the wx.SHAPED flag.

  Returns:
    SizerFlags

### Top(self)

Aligns the object to the top of the available space, a shortcut for calling Align(wx.ALIGN_TOP)

  Returns:
    SizerFlags

### TripleBorder(self, direction=ALL)

Sets the border in the given direction to three times the default border size.

  Parameters:
    `direction`
    (type=int)

  Returns:
    SizerFlags

Static Method Details

### GetDefaultBorder()

Returns the default border size used by the other border methods

  Returns:
    int

Property Details

### thisown

The membership flag

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:09:55 2007 | http://epydoc.sf.net