]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/wrapsizer.h
Reverted format changes since 2.9 works differently
[wxWidgets.git] / interface / wx / wrapsizer.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: wrapsizer.h
e54c96f1 3// Purpose: interface of wxWrapSizer
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
526954c5 6// Licence: wxWindows licence
23324ae1
FM
7/////////////////////////////////////////////////////////////////////////////
8
50e55c13
RD
9// flags for wxWrapSizer
10enum
11{
12 wxEXTEND_LAST_ON_EACH_LINE,
13 wxREMOVE_LEADING_SPACES,
14 wxWRAPSIZER_DEFAULT_FLAGS
15};
16
23324ae1
FM
17/**
18 @class wxWrapSizer
7c913512
FM
19
20 A wrap sizer lays out its items in a single line, like a box sizer -- as long
f41d6c8c
FM
21 as there is space available in that direction.
22 Once all available space in the primary direction has been used, a new line
23 is added and items are added there.
7c913512 24
23324ae1 25 So a wrap sizer has a primary orientation for adding items, and adds lines
7c913512
FM
26 as needed in the secondary direction.
27
23324ae1
FM
28 @library{wxcore}
29 @category{winlayout}
7c913512 30
f41d6c8c 31 @see wxBoxSizer, wxSizer, @ref overview_sizer
23324ae1
FM
32*/
33class wxWrapSizer : public wxBoxSizer
34{
35public:
36 /**
f41d6c8c
FM
37 Constructor for a wxWrapSizer.
38
39 @a orient determines the primary direction of the sizer (the most common
40 case being @c wxHORIZONTAL). The flags parameter can be a combination of
41 the values @c wxEXTEND_LAST_ON_EACH_LINE which will cause the last item
42 on each line to use any remaining space on that line and @c wxREMOVE_LEADING_SPACES
43 which removes any spacer elements from the beginning of a row.
44
45 Both of these flags are on by default.
23324ae1 46 */
4fc3ee30 47 wxWrapSizer(int orient = wxHORIZONTAL,
95b4a59e 48 int flags = wxWRAPSIZER_DEFAULT_FLAGS);
23324ae1
FM
49
50 /**
f41d6c8c
FM
51 Not used by an application.
52
53 This is the mechanism by which sizers can inform sub-items of the first
54 determined size component.
55 The sub-item can then better determine its size requirements.
56
23324ae1
FM
57 Returns @true if the information was used (and the sub-item min size was
58 updated).
59 */
95b4a59e
FM
60 virtual bool InformFirstDirection(int direction, int size,
61 int availableOtherDir);
7106fc46
RD
62
63 virtual void RecalcSizes();
64 virtual wxSize CalcMin();
4fc3ee30
VZ
65
66protected:
67 /**
68 Can be overridden in the derived classes to treat some normal items as
69 spacers.
70
71 This method is used to determine whether the given @a item should be
72 considered to be a spacer for the purposes of @c wxREMOVE_LEADING_SPACES
73 implementation. By default only returns @true for the real spacers.
74 */
75 virtual bool IsSpaceItem(wxSizerItem *item) const;
23324ae1 76};
e54c96f1 77