wxsizerflagsnormally, 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
sizer->add(ctrl, 0, wxexpand | wxborder, 10);you can now write
sizer->add(ctrl, wxsizerflags().expand().border(10));this is more readable and also allows you to create wxsizerflags objects which can be reused for several sizer items. wxsizerflags flagsexpand(1); flagsexpand.expand().border(10); sizer->add(ctrl1, flagsexpand); sizer->add(ctrl2, flagsexpand);note that by specification, all methods of wxsizerflags return the wxsizerflags object itself to allowing chaining multiple methods calls like in the examples above.
wxsizerflags::wxsizerflags
wxsizerflags::wxsizerflagswxsizerflags(int proportion = 0) creates the wxsizer with the proportion specified by proportion.
wxsizerflags::alignwxsizerflags& align(int align = 0) sets the alignment of this wxsizerflags to align. note that if this method is not called, the wxsizerflags has no specified alignment. see also
wxsizerflags::borderwxsizerflags& border(int direction, int borderinpixels) wxsizerflags& border(int direction = wxall) sets the wxsizerflags to have a border of a number of pixels specified by borderinpixels with the directions specified by direction. in the overloaded version without borderinpixels parameter, the border of default size, as returned by getdefaultborder, is used.
wxsizerflags::centerwxsizerflags& center() sets the object of the wxsizerflags to center itself in the area it is given.
wxsizerflags::centrewxsizerflags& centre() wxsizerflags::center for people with the other dialect of english.
wxsizerflags::doubleborderwxsizerflags& doubleborder(int direction = wxall) sets the border in the given direction having twice the default border size.
wxsizerflags::doublehorzborderwxsizerflags& doublehorzborder() sets the border in left and right directions having twice the default border size.
wxsizerflags::expandwxsizerflags& expand() sets the object of the wxsizerflags to expand to fill as much area as it can.
wxsizerflags::getdefaultborderstatic int getdefaultborder() returns the border used by default in border method.
wxsizerflags::leftwxsizerflags& left() aligns the object to the left, shortcut for align(wxalign_left) see also
wxsizerflags::fixedminsizewxsizerflags& fixedminsize() set the wxfixed_minsize flag which indicates that the initial size of the window should be also set as its minimal size.
wxsizerflags::proportionwxsizerflags& proportion(int proportion = 0) sets the proportion of this wxsizerflags to proportion
wxsizerflags::rightwxsizerflags& right() aligns the object to the right, shortcut for align(wxalign_right) see also
wxsizerflags::shapedwxsizerflags& 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::tripleborderwxsizerflags& tripleborder(int direction = wxall) sets the border in the given direction having thrice the default border size.
|