]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/statbox.h
f4801e40bbf4c6aac010e4c7f9def63939200bb0
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxStaticBox
4 // Author: wxWidgets team
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
12 A static box is a rectangle drawn around other windows to denote
13 a logical grouping of items.
15 Note that while the previous versions required that windows appearing
16 inside a static box be created as its siblings (i.e. use the same parent as
17 the static box itself), since wxWidgets 2.9.1 it is also possible to create
18 them as children of wxStaticBox itself and you are actually encouraged to
19 do it like this if compatibility with the previous versions is not
22 So the new recommended way to create static box is:
24 void MyFrame::CreateControls()
26 wxPanel *panel = new wxPanel(this);
27 wxStaticBox *box = new wxStaticBox(panel, wxID_ANY, "StaticBox");
29 new wxStaticText(box, wxID_ANY "This window is a child of the staticbox");
34 While the compatible -- and now deprecated -- way is
36 wxStaticBox *box = new wxStaticBox(panel, wxID_ANY, "StaticBox");
38 new wxStaticText(panel, wxID_ANY "This window is a child of the panel");
42 Also note that there is a specialized wxSizer class (wxStaticBoxSizer) which can
43 be used as an easier way to pack items into a static box.
47 @appearance{staticbox}
49 @see wxStaticText, wxStaticBoxSizer
51 class wxStaticBox
: public wxControl
60 Constructor, creating and showing a static box.
63 Parent window. Must not be @NULL.
65 Window identifier. The value wxID_ANY indicates a default value.
67 Text to be displayed in the static box, the empty string for no label.
70 If ::wxDefaultPosition is specified then a default position is chosen.
73 If ::wxDefaultSize is specified then a default size is chosen.
75 Window style. See wxStaticBox.
81 wxStaticBox(wxWindow
* parent
, wxWindowID id
,
82 const wxString
& label
,
83 const wxPoint
& pos
= wxDefaultPosition
,
84 const wxSize
& size
= wxDefaultSize
,
86 const wxString
& name
= wxStaticBoxNameStr
);
89 Destructor, destroying the group box.
91 virtual ~wxStaticBox();
94 Creates the static box for two-step construction.
95 See wxStaticBox() for further details.
97 bool Create(wxWindow
* parent
, wxWindowID id
, const wxString
& label
,
98 const wxPoint
& pos
= wxDefaultPosition
,
99 const wxSize
& size
= wxDefaultSize
, long style
= 0,
100 const wxString
& name
= wxStaticBoxNameStr
);