]>
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 | ||
e7240349 | 44 | \func{void}{AddGrowableCol}{\param{size\_t }{idx}} |
f3cf3865 RD |
45 | |
46 | Specifies that column idx (starting from zero) should be grown if | |
47 | there is extra space available to the sizer. | |
48 | ||
49 | \membersection{wxFlexGridSizer::AddGrowableRow}\label{wxflexgridsizeraddgrowablerow} | |
50 | ||
e7240349 | 51 | \func{void}{AddGrowableRow}{\param{size\_t }{idx}} |
f3cf3865 RD |
52 | |
53 | Specifies that row idx (starting from zero) should be grown if there | |
54 | is extra space available to the sizer. | |
55 | ||
5d76f462 VZ |
56 | \membersection{wxFlexGridSizer::GetFlexibleDirection}\label{wxflexgridsizergetflexibledrection} |
57 | ||
58 | \constfunc{int}{GetFlexibleDirections}{\void} | |
59 | ||
60 | Returns a wxOrientation value that specifies whether the sizer flexibly | |
61 | resizes its columns, rows, or both (default). | |
62 | ||
63 | \wxheading{Return value} | |
64 | ||
65 | One of the following values: | |
66 | ||
67 | \begin{twocollist} | |
68 | \twocolitem{wxVERTICAL}{Rows are flexibly sized.} | |
69 | \twocolitem{wxHORIZONTAL}{Columns are flexibly sized.} | |
70 | \twocolitem{wxBOTH}{Both rows and columns are flexibly sized (this is the default value).} | |
71 | \end{twocollist} | |
72 | ||
73 | \wxheading{See also} | |
74 | ||
debc914b | 75 | \helpref{SetFlexibleDrection}{wxflexgridsizersetflexibledirection} |
5d76f462 VZ |
76 | |
77 | ||
78 | \membersection{wxFlexGridSizer::GetNonFlexibleGrowMode}\label{wxflexgridsizergetnonflexiblegrowmode} | |
79 | ||
80 | \constfunc{int}{GetNonFlexibleGrowMode}{\void} | |
81 | ||
82 | Returns the value that specifies how the sizer grows in the "non flexible" | |
83 | direction if there is one. | |
84 | ||
85 | \wxheading{Return value} | |
86 | ||
87 | One of the following values: | |
88 | ||
89 | \begin{twocollist} | |
90 | \twocolitem{wxFLEX\_GROWMODE\_NONE}{Sizer doesn't grow in the non flexible direction.} | |
91 | \twocolitem{wxFLEX\_GROWMODE\_SPECIFIED}{Sizer honors growable columns/rows set with | |
92 | \helpref{AddGrowableCol}{wxflexgridsizeraddgrowablecol} and | |
93 | \helpref{AddGrowableRow}{wxflexgridsizeraddgrowablerow}. | |
94 | In this case equal sizing applies to minimum sizes of columns or | |
95 | rows (this is the default value).} | |
96 | \twocolitem{wxFLEX\_GROWMODE\_ALL}{Sizer equally stretches all columns or rows | |
97 | in the non flexible direction, whether they are growable or not in the flexbile | |
98 | direction.} | |
99 | \end{twocollist} | |
100 | ||
101 | \wxheading{See also} | |
102 | ||
debc914b | 103 | \helpref{SetFlexibleDrection}{wxflexgridsizersetflexibledirection}, |
5d76f462 VZ |
104 | \helpref{SetNonFlexibleGrowMode}{wxflexgridsizersetnonflexiblegrowmode} |
105 | ||
106 | ||
f3cf3865 RD |
107 | \membersection{wxFlexGridSizer::RemoveGrowableCol}\label{wxflexgridsizerremovegrowablecol} |
108 | ||
e7240349 | 109 | \func{void}{RemoveGrowableCol}{\param{size\_t }{idx}} |
f3cf3865 RD |
110 | |
111 | Specifies that column idx is no longer growable. | |
112 | ||
5d76f462 | 113 | |
f3cf3865 RD |
114 | \membersection{wxFlexGridSizer::RemoveGrowableRow}\label{wxflexgridsizerremovegrowablerow} |
115 | ||
e7240349 | 116 | \func{void}{RemoveGrowableRow}{\param{size\_t }{idx}} |
f3cf3865 RD |
117 | |
118 | Specifies that row idx is no longer growable. | |
119 | ||
5d76f462 | 120 | |
debc914b | 121 | \membersection{wxFlexGridSizer::SetFlexibleDirection}\label{wxflexgridsizersetflexibledirection} |
5d76f462 VZ |
122 | |
123 | \func{void}{SetFlexibleDirections}{\param{int }{direction}} | |
124 | ||
125 | Specifies whether the sizer should flexibly resize its columns, rows, or | |
eaf498df | 126 | both. Argument {\tt direction} can be {\tt wxVERTICAL}, {\tt wxHORIZONTAL} |
5d76f462 VZ |
127 | or {\tt wxBOTH} (which is the default value). Any other value is ignored. See |
128 | \helpref{GetFlexibleDirection()}{wxflexgridsizergetflexibledrection} for the | |
129 | explanation of these values. | |
130 | ||
131 | Note that this method does not trigger relayout. | |
132 | ||
133 | ||
debc914b | 134 | \membersection{wxFlexGridSizer::SetNonFlexibleGrowMode}\label{wxflexgridsizersetnonflexiblegrowmode} |
5d76f462 VZ |
135 | |
136 | \func{void}{SetNonFlexibleGrowMode}{\param{int }{mode}} | |
137 | ||
138 | Specifies how the sizer should grow in the non flexible direction if | |
139 | there is one (so | |
debc914b | 140 | \helpref{SetFlexibleDirections()}{wxflexgridsizersetflexibledirection} must have |
5d76f462 VZ |
141 | been called previously). Argument {\it mode} can be one of those documented in |
142 | \helpref{GetNonFlexibleGrowMode}{wxflexgridsizergetnonflexiblegrowmode}, please | |
143 | see there for their explanation. | |
144 | ||
145 | Note that this method does not trigger relayout. | |
146 |