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