]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/flexsizr.tex
wxBase/GUI separation: 1st step, wxMSW should build, all the rest is broken
[wxWidgets.git] / docs / latex / wx / flexsizr.tex
CommitLineData
f6bcfd97
BP
1\section{\class{wxFlexGridSizer}}\label{wxflexgridsizer}
2
3A flex grid sizer is a sizer which lays out its children in a two-dimensional
f3cf3865
RD
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}.
f6bcfd97 8
5d76f462
VZ
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
debc914b 12\helpref{SetFlexibleDrection}{wxflexgridsizersetflexibledirection}),
5d76f462
VZ
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
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
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
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 46Specifies that column {\it idx} (starting from zero) should be grown if
f3cf3865
RD
47there is extra space available to the sizer.
48
e8800dcf
VZ
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
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
57Specifies that row idx (starting from zero) should be grown if there
58is extra space available to the sizer.
59
e8800dcf
VZ
60See \helpref{AddGrowableCol}{wxflexgridsizeraddgrowablecol} for the description
61of {\it proportion} parameter.
62
5d76f462
VZ
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
debc914b 82\helpref{SetFlexibleDrection}{wxflexgridsizersetflexibledirection}
5d76f462
VZ
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
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
118Specifies 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
125Specifies 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
132Specifies whether the sizer should flexibly resize its columns, rows, or
eaf498df 133both. Argument {\tt direction} can be {\tt wxVERTICAL}, {\tt wxHORIZONTAL}
5d76f462
VZ
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
debc914b 141\membersection{wxFlexGridSizer::SetNonFlexibleGrowMode}\label{wxflexgridsizersetnonflexiblegrowmode}
5d76f462
VZ
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
debc914b 147\helpref{SetFlexibleDirections()}{wxflexgridsizersetflexibledirection} must have
5d76f462
VZ
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