wxFlexGridSizer(3)
β¨ wxFlexGridSizer(3) β¨
okay so bestie, this is the Erlang module definition for wxFlexGridSizer β a whole flex grid sizer situation. Pull up a chair, we're getting into it π
π NAME π
wxFlexGridSizer β a flex grid sizer is a sizer which lays out its children in a two-dimensional table with all table fields in one row having the same height and all fields in one column having the same width, but all rows or all columns are not necessarily the same height or width as in the wxGridSizer.
Like⦠it's a grid but it's flexible. It's giving main character energy fr.
π¦ DESCRIPTION π¦
Since wxWidgets 2.5.0, wxFlexGridSizer can also size items equally in one direction but unequally ("flexibly") in the other. So basically it can be chill AND unhinged at the same time, slay.
If the sizer is only flexible in one direction (this can be changed using setFlexibleDirection/2), it needs to be decided how the sizer should grow in the other ("non-flexible") direction in order to fill the available space. The setNonFlexibleGrowMode/2 method serves this purpose. That's literally its whole job, and it ate.
See also:
wxSizer- Overview sizer
This class is derived, and can use functions, from:
wxGridSizerwxSizer
wxWidgets docs: wxFlexGridSizer
πΈ DATA TYPES πΈ
wxFlexGridSizer() :: wx:wx_object().
That's the whole vibe right there. No cap.
π FUNCTIONS π
β addGrowableCol(This, Idx, [Option]) -> ok
when
This :: wxFlexGridSizer(),
Idx :: integer(),
Option :: {proportion, integer()}.
Specifies that column idx (starting from zero) should be grown if there is extra space available to the sizer. So like β if there's spare room, this column is gonna soak it up π
The proportion parameter has the same meaning as the stretch factor for the sizers (see wxBoxSizer) except that if all proportions are 0, then all columns are resized equally (instead of not being resized at all). Yes bestie, that's different, read it twice.
Notice that the column must not be already growable, if you need to change the proportion you must callremoveGrowableCol/2first and then make it growable (with a different proportion) again. You can useIsColGrowable()(not implemented inwx) to check whether a column is already growable. π
β addGrowableRow(This, Idx, [Option]) -> ok
when
This :: wxFlexGridSizer(),
Idx :: integer(),
Option :: {proportion, integer()}.
Specifies that row idx (starting from zero) should be grown if there is extra space available to the sizer.
This is identical to addGrowableCol/3 except that it works with rows and not columns. Same energy, different axis π«Ά
β destroy(This :: wxFlexGridSizer()) -> ok
Destroys the object. bye bestie π
β getFlexibleDirection(This) -> integer()
when This :: wxFlexGridSizer().
Returns a ?wxOrientation value that specifies whether the sizer flexibly resizes its columns, rows, or both (default).
Return: one of the following values:
wxVERTICAL: Rows are flexibly sized.wxHORIZONTAL: Columns are flexibly sized.wxBOTH: Both rows and columns are flexibly sized (this is the default value).
See: setFlexibleDirection/2
β getNonFlexibleGrowMode(This) -> wx:wx_enum()
when This :: wxFlexGridSizer().
Returns the value that specifies how the sizer grows in the "non-flexible" direction if there is one.
The behaviour of the elements in the flexible direction (i.e. both rows and columns by default, or rows only if getFlexibleDirection/1 is wxVERTICAL or columns only if it is wxHORIZONTAL) is always governed by their proportion as specified in the call to addGrowableRow/3 or addGrowableCol/3. What happens in the other direction depends on the value of returned by this function as described below.
Return: one of the following values:
wxFLEX_GROWMODE_NONE: Sizer doesn't grow its elements at all in the non-flexible direction.wxFLEX_GROWMODE_SPECIFIED: Sizer honors growable columns/rows set withaddGrowableCol/3andaddGrowableRow/3in the non-flexible direction as well. In this case equal sizing applies to minimum sizes of columns or rows (this is the default value).wxFLEX_GROWMODE_ALL: Sizer equally stretches all columns or rows in the non-flexible direction, independently of the proportions applied in the flexible direction.
See:
setFlexibleDirection/2setNonFlexibleGrowMode/2
β new(Cols, [Option]) -> wxFlexGridSizer()
when
Cols :: integer(),
Option :: {gap, {W :: integer(), H :: integer()}}.
β new(Cols, Vgap, Hgap) -> wxFlexGridSizer()
when
Cols :: integer(), Vgap :: integer(), Hgap :: integer();
β new(Rows, Cols, Gap) -> wxFlexGridSizer()
when
Rows :: integer(),
Cols :: integer(),
Gap :: {W :: integer(), H :: integer()}.
β new(Rows, Cols, Vgap, Hgap) -> wxFlexGridSizer()
when
Rows :: integer(),
Cols :: integer(),
Vgap :: integer(),
Hgap :: integer().
Four whole flavours of constructor, pick your fighter π
β removeGrowableCol(This, Idx) -> ok
when
This :: wxFlexGridSizer(),
Idx :: integer().
Specifies that the idx column index is no longer growable. it's over, the growing era has ended π
β removeGrowableRow(This, Idx) -> ok
when
This :: wxFlexGridSizer(),
Idx :: integer().
Specifies that the idx row index is no longer growable.
β setFlexibleDirection(This, Direction) -> ok
when
This :: wxFlexGridSizer(),
Direction :: integer().
Specifies whether the sizer should flexibly resize its columns, rows, or both.
Argument direction can be wxVERTICAL, wxHORIZONTAL or wxBOTH (which is the default value). Any other value is ignored. like, literally ignored, don't bother π
See getFlexibleDirection/1 for the explanation of these values. Note that this method does not trigger relayout.
β setNonFlexibleGrowMode(This, Mode) -> ok
when
This :: wxFlexGridSizer(),
Mode :: wx:wx_enum().
Specifies how the sizer should grow in the non-flexible direction if there is one (so setFlexibleDirection/2 must have been called previously). order of operations bestie, we don't skip steps β¨
Argument mode can be one of those documented in getNonFlexibleGrowMode/1, please see there for their explanation. Note that this method does not trigger relayout.
this whole page was brought to you by Ericsson AB, living in the wx 2.6 era, and yes the manpage is literally dated wxFlexGridSizer(3) β iconic, no notes ππΈπ¦
π¦ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms