X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/338c3ec73a968e4b2a399b90928220b5cf95c41c..474e9711477a5737b232435525da1c87f7eb72d2:/interface/wx/sizer.h?ds=sidebyside diff --git a/interface/wx/sizer.h b/interface/wx/sizer.h index 2296c39f61..1423c6d485 100644 --- a/interface/wx/sizer.h +++ b/interface/wx/sizer.h @@ -568,7 +568,7 @@ public: /** Inserts non-stretchable space to the sizer. - More readable way of calling wxSizer::Insert(size, size, 0). + More readable way of calling wxSizer::Insert(index, size, size). */ wxSizerItem* InsertSpacer(size_t index, int size); @@ -783,35 +783,28 @@ public: /** Set an item's minimum size by window, sizer, or position. - The item will be found recursively in the sizer's descendants. This function enables an application to set the size of an item after initial creation. + The @a window or @a sizer will be found recursively in the sizer's + descendants. + @see wxSizerItem::SetMinSize() + + @return + @true if the minimal size was successfully set or @false if the + item was not found. */ + //@{ bool SetItemMinSize(wxWindow* window, int width, int height); + bool SetItemMinSize(wxWindow* window, const wxSize& size); - /** - Set an item's minimum size by window, sizer, or position. - - The item will be found recursively in the sizer's descendants. - This function enables an application to set the size of an item after - initial creation. - - @see wxSizerItem::SetMinSize() - */ bool SetItemMinSize(wxSizer* sizer, int width, int height); + bool SetItemMinSize(wxSizer* sizer, const wxSize& size); - /** - Set an item's minimum size by window, sizer, or position. - - The item will be found recursively in the sizer's descendants. - This function enables an application to set the size of an item after - initial creation. - - @see wxSizerItem::SetMinSize() - */ bool SetItemMinSize(size_t index, int width, int height); + bool SetItemMinSize(size_t index, const wxSize& size); + //@} /** Call this to give the sizer a minimal size. @@ -1435,17 +1428,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. + + 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. - @a vgap and @a hgap define extra space between all children. + @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 ); //@} /** @@ -1601,20 +1604,37 @@ public: wxGridSizer( int rows, int cols, const wxSize& gap ); //@} + //@{ /** - Returns the number of columns in the sizer. + Returns the number of columns or rows that has been specified for the + sizer. + + Returns zero if the sizer is automatically adjusting the number of + columns/rows depending on number of its children. To get the effective + number of columns or rows being currently used, see + GetEffectiveColsCount() and GetEffectiveRowsCount(). */ int GetCols() const; + int GetRows() const; + //@} + //@{ /** - Returns the horizontal gap (in pixels) between cells in the sizer. + Returns the number of columns or rows currently used by the sizer. + + This will depend on the number of children the sizer has if + the sizer is automatically adjusting the number of columns/rows. + + @since 2.9.1 */ - int GetHGap() const; + int GetEffectiveColsCount() const; + int GetEffectiveRowsCount() const; + //@} /** - Returns the number of rows in the sizer. + Returns the horizontal gap (in pixels) between cells in the sizer. */ - int GetRows() const; + int GetHGap() const; /** Returns the vertical gap (in pixels) between the cells in the sizer.