- wxStaticBoxSizer is a sizer derived from wxBoxSizer but adds a static
- box around the sizer.
- This 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, if it is deleted.
+ 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:
+ @code
+ 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"));
+ ...
+ }
+ @endcode