Search documentation of wx

# View Source wxSizerFlags (wx v2.4.2)

Functions for wxSizerFlags class

Container for sizer items flags providing readable names for them.

Normally, when you add an item to a sizer via `wxSizer:add/4`, you have to specify a lot of flags and parameters which can be unwieldy. This is where `wxSizerFlags` comes in: it allows you to specify all parameters using the named methods instead. For example, instead of

you can now write

This is more readable and also allows you to create `wxSizerFlags` objects which can be reused for several sizer items.

Note that by specification, all methods of `wxSizerFlags` return the `wxSizerFlags` object itself to allowing chaining multiple methods calls like in the examples above.

See: `wxSizer`

wxWidgets docs: wxSizerFlags

# Summary

## Types

wxSizerFlags()

## Functions

align(This, Alignment)

Sets the alignment of this `wxSizerFlags` to `align`.

border(This)
border/2

Sets the `wxSizerFlags` to have a border with size as returned by `GetDefaultBorder()` (not implemented in wx).

border(This, Direction, Borderinpixels)

Sets the `wxSizerFlags` to have a border of a number of pixels specified by `borderinpixels` with the directions specified by `direction`.

center(This)

Sets the object of the `wxSizerFlags` to center itself in the area it is given.

centre(This)

See: `center/1`.

destroy(This)

Destroys the object.

expand(This)

Sets the object of the `wxSizerFlags` to expand to fill as much area as it can.

left(This)

Aligns the object to the left, similar for `Align(wxALIGN_LEFT)`.

new()
new(Options)

Creates the `wxSizer` with the proportion specified by `proportion`.

proportion(This, Proportion)

Sets the proportion of this `wxSizerFlags` to `proportion`.

right(This)

Aligns the object to the right, similar for `Align(wxALIGN_RIGHT)`.

# Types

Link to this type

# wxSizerFlags()

View Source

    -type wxSizerFlags() :: wx:wx_object().

# Functions

Link to this function

# align(This, Alignment)

View Source

    -spec align(This, Alignment) -> wxSizerFlags() when This :: wxSizerFlags(), Alignment :: integer().

Sets the alignment of this `wxSizerFlags` to `align`.

This method replaces the previously set alignment with the specified one.

See: `Top()` (not implemented in wx), `left/1`, `right/1`, `Bottom()` (not implemented in wx), `centre/1`

Link to this function

# border(This)

View Source

    -spec border(This) -> wxSizerFlags() when This :: wxSizerFlags().

Link to this function

# border/2

View Source

    -spec border(This, [Option]) -> wxSizerFlags()
                    when This :: wxSizerFlags(), Option :: {direction, integer()}.

Sets the `wxSizerFlags` to have a border with size as returned by `GetDefaultBorder()` (not implemented in wx).

Link to this function

# border(This, Direction, Borderinpixels)

View Source

    -spec border(This, Direction, Borderinpixels) -> wxSizerFlags()
                    when This :: wxSizerFlags(), Direction :: integer(), Borderinpixels :: integer().

Sets the `wxSizerFlags` to have a border of a number of pixels specified by `borderinpixels` with the directions specified by `direction`.

Prefer to use the overload below or `DoubleBorder()` (not implemented in wx) or `TripleBorder()` (not implemented in wx) versions instead of hard-coding the border value in pixels to avoid too small borders on devices with high DPI displays.

Link to this function

# center(This)

View Source

    -spec center(This) -> wxSizerFlags() when This :: wxSizerFlags().

Sets the object of the `wxSizerFlags` to center itself in the area it is given.

Link to this function

# centre(This)

View Source

    -spec centre(This) -> wxSizerFlags() when This :: wxSizerFlags().

See: `center/1`.

Link to this function

# destroy(This)

View Source

    -spec destroy(This :: wxSizerFlags()) -> ok.

Destroys the object.

Link to this function

# expand(This)

View Source

    -spec expand(This) -> wxSizerFlags() when This :: wxSizerFlags().

Sets the object of the `wxSizerFlags` to expand to fill as much area as it can.

Link to this function

# left(This)

View Source

    -spec left(This) -> wxSizerFlags() when This :: wxSizerFlags().

Aligns the object to the left, similar for `Align(wxALIGN_LEFT)`.

Unlike `align/2`, this method doesn't change the vertical alignment of the item.

Link to this function

# new()

View Source

    -spec new() -> wxSizerFlags().

Link to this function

# new(Options)

View Source

    -spec new([Option]) -> wxSizerFlags() when Option :: {proportion, integer()}.

Creates the `wxSizer` with the proportion specified by `proportion`.

Link to this function

# proportion(This, Proportion)

View Source

    -spec proportion(This, Proportion) -> wxSizerFlags()
                        when This :: wxSizerFlags(), Proportion :: integer().

Sets the proportion of this `wxSizerFlags` to `proportion`.

Link to this function

# right(This)

View Source

    -spec right(This) -> wxSizerFlags() when This :: wxSizerFlags().

Aligns the object to the right, similar for `Align(wxALIGN_RIGHT)`.

Unlike `align/2`, this method doesn't change the vertical alignment of the item.