#include <wx/sizer.h>
Container for sizer items flags providing readable names for them.
Normally, when you add an item to a sizer via wxSizer::Add, 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.
Public Member Functions | |
wxSizerFlags (int proportion=0) | |
Creates the wxSizer with the proportion specified by proportion. More... | |
wxSizerFlags & | Align (int alignment) |
Sets the alignment of this wxSizerFlags to align. More... | |
wxSizerFlags & | Border (int direction, int borderinpixels) |
Sets the wxSizerFlags to have a border of a number of pixels specified by borderinpixels with the directions specified by direction. More... | |
wxSizerFlags & | Border (int direction=wxALL) |
Sets the wxSizerFlags to have a border with size as returned by GetDefaultBorder(). More... | |
wxSizerFlags & | Bottom () |
Aligns the object to the bottom, similar for Align(wxALIGN_BOTTOM) . More... | |
wxSizerFlags & | Center () |
Sets the object of the wxSizerFlags to center itself in the area it is given. More... | |
wxSizerFlags & | Centre () |
Center() for people with the other dialect of English. More... | |
wxSizerFlags & | DoubleBorder (int direction=wxALL) |
Sets the border in the given direction having twice the default border size. More... | |
wxSizerFlags & | DoubleHorzBorder () |
Sets the border in left and right directions having twice the default border size. More... | |
wxSizerFlags & | Expand () |
Sets the object of the wxSizerFlags to expand to fill as much area as it can. More... | |
wxSizerFlags & | FixedMinSize () |
Set the wxFIXED_MINSIZE flag which indicates that the initial size of the window should be also set as its minimal size. More... | |
wxSizerFlags & | ReserveSpaceEvenIfHidden () |
Set the wxRESERVE_SPACE_EVEN_IF_HIDDEN flag. More... | |
wxSizerFlags & | Left () |
Aligns the object to the left, similar for Align(wxALIGN_LEFT) . More... | |
wxSizerFlags & | Proportion (int proportion) |
Sets the proportion of this wxSizerFlags to proportion. More... | |
wxSizerFlags & | Right () |
Aligns the object to the right, similar for Align(wxALIGN_RIGHT) . More... | |
wxSizerFlags & | Shaped () |
Set the wx_SHAPED flag which indicates that the elements should always keep the fixed width to height ratio equal to its original value. More... | |
wxSizerFlags & | Top () |
Aligns the object to the top, similar for Align(wxALIGN_TOP) . More... | |
wxSizerFlags & | TripleBorder (int direction=wxALL) |
Sets the border in the given direction having thrice the default border size. More... | |
Static Public Member Functions | |
static int | GetDefaultBorder () |
Returns the border used by default in Border() method. More... | |
wxSizerFlags::wxSizerFlags | ( | int | proportion = 0 | ) |
Creates the wxSizer with the proportion specified by proportion.
wxSizerFlags& wxSizerFlags::Align | ( | int | alignment | ) |
wxSizerFlags& wxSizerFlags::Border | ( | int | direction, |
int | borderinpixels | ||
) |
Sets the wxSizerFlags to have a border of a number of pixels specified by borderinpixels with the directions specified by direction.
wxSizerFlags& wxSizerFlags::Border | ( | int | direction = wxALL | ) |
Sets the wxSizerFlags to have a border with size as returned by GetDefaultBorder().
direction | Direction(s) to apply the border in. |
wxSizerFlags& wxSizerFlags::Bottom | ( | ) |
Aligns the object to the bottom, similar for Align(wxALIGN_BOTTOM)
.
Unlike Align(), this method doesn't change the horizontal alignment of the item.
wxSizerFlags& wxSizerFlags::Center | ( | ) |
Sets the object of the wxSizerFlags to center itself in the area it is given.
wxSizerFlags& wxSizerFlags::Centre | ( | ) |
Center() for people with the other dialect of English.
wxSizerFlags& wxSizerFlags::DoubleBorder | ( | int | direction = wxALL | ) |
Sets the border in the given direction having twice the default border size.
wxSizerFlags& wxSizerFlags::DoubleHorzBorder | ( | ) |
Sets the border in left and right directions having twice the default border size.
wxSizerFlags& wxSizerFlags::Expand | ( | ) |
Sets the object of the wxSizerFlags to expand to fill as much area as it can.
wxSizerFlags& wxSizerFlags::FixedMinSize | ( | ) |
Set the wxFIXED_MINSIZE
flag which indicates that the initial size of the window should be also set as its minimal size.
|
static |
Returns the border used by default in Border() method.
wxSizerFlags& wxSizerFlags::Left | ( | ) |
Aligns the object to the left, similar for Align(wxALIGN_LEFT)
.
Unlike Align(), this method doesn't change the vertical alignment of the item.
wxSizerFlags& wxSizerFlags::Proportion | ( | int | proportion | ) |
Sets the proportion of this wxSizerFlags to proportion.
wxSizerFlags& wxSizerFlags::ReserveSpaceEvenIfHidden | ( | ) |
Set the wxRESERVE_SPACE_EVEN_IF_HIDDEN
flag.
Normally wxSizers don't allocate space for hidden windows or other items. This flag overrides this behaviour so that sufficient space is allocated for the window even if it isn't visible. This makes it possible to dynamically show and hide controls without resizing parent dialog, for example.
wxSizerFlags& wxSizerFlags::Right | ( | ) |
Aligns the object to the right, similar for Align(wxALIGN_RIGHT)
.
Unlike Align(), this method doesn't change the vertical alignment of the item.
wxSizerFlags& wxSizerFlags::Shaped | ( | ) |
Set the wx_SHAPED
flag which indicates that the elements should always keep the fixed width to height ratio equal to its original value.
wxSizerFlags& wxSizerFlags::Top | ( | ) |
Aligns the object to the top, similar for Align(wxALIGN_TOP)
.
Unlike Align(), this method doesn't change the horizontal alignment of the item.
wxSizerFlags& wxSizerFlags::TripleBorder | ( | int | direction = wxALL | ) |
Sets the border in the given direction having thrice the default border size.