2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wrapsizer.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxWrapSizer
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxWrapSizer
|
|
|
|
@wxheader{wrapsizer.h}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
|
|
|
A wrap sizer lays out its items in a single line, like a box sizer -- as long
|
|
|
|
as there is space available in that direction. Once all available space in
|
2008-03-08 08:52:38 -05:00
|
|
|
the primary direction has been used, a new line is added and items are added
|
|
|
|
there.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
So a wrap sizer has a primary orientation for adding items, and adds lines
|
2008-03-08 09:43:31 -05:00
|
|
|
as needed in the secondary direction.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{winlayout}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see wxBoxSizer, wxSizer, @ref overview_sizeroverview "Sizer overview"
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxWrapSizer : public wxBoxSizer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-03-09 08:33:59 -04:00
|
|
|
Constructor for a wxWrapSizer. @a orient determines the primary direction of
|
2008-03-08 08:52:38 -05:00
|
|
|
the sizer (the most common case being @c wxHORIZONTAL). The flags
|
2008-05-08 18:50:40 -04:00
|
|
|
parameter can be a combination of the values @c
|
|
|
|
wxEXTEND_LAST_ON_EACH_LINE which will cause the last item on each line
|
|
|
|
to use any remaining space on that line and @c wxREMOVE_LEADING_SPACES
|
|
|
|
which removes any spacer elements from the beginning of a row. Both of
|
|
|
|
these flags are on by default.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-05-08 18:50:40 -04:00
|
|
|
wxWrapSizer(int orient = wxHORIZONTAL,
|
|
|
|
int flags = wxEXTEND_LAST_ON_EACH_LINE |
|
|
|
|
wxREMOVE_LEADING_SPACES);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-08 09:43:31 -05:00
|
|
|
Not used by an application. This is the mechanism by which sizers can inform
|
2008-03-08 08:52:38 -05:00
|
|
|
sub-items of the first determined size component. The sub-item can then better
|
2008-03-08 09:43:31 -05:00
|
|
|
determine its size requirements.
|
2008-03-08 08:52:38 -05:00
|
|
|
Returns @true if the information was used (and the sub-item min size was
|
|
|
|
updated).
|
|
|
|
*/
|
|
|
|
bool InformFirstDirection(int direction, int size,
|
|
|
|
int availableOtherDir);
|
2008-05-08 18:50:40 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
/**
|
|
|
|
Can be overridden in the derived classes to treat some normal items as
|
|
|
|
spacers.
|
|
|
|
|
|
|
|
This method is used to determine whether the given @a item should be
|
|
|
|
considered to be a spacer for the purposes of @c wxREMOVE_LEADING_SPACES
|
|
|
|
implementation. By default only returns @true for the real spacers.
|
|
|
|
*/
|
|
|
|
virtual bool IsSpaceItem(wxSizerItem *item) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|