X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f81114dcd7b12f1fb965b8a8f57bd872028de20b..70708ad282d9061c301e896900907e917dc14850:/interface/wx/sizer.h?ds=sidebyside diff --git a/interface/wx/sizer.h b/interface/wx/sizer.h index f2e1d57a5e..cfd1dd841c 100644 --- a/interface/wx/sizer.h +++ b/interface/wx/sizer.h @@ -291,13 +291,15 @@ public: wxObject* userData = NULL); /** - Adds non-stretchable space to the sizer. + This base function adds non-stretchable space to both the horizontal + and vertical orientation of the sizer. More readable way of calling: @code wxSizer::Add(size, size, 0). @endcode + @see wxBoxSizer::AddSpacer() */ - wxSizerItem* AddSpacer(int size); + virtual wxSizerItem *AddSpacer(int size); /** Adds stretchable space to the sizer. @@ -783,35 +785,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. @@ -1611,20 +1606,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. @@ -1737,6 +1749,22 @@ public: */ wxBoxSizer(int orient); + /** + Adds non-stretchable space to the main orientation of the sizer only. + More readable way of calling: + @code + if ( wxBoxSizer::IsVertical() ) + { + wxBoxSizer::Add(0, size, 0). + } + else + { + wxBoxSizer::Add(size, 0, 0). + } + @endcode + */ + virtual wxSizerItem *AddSpacer(int size); + /** Implements the calculation of a box sizer's minimal.