]>
Commit | Line | Data |
---|---|---|
f6bcfd97 BP |
1 | \section{\class{wxFlexGridSizer}}\label{wxflexgridsizer} |
2 | ||
3 | A flex grid sizer is a sizer which lays out its children in a two-dimensional | |
f3cf3865 RD |
4 | table with all table fields in one row having the same |
5 | height and all fields in one column having the same width, but all | |
6 | rows or all columns are not necessarily the same height or width as in | |
7 | the \helpref{wxGridSizer}{wxgridsizer}. | |
f6bcfd97 | 8 | |
fc2171bd | 9 | Since wxWidgets 2.5.0, wxFlexGridSizer can also size items equally in one |
5d76f462 VZ |
10 | direction but unequally ("flexibly") in the other. If the sizer is only |
11 | flexible in one direction (this can be changed using | |
debc914b | 12 | \helpref{SetFlexibleDrection}{wxflexgridsizersetflexibledirection}), |
5d76f462 VZ |
13 | it needs to be decided how the sizer should grow in the other ("non flexible") |
14 | direction in order to fill the available space. The | |
15 | \helpref{SetNonFlexibleGrowMode}{wxflexgridsizersetnonflexiblegrowmode} method | |
16 | serves this purpose. | |
17 | ||
f6bcfd97 BP |
18 | \wxheading{Derived from} |
19 | ||
f3cf3865 | 20 | \helpref{wxGridSizer}{wxgridsizer}\\ |
f6bcfd97 BP |
21 | \helpref{wxSizer}{wxsizer}\\ |
22 | \helpref{wxObject}{wxobject} | |
23 | ||
0bf97466 RN |
24 | \wxheading{Include files} |
25 | ||
26 | <wx/sizer.h> | |
27 | ||
1c0c339c JS |
28 | \wxheading{See also} |
29 | ||
30 | \helpref{wxSizer}{wxsizer}, \helpref{Sizer overview}{sizeroverview} | |
31 | ||
5d76f462 | 32 | |
f6bcfd97 BP |
33 | \membersection{wxFlexGridSizer::wxFlexGridSizer}\label{wxflexgridsizerwxflexgridsizer} |
34 | ||
35 | \func{}{wxFlexGridSizer}{\param{int }{rows}, \param{int }{cols}, \param{int }{vgap}, \param{int }{hgap}} | |
36 | ||
37 | \func{}{wxFlexGridSizer}{\param{int }{cols}, \param{int }{vgap = 0}, \param{int }{hgap = 0}} | |
38 | ||
39 | Constructor for a wxGridSizer. {\it rows} and {\it cols} determine the number of | |
40 | columns and rows in the sizer - if either of the parameters is zero, it will be | |
41 | calculated to form the total number of children in the sizer, thus making the | |
42 | sizer grow dynamically. {\it vgap} and {\it hgap} define extra space between | |
43 | all children. | |
44 | ||
f3cf3865 RD |
45 | |
46 | \membersection{wxFlexGridSizer::AddGrowableCol}\label{wxflexgridsizeraddgrowablecol} | |
47 | ||
e8800dcf | 48 | \func{void}{AddGrowableCol}{\param{size\_t }{idx}, \param{int }{proportion = $0$}} |
f3cf3865 | 49 | |
e8800dcf | 50 | Specifies that column {\it idx} (starting from zero) should be grown if |
f3cf3865 RD |
51 | there is extra space available to the sizer. |
52 | ||
e8800dcf VZ |
53 | The {\it proportion} parameter has the same meaning as the stretch factor for |
54 | the \helpref{sizers}{sizeroverview} except that if all proportions are $0$, | |
55 | then all columns are resized equally (instead of not being resized at all). | |
56 | ||
f3cf3865 RD |
57 | \membersection{wxFlexGridSizer::AddGrowableRow}\label{wxflexgridsizeraddgrowablerow} |
58 | ||
e8800dcf | 59 | \func{void}{AddGrowableRow}{\param{size\_t }{idx}, \param{int }{proportion = $0$}} |
f3cf3865 RD |
60 | |
61 | Specifies that row idx (starting from zero) should be grown if there | |
62 | is extra space available to the sizer. | |
63 | ||
e8800dcf VZ |
64 | See \helpref{AddGrowableCol}{wxflexgridsizeraddgrowablecol} for the description |
65 | of {\it proportion} parameter. | |
66 | ||
5d76f462 VZ |
67 | \membersection{wxFlexGridSizer::GetFlexibleDirection}\label{wxflexgridsizergetflexibledrection} |
68 | ||
69 | \constfunc{int}{GetFlexibleDirections}{\void} | |
70 | ||
71 | Returns a wxOrientation value that specifies whether the sizer flexibly | |
72 | resizes its columns, rows, or both (default). | |
73 | ||
74 | \wxheading{Return value} | |
75 | ||
76 | One of the following values: | |
77 | ||
78 | \begin{twocollist} | |
79 | \twocolitem{wxVERTICAL}{Rows are flexibly sized.} | |
80 | \twocolitem{wxHORIZONTAL}{Columns are flexibly sized.} | |
81 | \twocolitem{wxBOTH}{Both rows and columns are flexibly sized (this is the default value).} | |
82 | \end{twocollist} | |
83 | ||
84 | \wxheading{See also} | |
85 | ||
debc914b | 86 | \helpref{SetFlexibleDrection}{wxflexgridsizersetflexibledirection} |
5d76f462 VZ |
87 | |
88 | ||
89 | \membersection{wxFlexGridSizer::GetNonFlexibleGrowMode}\label{wxflexgridsizergetnonflexiblegrowmode} | |
90 | ||
91 | \constfunc{int}{GetNonFlexibleGrowMode}{\void} | |
92 | ||
93 | Returns the value that specifies how the sizer grows in the "non flexible" | |
94 | direction if there is one. | |
95 | ||
96 | \wxheading{Return value} | |
97 | ||
98 | One of the following values: | |
99 | ||
100 | \begin{twocollist} | |
101 | \twocolitem{wxFLEX\_GROWMODE\_NONE}{Sizer doesn't grow in the non flexible direction.} | |
102 | \twocolitem{wxFLEX\_GROWMODE\_SPECIFIED}{Sizer honors growable columns/rows set with | |
103 | \helpref{AddGrowableCol}{wxflexgridsizeraddgrowablecol} and | |
104 | \helpref{AddGrowableRow}{wxflexgridsizeraddgrowablerow}. | |
105 | In this case equal sizing applies to minimum sizes of columns or | |
106 | rows (this is the default value).} | |
107 | \twocolitem{wxFLEX\_GROWMODE\_ALL}{Sizer equally stretches all columns or rows | |
108 | in the non flexible direction, whether they are growable or not in the flexbile | |
109 | direction.} | |
110 | \end{twocollist} | |
111 | ||
112 | \wxheading{See also} | |
113 | ||
debc914b | 114 | \helpref{SetFlexibleDrection}{wxflexgridsizersetflexibledirection}, |
5d76f462 VZ |
115 | \helpref{SetNonFlexibleGrowMode}{wxflexgridsizersetnonflexiblegrowmode} |
116 | ||
117 | ||
f3cf3865 RD |
118 | \membersection{wxFlexGridSizer::RemoveGrowableCol}\label{wxflexgridsizerremovegrowablecol} |
119 | ||
e7240349 | 120 | \func{void}{RemoveGrowableCol}{\param{size\_t }{idx}} |
f3cf3865 RD |
121 | |
122 | Specifies that column idx is no longer growable. | |
123 | ||
5d76f462 | 124 | |
f3cf3865 RD |
125 | \membersection{wxFlexGridSizer::RemoveGrowableRow}\label{wxflexgridsizerremovegrowablerow} |
126 | ||
e7240349 | 127 | \func{void}{RemoveGrowableRow}{\param{size\_t }{idx}} |
f3cf3865 RD |
128 | |
129 | Specifies that row idx is no longer growable. | |
130 | ||
5d76f462 | 131 | |
debc914b | 132 | \membersection{wxFlexGridSizer::SetFlexibleDirection}\label{wxflexgridsizersetflexibledirection} |
5d76f462 VZ |
133 | |
134 | \func{void}{SetFlexibleDirections}{\param{int }{direction}} | |
135 | ||
136 | Specifies whether the sizer should flexibly resize its columns, rows, or | |
eaf498df | 137 | both. Argument {\tt direction} can be {\tt wxVERTICAL}, {\tt wxHORIZONTAL} |
5d76f462 VZ |
138 | or {\tt wxBOTH} (which is the default value). Any other value is ignored. See |
139 | \helpref{GetFlexibleDirection()}{wxflexgridsizergetflexibledrection} for the | |
140 | explanation of these values. | |
141 | ||
142 | Note that this method does not trigger relayout. | |
143 | ||
144 | ||
debc914b | 145 | \membersection{wxFlexGridSizer::SetNonFlexibleGrowMode}\label{wxflexgridsizersetnonflexiblegrowmode} |
5d76f462 | 146 | |
f6e9a818 | 147 | \func{void}{SetNonFlexibleGrowMode}{\param{wxFlexSizerGrowMode }{mode}} |
5d76f462 VZ |
148 | |
149 | Specifies how the sizer should grow in the non flexible direction if | |
150 | there is one (so | |
debc914b | 151 | \helpref{SetFlexibleDirections()}{wxflexgridsizersetflexibledirection} must have |
5d76f462 VZ |
152 | been called previously). Argument {\it mode} can be one of those documented in |
153 | \helpref{GetNonFlexibleGrowMode}{wxflexgridsizergetnonflexiblegrowmode}, please | |
154 | see there for their explanation. | |
155 | ||
156 | Note that this method does not trigger relayout. | |
157 |