1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Purpose: wxFlexGridSizer
4 %% Author: wxWidgets Team
8 %% Copyright: (c) wxWidgets Team
9 %% License: wxWindows license
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \section{\class{wxFlexGridSizer
}}\label{wxflexgridsizer
}
14 A flex grid sizer is a sizer which lays out its children in a two-dimensional
15 table with all table fields in one row having the same
16 height and all fields in one column having the same width, but all
17 rows or all columns are not necessarily the same height or width as in
18 the
\helpref{wxGridSizer
}{wxgridsizer
}.
20 Since wxWidgets
2.5.0, wxFlexGridSizer can also size items equally in one
21 direction but unequally ("flexibly") in the other. If the sizer is only
22 flexible in one direction (this can be changed using
23 \helpref{SetFlexibleDirection
}{wxflexgridsizersetflexibledirection
}),
24 it needs to be decided how the sizer should grow in the other ("non-flexible")
25 direction in order to fill the available space. The
26 \helpref{SetNonFlexibleGrowMode
}{wxflexgridsizersetnonflexiblegrowmode
} method
29 \wxheading{Derived from
}
31 \helpref{wxGridSizer
}{wxgridsizer
}\\
32 \helpref{wxSizer
}{wxsizer
}\\
33 \helpref{wxObject
}{wxobject
}
35 \wxheading{Include files
}
41 \helpref{wxCore
}{librarieslist
}
45 \helpref{wxSizer
}{wxsizer
},
\helpref{Sizer overview
}{sizeroverview
}
47 \latexignore{\rtfignore{\wxheading{Members
}}}
49 \membersection{wxFlexGridSizer::wxFlexGridSizer
}\label{wxflexgridsizerwxflexgridsizer
}
51 \func{}{wxFlexGridSizer
}{\param{int
}{rows
},
\param{int
}{cols
},
\param{int
}{vgap
},
\param{int
}{hgap
}}
53 \func{}{wxFlexGridSizer
}{\param{int
}{cols
},
\param{int
}{vgap =
0},
\param{int
}{hgap =
0}}
55 Constructor for a wxGridSizer.
{\it rows
} and
{\it cols
} determine the number of
56 columns and rows in the sizer - if either of the parameters is zero, it will be
57 calculated to form the total number of children in the sizer, thus making the
58 sizer grow dynamically.
{\it vgap
} and
{\it hgap
} define extra space between
62 \membersection{wxFlexGridSizer::AddGrowableCol
}\label{wxflexgridsizeraddgrowablecol
}
64 \func{void
}{AddGrowableCol
}{\param{size
\_t }{idx
},
\param{int
}{proportion = $
0$
}}
66 Specifies that column
{\it idx
} (starting from zero) should be grown if
67 there is extra space available to the sizer.
69 The
{\it proportion
} parameter has the same meaning as the stretch factor for
70 the
\helpref{sizers
}{sizeroverview
} except that if all proportions are $
0$,
71 then all columns are resized equally (instead of not being resized at all).
73 \membersection{wxFlexGridSizer::AddGrowableRow
}\label{wxflexgridsizeraddgrowablerow
}
75 \func{void
}{AddGrowableRow
}{\param{size
\_t }{idx
},
\param{int
}{proportion = $
0$
}}
77 Specifies that row idx (starting from zero) should be grown if there
78 is extra space available to the sizer.
80 See
\helpref{AddGrowableCol
}{wxflexgridsizeraddgrowablecol
} for the description
81 of
{\it proportion
} parameter.
83 \membersection{wxFlexGridSizer::GetFlexibleDirection
}\label{wxflexgridsizergetflexibledrection
}
85 \constfunc{int
}{GetFlexibleDirection
}{\void}
87 Returns a wxOrientation value that specifies whether the sizer flexibly
88 resizes its columns, rows, or both (default).
90 \wxheading{Return value
}
92 One of the following values:
95 \twocolitem{wxVERTICAL
}{Rows are flexibly sized.
}
96 \twocolitem{wxHORIZONTAL
}{Columns are flexibly sized.
}
97 \twocolitem{wxBOTH
}{Both rows and columns are flexibly sized (this is the default value).
}
102 \helpref{SetFlexibleDirection
}{wxflexgridsizersetflexibledirection
}
105 \membersection{wxFlexGridSizer::GetNonFlexibleGrowMode
}\label{wxflexgridsizergetnonflexiblegrowmode
}
107 \constfunc{int
}{GetNonFlexibleGrowMode
}{\void}
109 Returns the value that specifies how the sizer grows in the "non-flexible"
110 direction if there is one.
112 \wxheading{Return value
}
114 One of the following values:
117 \twocolitem{wxFLEX
\_GROWMODE\_NONE}{Sizer doesn't grow in the non-flexible direction.
}
118 \twocolitem{wxFLEX
\_GROWMODE\_SPECIFIED}{Sizer honors growable columns/rows set with
119 \helpref{AddGrowableCol
}{wxflexgridsizeraddgrowablecol
} and
120 \helpref{AddGrowableRow
}{wxflexgridsizeraddgrowablerow
}.
121 In this case equal sizing applies to minimum sizes of columns or
122 rows (this is the default value).
}
123 \twocolitem{wxFLEX
\_GROWMODE\_ALL}{Sizer equally stretches all columns or rows
124 in the non-flexible direction, whether they are growable or not in the flexible
130 \helpref{SetFlexibleDirection
}{wxflexgridsizersetflexibledirection
},
131 \helpref{SetNonFlexibleGrowMode
}{wxflexgridsizersetnonflexiblegrowmode
}
134 \membersection{wxFlexGridSizer::RemoveGrowableCol
}\label{wxflexgridsizerremovegrowablecol
}
136 \func{void
}{RemoveGrowableCol
}{\param{size
\_t }{idx
}}
138 Specifies that column idx is no longer growable.
141 \membersection{wxFlexGridSizer::RemoveGrowableRow
}\label{wxflexgridsizerremovegrowablerow
}
143 \func{void
}{RemoveGrowableRow
}{\param{size
\_t }{idx
}}
145 Specifies that row idx is no longer growable.
148 \membersection{wxFlexGridSizer::SetFlexibleDirection
}\label{wxflexgridsizersetflexibledirection
}
150 \func{void
}{SetFlexibleDirection
}{\param{int
}{direction
}}
152 Specifies whether the sizer should flexibly resize its columns, rows, or
153 both. Argument
{\tt direction
} can be
{\tt wxVERTICAL
},
{\tt wxHORIZONTAL
}
154 or
{\tt wxBOTH
} (which is the default value). Any other value is ignored. See
155 \helpref{GetFlexibleDirection()
}{wxflexgridsizergetflexibledrection
} for the
156 explanation of these values.
158 Note that this method does not trigger relayout.
161 \membersection{wxFlexGridSizer::SetNonFlexibleGrowMode
}\label{wxflexgridsizersetnonflexiblegrowmode
}
163 \func{void
}{SetNonFlexibleGrowMode
}{\param{wxFlexSizerGrowMode
}{mode
}}
165 Specifies how the sizer should grow in the non-flexible direction if
167 \helpref{SetFlexibleDirection()
}{wxflexgridsizersetflexibledirection
} must have
168 been called previously). Argument
{\it mode
} can be one of those documented in
169 \helpref{GetNonFlexibleGrowMode
}{wxflexgridsizergetnonflexiblegrowmode
}, please
170 see there for their explanation.
172 Note that this method does not trigger relayout.