#include <wx/sizer.h>
wxStaticBoxSizer is a sizer derived from wxBoxSizer but adds a static box around the sizer.
The static box may be either created independently or the sizer may create it itself as a convenience. In any case, the sizer owns the wxStaticBox control and will delete it in the wxStaticBoxSizer destructor.
Note that since wxWidgets 2.9.1 you are encouraged to create the windows which are added to wxStaticBoxSizer as children of wxStaticBox itself, see this class documentation for more details.
Example of use of this class:
void MyFrame::CreateControls() { wxPanel *panel = new wxPanel(this); ... wxStaticBoxSizer *sz = new wxStaticBoxSizer(wxVERTICAL, panel, "Box"); sz->Add(new wxStaticText(sz->GetStaticBox(), wxID_ANY, "This window is a child of the staticbox")); ... }
Public Member Functions | |
wxStaticBoxSizer (wxStaticBox *box, int orient) | |
This constructor uses an already existing static box. | |
wxStaticBoxSizer (int orient, wxWindow *parent, const wxString &label=wxEmptyString) | |
This constructor creates a new static box with the given label and parent window. | |
wxStaticBox * | GetStaticBox () const |
Returns the static box associated with the sizer. |
wxStaticBoxSizer::wxStaticBoxSizer | ( | wxStaticBox * | box, | |
int | orient | |||
) |
This constructor uses an already existing static box.
box | The static box to associate with the sizer (which will take its ownership). | |
orient | Can be either wxVERTICAL or wxHORIZONTAL . |
wxStaticBoxSizer::wxStaticBoxSizer | ( | int | orient, | |
wxWindow * | parent, | |||
const wxString & | label = wxEmptyString | |||
) |
This constructor creates a new static box with the given label and parent window.
wxStaticBox* wxStaticBoxSizer::GetStaticBox | ( | ) | const |
Returns the static box associated with the sizer.
![]() |
[ top ] |