2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: statbox.h
|
2008-03-10 15:24:38 +00:00
|
|
|
// Purpose: interface of wxStaticBox
|
2008-03-08 13:52:38 +00:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
2010-07-13 13:29:13 +00:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxStaticBox
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2009-04-19 19:46:36 +00:00
|
|
|
A static box is a rectangle drawn around other windows to denote
|
2008-03-08 13:52:38 +00:00
|
|
|
a logical grouping of items.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2009-08-07 12:39:41 +00:00
|
|
|
Note that while the previous versions required that windows appearing
|
|
|
|
inside a static box be created as its siblings (i.e. use the same parent as
|
|
|
|
the static box itself), since wxWidgets 2.9.1 it is also possible to create
|
|
|
|
them as children of wxStaticBox itself and you are actually encouraged to
|
|
|
|
do it like this if compatibility with the previous versions is not
|
|
|
|
important.
|
|
|
|
|
|
|
|
So the new recommended way to create static box is:
|
|
|
|
@code
|
|
|
|
void MyFrame::CreateControls()
|
|
|
|
{
|
|
|
|
wxPanel *panel = new wxPanel(this);
|
|
|
|
wxStaticBox *box = new wxStaticBox(panel, wxID_ANY, "StaticBox");
|
|
|
|
|
|
|
|
new wxStaticText(box, wxID_ANY "This window is a child of the staticbox");
|
|
|
|
...
|
|
|
|
}
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
While the compatible -- and now deprecated -- way is
|
2009-04-25 10:49:36 +00:00
|
|
|
@code
|
2009-08-07 12:39:41 +00:00
|
|
|
wxStaticBox *box = new wxStaticBox(panel, wxID_ANY, "StaticBox");
|
2009-04-25 10:49:36 +00:00
|
|
|
|
2009-08-07 12:39:41 +00:00
|
|
|
new wxStaticText(panel, wxID_ANY "This window is a child of the panel");
|
|
|
|
...
|
2009-04-25 10:49:36 +00:00
|
|
|
@endcode
|
2009-08-07 12:39:41 +00:00
|
|
|
|
2009-04-25 10:49:36 +00:00
|
|
|
Also note that there is a specialized wxSizer class (wxStaticBoxSizer) which can
|
|
|
|
be used as an easier way to pack items into a static box.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
|
|
|
@category{ctrl}
|
2008-10-13 08:05:18 +00:00
|
|
|
@appearance{staticbox.png}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2009-04-19 19:46:36 +00:00
|
|
|
@see wxStaticText, wxStaticBoxSizer
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxStaticBox : public wxControl
|
|
|
|
{
|
|
|
|
public:
|
2008-05-29 14:10:52 +00:00
|
|
|
/**
|
|
|
|
Default constructor
|
|
|
|
*/
|
|
|
|
wxStaticBox();
|
2008-10-07 16:57:34 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
Constructor, creating and showing a static box.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param parent
|
2008-03-09 12:33:59 +00:00
|
|
|
Parent window. Must not be @NULL.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param id
|
2008-03-09 12:33:59 +00:00
|
|
|
Window identifier. The value wxID_ANY indicates a default value.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param label
|
2008-03-09 12:33:59 +00:00
|
|
|
Text to be displayed in the static box, the empty string for no label.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param pos
|
2008-10-07 16:57:34 +00:00
|
|
|
Window position.
|
2009-04-19 19:46:36 +00:00
|
|
|
If ::wxDefaultPosition is specified then a default position is chosen.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param size
|
2008-10-07 16:57:34 +00:00
|
|
|
Checkbox size.
|
2009-04-19 19:46:36 +00:00
|
|
|
If ::wxDefaultSize is specified then a default size is chosen.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param style
|
2008-03-09 12:33:59 +00:00
|
|
|
Window style. See wxStaticBox.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param name
|
2008-03-09 12:33:59 +00:00
|
|
|
Window name.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see Create()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-08 14:43:31 +00:00
|
|
|
wxStaticBox(wxWindow* parent, wxWindowID id,
|
|
|
|
const wxString& label,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
2008-11-13 21:32:53 +00:00
|
|
|
const wxString& name = wxStaticBoxNameStr);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor, destroying the group box.
|
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual ~wxStaticBox();
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-10-07 16:57:34 +00:00
|
|
|
Creates the static box for two-step construction.
|
|
|
|
See wxStaticBox() for further details.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-10-29 15:34:31 +00:00
|
|
|
bool Create(wxWindow* parent, wxWindowID id, const wxString& label,
|
2008-03-08 13:52:38 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
2008-10-29 15:34:31 +00:00
|
|
|
const wxSize& size = wxDefaultSize, long style = 0,
|
|
|
|
const wxString& name = wxStaticBoxNameStr);
|
2008-03-08 13:52:38 +00:00
|
|
|
};
|
2008-03-10 15:24:38 +00:00
|
|
|
|