]> git.saurik.com Git - wxWidgets.git/blobdiff - interface/wx/sizer.h
Use "non-negative" in assert message instead of "positive".
[wxWidgets.git] / interface / wx / sizer.h
index 2e37e10f9d807e54e69a3259348cfbd8132afcb1..886ba9ddb0d768a8e76365015044fbea02986813 100644 (file)
@@ -1435,17 +1435,27 @@ class wxFlexGridSizer : public wxGridSizer
 public:
     //@{
     /**
-        Constructor for a wxFlexGridSizer.
+        wxFlexGridSizer constructors.
 
-        @a rows and @a cols determine the number of columns and rows in the sizer -
-        if either of the parameters is zero, it will be calculated to form the
-        total number of children in the sizer, thus making the sizer grow
-        dynamically.
+        Usually only the number of columns in the flex grid sizer needs to be
+        specified using @a cols argument. The number of rows will be deduced
+        automatically depending on the number of the elements added to the
+        sizer. If the number of @a rows is explicitly specified (and not zero),
+        the sizer will check that it no more than @code cols*rows @endcode
+        elements are added to it.
 
-        @a vgap and @a hgap define extra space between all children.
+        The @a gap (or @a vgap and @a hgap, which correspond to the height and
+        width of the wxSize object) argument defines the size of the padding
+        between the rows (its vertical component, or @a vgap) and columns
+        (its horizontal component, or @a hgap), in pixels.
+
+        @since 2.9.1 (except for the four argument overload)
     */
-    wxFlexGridSizer(int rows, int cols, int vgap, int hgap);
-    wxFlexGridSizer(int cols, int vgap = 0, int hgap = 0);
+    wxFlexGridSizer( int cols, int vgap, int hgap );
+    wxFlexGridSizer( int cols, const wxSize& gap = wxSize(0, 0) );
+
+    wxFlexGridSizer( int rows, int cols, int vgap, int hgap );
+    wxFlexGridSizer( int rows, int cols, const wxSize& gap );
     //@}
 
     /**
@@ -1578,16 +1588,27 @@ class wxGridSizer : public wxSizer
 public:
     //@{
     /**
-        Constructor for a wxGridSizer.
+        wxGridSizer constructors.
 
-        @a rows and @a cols determine the number of columns and rows in the sizer -
-        if either of the parameters is zero, it will be calculated to form the
-        total number of children in the sizer, thus making the sizer grow dynamically.
+        Usually only the number of columns in the grid sizer needs to be
+        specified using @a cols argument. The number of rows will be deduced
+        automatically depending on the number of the elements added to the
+        sizer. If the number of @a rows is explicitly specified (and not zero),
+        the sizer will check that it no more than @code cols*rows @endcode
+        elements are added to it.
 
-        @a vgap and @a hgap define extra space between all children.
+        The @a gap (or @a vgap and @a hgap, which correspond to @c y and @c x
+        fields of the wxSize object) argument defines the size of the padding
+        between the grid rows (its vertical component, or @a vgap) and columns
+        (its horizontal component, or @a hgap), in pixels.
+
+        @since 2.9.1 (except for the four argument overload)
     */
-    wxGridSizer(int rows, int cols, int vgap, int hgap);
-    wxGridSizer(int cols, int vgap = 0, int hgap = 0);
+    wxGridSizer( int cols, int vgap, int hgap );
+    wxGridSizer( int cols, const wxSize& gap = wxSize(0, 0) );
+
+    wxGridSizer( int rows, int cols, int vgap, int hgap );
+    wxGridSizer( int rows, int cols, const wxSize& gap );
     //@}
 
     /**
@@ -1636,13 +1657,30 @@ public:
 /**
     @class wxStaticBoxSizer
 
-    wxStaticBoxSizer is a sizer derived from wxBoxSizer but adds a static box around 
+    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 
+    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
+
     @library{wxcore}
     @category{winlayout}