1 \section{\class{wxFlexGridSizer
}}\label{wxflexgridsizer
}
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
}.
9 Since wxWidgets
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
18 \wxheading{Derived from
}
20 \helpref{wxGridSizer
}{wxgridsizer
}\\
21 \helpref{wxSizer
}{wxsizer
}\\
22 \helpref{wxObject
}{wxobject
}
24 \wxheading{Include files
}
30 \helpref{wxSizer
}{wxsizer
},
\helpref{Sizer overview
}{sizeroverview
}
32 \latexignore{\rtfignore{\wxheading{Members
}}}
34 \membersection{wxFlexGridSizer::wxFlexGridSizer
}\label{wxflexgridsizerwxflexgridsizer
}
36 \func{}{wxFlexGridSizer
}{\param{int
}{rows
},
\param{int
}{cols
},
\param{int
}{vgap
},
\param{int
}{hgap
}}
38 \func{}{wxFlexGridSizer
}{\param{int
}{cols
},
\param{int
}{vgap =
0},
\param{int
}{hgap =
0}}
40 Constructor for a wxGridSizer.
{\it rows
} and
{\it cols
} determine the number of
41 columns and rows in the sizer - if either of the parameters is zero, it will be
42 calculated to form the total number of children in the sizer, thus making the
43 sizer grow dynamically.
{\it vgap
} and
{\it hgap
} define extra space between
47 \membersection{wxFlexGridSizer::AddGrowableCol
}\label{wxflexgridsizeraddgrowablecol
}
49 \func{void
}{AddGrowableCol
}{\param{size
\_t }{idx
},
\param{int
}{proportion = $
0$
}}
51 Specifies that column
{\it idx
} (starting from zero) should be grown if
52 there is extra space available to the sizer.
54 The
{\it proportion
} parameter has the same meaning as the stretch factor for
55 the
\helpref{sizers
}{sizeroverview
} except that if all proportions are $
0$,
56 then all columns are resized equally (instead of not being resized at all).
58 \membersection{wxFlexGridSizer::AddGrowableRow
}\label{wxflexgridsizeraddgrowablerow
}
60 \func{void
}{AddGrowableRow
}{\param{size
\_t }{idx
},
\param{int
}{proportion = $
0$
}}
62 Specifies that row idx (starting from zero) should be grown if there
63 is extra space available to the sizer.
65 See
\helpref{AddGrowableCol
}{wxflexgridsizeraddgrowablecol
} for the description
66 of
{\it proportion
} parameter.
68 \membersection{wxFlexGridSizer::GetFlexibleDirection
}\label{wxflexgridsizergetflexibledrection
}
70 \constfunc{int
}{GetFlexibleDirections
}{\void}
72 Returns a wxOrientation value that specifies whether the sizer flexibly
73 resizes its columns, rows, or both (default).
75 \wxheading{Return value
}
77 One of the following values:
80 \twocolitem{wxVERTICAL
}{Rows are flexibly sized.
}
81 \twocolitem{wxHORIZONTAL
}{Columns are flexibly sized.
}
82 \twocolitem{wxBOTH
}{Both rows and columns are flexibly sized (this is the default value).
}
87 \helpref{SetFlexibleDrection
}{wxflexgridsizersetflexibledirection
}
90 \membersection{wxFlexGridSizer::GetNonFlexibleGrowMode
}\label{wxflexgridsizergetnonflexiblegrowmode
}
92 \constfunc{int
}{GetNonFlexibleGrowMode
}{\void}
94 Returns the value that specifies how the sizer grows in the "non flexible"
95 direction if there is one.
97 \wxheading{Return value
}
99 One of the following values:
102 \twocolitem{wxFLEX
\_GROWMODE\_NONE}{Sizer doesn't grow in the non flexible direction.
}
103 \twocolitem{wxFLEX
\_GROWMODE\_SPECIFIED}{Sizer honors growable columns/rows set with
104 \helpref{AddGrowableCol
}{wxflexgridsizeraddgrowablecol
} and
105 \helpref{AddGrowableRow
}{wxflexgridsizeraddgrowablerow
}.
106 In this case equal sizing applies to minimum sizes of columns or
107 rows (this is the default value).
}
108 \twocolitem{wxFLEX
\_GROWMODE\_ALL}{Sizer equally stretches all columns or rows
109 in the non flexible direction, whether they are growable or not in the flexbile
115 \helpref{SetFlexibleDrection
}{wxflexgridsizersetflexibledirection
},
116 \helpref{SetNonFlexibleGrowMode
}{wxflexgridsizersetnonflexiblegrowmode
}
119 \membersection{wxFlexGridSizer::RemoveGrowableCol
}\label{wxflexgridsizerremovegrowablecol
}
121 \func{void
}{RemoveGrowableCol
}{\param{size
\_t }{idx
}}
123 Specifies that column idx is no longer growable.
126 \membersection{wxFlexGridSizer::RemoveGrowableRow
}\label{wxflexgridsizerremovegrowablerow
}
128 \func{void
}{RemoveGrowableRow
}{\param{size
\_t }{idx
}}
130 Specifies that row idx is no longer growable.
133 \membersection{wxFlexGridSizer::SetFlexibleDirection
}\label{wxflexgridsizersetflexibledirection
}
135 \func{void
}{SetFlexibleDirections
}{\param{int
}{direction
}}
137 Specifies whether the sizer should flexibly resize its columns, rows, or
138 both. Argument
{\tt direction
} can be
{\tt wxVERTICAL
},
{\tt wxHORIZONTAL
}
139 or
{\tt wxBOTH
} (which is the default value). Any other value is ignored. See
140 \helpref{GetFlexibleDirection()
}{wxflexgridsizergetflexibledrection
} for the
141 explanation of these values.
143 Note that this method does not trigger relayout.
146 \membersection{wxFlexGridSizer::SetNonFlexibleGrowMode
}\label{wxflexgridsizersetnonflexiblegrowmode
}
148 \func{void
}{SetNonFlexibleGrowMode
}{\param{wxFlexSizerGrowMode
}{mode
}}
150 Specifies how the sizer should grow in the non flexible direction if
152 \helpref{SetFlexibleDirections()
}{wxflexgridsizersetflexibledirection
} must have
153 been called previously). Argument
{\it mode
} can be one of those documented in
154 \helpref{GetNonFlexibleGrowMode
}{wxflexgridsizergetnonflexiblegrowmode
}, please
155 see there for their explanation.
157 Note that this method does not trigger relayout.