]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/flexsizr.tex
define NO_GCC_PRAGMA in wx-config output on Darwin
[wxWidgets.git] / docs / latex / wx / flexsizr.tex
... / ...
CommitLineData
1\section{\class{wxFlexGridSizer}}\label{wxflexgridsizer}
2
3A flex grid sizer is a sizer which lays out its children in a two-dimensional
4table with all table fields in one row having the same
5height and all fields in one column having the same width, but all
6rows or all columns are not necessarily the same height or width as in
7the \helpref{wxGridSizer}{wxgridsizer}.
8
9Since wxWindows 2.5.0, wxFlexGridSizer can also size items equally in one
10direction but unequally ("flexibly") in the other. If the sizer is only
11flexible in one direction (this can be changed using
12\helpref{SetFlexibleDrection}{wxflexgridsizersetflexibledirection}),
13it needs to be decided how the sizer should grow in the other ("non flexible")
14direction in order to fill the available space. The
15\helpref{SetNonFlexibleGrowMode}{wxflexgridsizersetnonflexiblegrowmode} method
16serves 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
35Constructor for a wxGridSizer. {\it rows} and {\it cols} determine the number of
36columns and rows in the sizer - if either of the parameters is zero, it will be
37calculated to form the total number of children in the sizer, thus making the
38sizer grow dynamically. {\it vgap} and {\it hgap} define extra space between
39all children.
40
41
42\membersection{wxFlexGridSizer::AddGrowableCol}\label{wxflexgridsizeraddgrowablecol}
43
44\func{void}{AddGrowableCol}{\param{size\_t }{idx}, \param{int }{proportion = $0$}}
45
46Specifies that column {\it idx} (starting from zero) should be grown if
47there is extra space available to the sizer.
48
49The {\it proportion} parameter has the same meaning as the stretch factor for
50the \helpref{sizers}{sizeroverview} except that if all proportions are $0$,
51then all columns are resized equally (instead of not being resized at all).
52
53\membersection{wxFlexGridSizer::AddGrowableRow}\label{wxflexgridsizeraddgrowablerow}
54
55\func{void}{AddGrowableRow}{\param{size\_t }{idx}, \param{int }{proportion = $0$}}
56
57Specifies that row idx (starting from zero) should be grown if there
58is extra space available to the sizer.
59
60See \helpref{AddGrowableCol}{wxflexgridsizeraddgrowablecol} for the description
61of {\it proportion} parameter.
62
63\membersection{wxFlexGridSizer::GetFlexibleDirection}\label{wxflexgridsizergetflexibledrection}
64
65\constfunc{int}{GetFlexibleDirections}{\void}
66
67Returns a wxOrientation value that specifies whether the sizer flexibly
68resizes its columns, rows, or both (default).
69
70\wxheading{Return value}
71
72One 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
82\helpref{SetFlexibleDrection}{wxflexgridsizersetflexibledirection}
83
84
85\membersection{wxFlexGridSizer::GetNonFlexibleGrowMode}\label{wxflexgridsizergetnonflexiblegrowmode}
86
87\constfunc{int}{GetNonFlexibleGrowMode}{\void}
88
89Returns the value that specifies how the sizer grows in the "non flexible"
90direction if there is one.
91
92\wxheading{Return value}
93
94One 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}.
101In this case equal sizing applies to minimum sizes of columns or
102rows (this is the default value).}
103\twocolitem{wxFLEX\_GROWMODE\_ALL}{Sizer equally stretches all columns or rows
104in the non flexible direction, whether they are growable or not in the flexbile
105direction.}
106\end{twocollist}
107
108\wxheading{See also}
109
110\helpref{SetFlexibleDrection}{wxflexgridsizersetflexibledirection},
111\helpref{SetNonFlexibleGrowMode}{wxflexgridsizersetnonflexiblegrowmode}
112
113
114\membersection{wxFlexGridSizer::RemoveGrowableCol}\label{wxflexgridsizerremovegrowablecol}
115
116\func{void}{RemoveGrowableCol}{\param{size\_t }{idx}}
117
118Specifies that column idx is no longer growable.
119
120
121\membersection{wxFlexGridSizer::RemoveGrowableRow}\label{wxflexgridsizerremovegrowablerow}
122
123\func{void}{RemoveGrowableRow}{\param{size\_t }{idx}}
124
125Specifies that row idx is no longer growable.
126
127
128\membersection{wxFlexGridSizer::SetFlexibleDirection}\label{wxflexgridsizersetflexibledirection}
129
130\func{void}{SetFlexibleDirections}{\param{int }{direction}}
131
132Specifies whether the sizer should flexibly resize its columns, rows, or
133both. Argument {\tt direction} can be {\tt wxVERTICAL}, {\tt wxHORIZONTAL}
134or {\tt wxBOTH} (which is the default value). Any other value is ignored. See
135\helpref{GetFlexibleDirection()}{wxflexgridsizergetflexibledrection} for the
136explanation of these values.
137
138Note that this method does not trigger relayout.
139
140
141\membersection{wxFlexGridSizer::SetNonFlexibleGrowMode}\label{wxflexgridsizersetnonflexiblegrowmode}
142
143\func{void}{SetNonFlexibleGrowMode}{\param{int }{mode}}
144
145Specifies how the sizer should grow in the non flexible direction if
146there is one (so
147\helpref{SetFlexibleDirections()}{wxflexgridsizersetflexibledirection} must have
148been called previously). Argument {\it mode} can be one of those documented in
149\helpref{GetNonFlexibleGrowMode}{wxflexgridsizergetnonflexiblegrowmode}, please
150see there for their explanation.
151
152Note that this method does not trigger relayout.
153