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