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