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 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
}{wxflexgridsizersetflexibledrection
}),
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
}
26 \helpref{wxSizer
}{wxsizer
},
\helpref{Sizer overview
}{sizeroverview
}
29 \membersection{wxFlexGridSizer::wxFlexGridSizer
}\label{wxflexgridsizerwxflexgridsizer
}
31 \func{}{wxFlexGridSizer
}{\param{int
}{rows
},
\param{int
}{cols
},
\param{int
}{vgap
},
\param{int
}{hgap
}}
33 \func{}{wxFlexGridSizer
}{\param{int
}{cols
},
\param{int
}{vgap =
0},
\param{int
}{hgap =
0}}
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
42 \membersection{wxFlexGridSizer::AddGrowableCol
}\label{wxflexgridsizeraddgrowablecol
}
44 \func{void
}{AddGrowableCol
}{\param{size
\_t }{idx
}}
46 Specifies that column idx (starting from zero) should be grown if
47 there is extra space available to the sizer.
49 \membersection{wxFlexGridSizer::AddGrowableRow
}\label{wxflexgridsizeraddgrowablerow
}
51 \func{void
}{AddGrowableRow
}{\param{size
\_t }{idx
}}
53 Specifies that row idx (starting from zero) should be grown if there
54 is extra space available to the sizer.
56 \membersection{wxFlexGridSizer::GetFlexibleDirection
}\label{wxflexgridsizergetflexibledrection
}
58 \constfunc{int
}{GetFlexibleDirections
}{\void}
60 Returns a wxOrientation value that specifies whether the sizer flexibly
61 resizes its columns, rows, or both (default).
63 \wxheading{Return value
}
65 One of the following values:
68 \twocolitem{wxVERTICAL
}{Rows are flexibly sized.
}
69 \twocolitem{wxHORIZONTAL
}{Columns are flexibly sized.
}
70 \twocolitem{wxBOTH
}{Both rows and columns are flexibly sized (this is the default value).
}
75 \helpref{SetFlexibleDrection
}{wxflexgridsizersetflexibledrection
}
78 \membersection{wxFlexGridSizer::GetNonFlexibleGrowMode
}\label{wxflexgridsizergetnonflexiblegrowmode
}
80 \constfunc{int
}{GetNonFlexibleGrowMode
}{\void}
82 Returns the value that specifies how the sizer grows in the "non flexible"
83 direction if there is one.
85 \wxheading{Return value
}
87 One of the following values:
90 \twocolitem{wxFLEX
\_GROWMODE\_NONE}{Sizer doesn't grow in the non flexible direction.
}
91 \twocolitem{wxFLEX
\_GROWMODE\_SPECIFIED}{Sizer honors growable columns/rows set with
92 \helpref{AddGrowableCol
}{wxflexgridsizeraddgrowablecol
} and
93 \helpref{AddGrowableRow
}{wxflexgridsizeraddgrowablerow
}.
94 In this case equal sizing applies to minimum sizes of columns or
95 rows (this is the default value).
}
96 \twocolitem{wxFLEX
\_GROWMODE\_ALL}{Sizer equally stretches all columns or rows
97 in the non flexible direction, whether they are growable or not in the flexbile
103 \helpref{SetFlexibleDrection
}{wxflexgridsizersetflexibledrection
},
104 \helpref{SetNonFlexibleGrowMode
}{wxflexgridsizersetnonflexiblegrowmode
}
107 \membersection{wxFlexGridSizer::RemoveGrowableCol
}\label{wxflexgridsizerremovegrowablecol
}
109 \func{void
}{RemoveGrowableCol
}{\param{size
\_t }{idx
}}
111 Specifies that column idx is no longer growable.
114 \membersection{wxFlexGridSizer::RemoveGrowableRow
}\label{wxflexgridsizerremovegrowablerow
}
116 \func{void
}{RemoveGrowableRow
}{\param{size
\_t }{idx
}}
118 Specifies that row idx is no longer growable.
121 \membersection{wxFlexGridSizer::SetFlexibleDirection
}{wxflexgridsizersetflexibledrection
}
123 \func{void
}{SetFlexibleDirections
}{\param{int
}{direction
}}
125 Specifies whether the sizer should flexibly resize its columns, rows, or
126 both. Argument
{\tt direction
} can be
{\tt wxVERTICAL
},
{\tt wxHORIZONTAL
}
127 or
{\tt wxBOTH
} (which is the default value). Any other value is ignored. See
128 \helpref{GetFlexibleDirection()
}{wxflexgridsizergetflexibledrection
} for the
129 explanation of these values.
131 Note that this method does not trigger relayout.
134 \membersection{wxFlexGridSizer::SetNonFlexibleGrowMode
}{wxflexgridsizersetnonflexiblegrowmode
}
136 \func{void
}{SetNonFlexibleGrowMode
}{\param{int
}{mode
}}
138 Specifies how the sizer should grow in the non flexible direction if
140 \helpref{SetFlexibleDirections()
}{wxflexgridsizersetflexibledrection
} must have
141 been called previously). Argument
{\it mode
} can be one of those documented in
142 \helpref{GetNonFlexibleGrowMode
}{wxflexgridsizergetnonflexiblegrowmode
}, please
143 see there for their explanation.
145 Note that this method does not trigger relayout.