Version: 2.9.4
Public Member Functions
wxStaticBoxSizer Class Reference

#include <wx/sizer.h>

Inheritance diagram for wxStaticBoxSizer:

Detailed Description

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"));
            ...
        }

Library:  wxCore
Category:  Window Layout
See also:
wxSizer, wxStaticBox, wxBoxSizer, Sizers Overview

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.
wxStaticBoxGetStaticBox () const
 Returns the static box associated with the sizer.
virtual wxSize CalcMin ()
 Implements the calculation of a box sizer's minimal.
virtual void RecalcSizes ()
 Implements the calculation of a box sizer's dimensions and then sets the size of its children (calling wxWindow::SetSize if the child is a window).

List of all members.


Constructor & Destructor Documentation

wxStaticBoxSizer::wxStaticBoxSizer ( wxStaticBox box,
int  orient 
)

This constructor uses an already existing static box.

Parameters:
boxThe static box to associate with the sizer (which will take its ownership).
orientCan 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.


Member Function Documentation

virtual wxSize wxStaticBoxSizer::CalcMin ( ) [virtual]

Implements the calculation of a box sizer's minimal.

It is used internally only and must not be called by the user. Documented for information.

Reimplemented from wxBoxSizer.

wxStaticBox* wxStaticBoxSizer::GetStaticBox ( ) const

Returns the static box associated with the sizer.

virtual void wxStaticBoxSizer::RecalcSizes ( ) [virtual]

Implements the calculation of a box sizer's dimensions and then sets the size of its children (calling wxWindow::SetSize if the child is a window).

It is used internally only and must not be called by the user (call Layout() if you want to resize). Documented for information.

Reimplemented from wxBoxSizer.