]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/flexsizr.tex
wxDocManager::GetNoHistoryFiles() renamed to GetHistoryFilesCount()
[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}{wxflexgridsizersetflexibledirection}),
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}, \param{int }{proportion = $0$}}
45
46 Specifies that column {\it idx} (starting from zero) should be grown if
47 there is extra space available to the sizer.
48
49 The {\it proportion} parameter has the same meaning as the stretch factor for
50 the \helpref{sizers}{sizeroverview} except that if all proportions are $0$,
51 then 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
57 Specifies that row idx (starting from zero) should be grown if there
58 is extra space available to the sizer.
59
60 See \helpref{AddGrowableCol}{wxflexgridsizeraddgrowablecol} for the description
61 of {\it proportion} parameter.
62
63 \membersection{wxFlexGridSizer::GetFlexibleDirection}\label{wxflexgridsizergetflexibledrection}
64
65 \constfunc{int}{GetFlexibleDirections}{\void}
66
67 Returns a wxOrientation value that specifies whether the sizer flexibly
68 resizes its columns, rows, or both (default).
69
70 \wxheading{Return value}
71
72 One 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
89 Returns the value that specifies how the sizer grows in the "non flexible"
90 direction if there is one.
91
92 \wxheading{Return value}
93
94 One 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}.
101 In this case equal sizing applies to minimum sizes of columns or
102 rows (this is the default value).}
103 \twocolitem{wxFLEX\_GROWMODE\_ALL}{Sizer equally stretches all columns or rows
104 in the non flexible direction, whether they are growable or not in the flexbile
105 direction.}
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
118 Specifies 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
125 Specifies that row idx is no longer growable.
126
127
128 \membersection{wxFlexGridSizer::SetFlexibleDirection}\label{wxflexgridsizersetflexibledirection}
129
130 \func{void}{SetFlexibleDirections}{\param{int }{direction}}
131
132 Specifies whether the sizer should flexibly resize its columns, rows, or
133 both. Argument {\tt direction} can be {\tt wxVERTICAL}, {\tt wxHORIZONTAL}
134 or {\tt wxBOTH} (which is the default value). Any other value is ignored. See
135 \helpref{GetFlexibleDirection()}{wxflexgridsizergetflexibledrection} for the
136 explanation of these values.
137
138 Note that this method does not trigger relayout.
139
140
141 \membersection{wxFlexGridSizer::SetNonFlexibleGrowMode}\label{wxflexgridsizersetnonflexiblegrowmode}
142
143 \func{void}{SetNonFlexibleGrowMode}{\param{int }{mode}}
144
145 Specifies how the sizer should grow in the non flexible direction if
146 there is one (so
147 \helpref{SetFlexibleDirections()}{wxflexgridsizersetflexibledirection} must have
148 been called previously). Argument {\it mode} can be one of those documented in
149 \helpref{GetNonFlexibleGrowMode}{wxflexgridsizergetnonflexiblegrowmode}, please
150 see there for their explanation.
151
152 Note that this method does not trigger relayout.
153