]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/flexsizr.tex
c27734f92c187089d9384622e7ba705df5cdd47e
[wxWidgets.git] / docs / latex / wx / flexsizr.tex
1 \section{\class{wxFlexGridSizer}}\label{wxflexgridsizer}
2
3 A flex grid sizer is a sizer which lays out its children in a two-dimensional
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}.
8
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
12 \helpref{SetFlexibleDrection}{wxflexgridsizersetflexibledrection}),
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
18 \wxheading{Derived from}
19
20 \helpref{wxGridSizer}{wxgridsizer}\\
21 \helpref{wxSizer}{wxsizer}\\
22 \helpref{wxObject}{wxobject}
23
24 \wxheading{See also}
25
26 \helpref{wxSizer}{wxsizer}, \helpref{Sizer overview}{sizeroverview}
27
28
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
41
42 \membersection{wxFlexGridSizer::AddGrowableCol}\label{wxflexgridsizeraddgrowablecol}
43
44 \func{void}{AddGrowableCol}{\param{size\_t }{idx}}
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
51 \func{void}{AddGrowableRow}{\param{size\_t }{idx}}
52
53 Specifies that row idx (starting from zero) should be grown if there
54 is extra space available to the sizer.
55
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
75 \helpref{SetFlexibleDrection}{wxflexgridsizersetflexibledrection}
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
103 \helpref{SetFlexibleDrection}{wxflexgridsizersetflexibledrection},
104 \helpref{SetNonFlexibleGrowMode}{wxflexgridsizersetnonflexiblegrowmode}
105
106
107 \membersection{wxFlexGridSizer::RemoveGrowableCol}\label{wxflexgridsizerremovegrowablecol}
108
109 \func{void}{RemoveGrowableCol}{\param{size\_t }{idx}}
110
111 Specifies that column idx is no longer growable.
112
113
114 \membersection{wxFlexGridSizer::RemoveGrowableRow}\label{wxflexgridsizerremovegrowablerow}
115
116 \func{void}{RemoveGrowableRow}{\param{size\_t }{idx}}
117
118 Specifies that row idx is no longer growable.
119
120
121 \membersection{wxFlexGridSizer::SetFlexibleDirection}{wxflexgridsizersetflexibledrection}
122
123 \func{void}{SetFlexibleDirections}{\param{int }{direction}}
124
125 Specifies whether the sizer should flexibly resize its columns, rows, or
126 both. Argument {\tt direction} can be {\tt wxVERTICAL}, {\tt wxHORIZONTAL}
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
134 \membersection{wxFlexGridSizer::SetNonFlexibleGrowMode}{wxflexgridsizersetnonflexiblegrowmode}
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
140 \helpref{SetFlexibleDirections()}{wxflexgridsizersetflexibledrection} must have
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