X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ae3c17b4013e80b99976c750c19fca47729517f6..5b88a837ba75928cd3835a6b97ae2bf5ad983a6e:/interface/wx/statbox.h?ds=sidebyside diff --git a/interface/wx/statbox.h b/interface/wx/statbox.h index b6719749cb..ff31baeeb4 100644 --- a/interface/wx/statbox.h +++ b/interface/wx/statbox.h @@ -8,26 +8,32 @@ /** @class wxStaticBox - @wxheader{statbox.h} - A static box is a rectangle drawn around other panel items to denote + A static box is a rectangle drawn around other windows to denote a logical grouping of items. - Please note that a static box should @b not be used as the parent for the - controls it contains, instead they should be siblings of each other. Although - using a static box as a parent might work in some versions of wxWidgets, it - results in a crash under, for example, wxGTK. + Note that since wxWidgets 2.9.0 you are encouraged to build the windows which are + placed inside wxStaticBoxes as children of the wxStaticBox itself: + @code + ... + wxStaticBox *stbox = new wxStaticBox(parentWindow, wxID_ANY, "StaticBox"); - Also, please note that because of this, the order in which you create new - controls is important. Create your wxStaticBox control @b before any - siblings that are to appear inside the wxStaticBox in order to preserve the - correct Z-Order of controls. + new wxStaticText(stbox, "This window is a child of the staticbox"); + ... + @endcode + + Creating the windows which are placed inside wxStaticBoxes as siblings of the + wxStaticBox is still allowed but it's deprecated as it gives some problems + (e.g. relative to tooltips) on some ports. + + 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. @library{wxcore} @category{ctrl} - + @appearance{staticbox.png} - @see wxStaticText + @see wxStaticText, wxStaticBoxSizer */ class wxStaticBox : public wxControl { @@ -36,7 +42,7 @@ public: Default constructor */ wxStaticBox(); - + /** Constructor, creating and showing a static box. @@ -47,11 +53,11 @@ public: @param label Text to be displayed in the static box, the empty string for no label. @param pos - Window position. If wxDefaultPosition is specified then a default - position is chosen. + Window position. + If ::wxDefaultPosition is specified then a default position is chosen. @param size - Checkbox size. If the size (-1, -1) is specified then a default size is - chosen. + Checkbox size. + If ::wxDefaultSize is specified then a default size is chosen. @param style Window style. See wxStaticBox. @param name @@ -64,22 +70,20 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = "staticBox"); + const wxString& name = wxStaticBoxNameStr); /** Destructor, destroying the group box. */ - ~wxStaticBox(); + virtual ~wxStaticBox(); /** - Creates the static box for two-step construction. See wxStaticBox() - for further details. + Creates the static box for two-step construction. + See wxStaticBox() for further details. */ - bool Create(wxWindow* parent, wxWindowID id, - const wxString& label, + bool Create(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxString& name = "staticBox"); + const wxSize& size = wxDefaultSize, long style = 0, + const wxString& name = wxStaticBoxNameStr); };