wxGridBagSizer(3)
β¨ NAME β¨
okay so bestie, welcome to wxGridBagSizer(3), the Erlang module definition π
wxGridBagSizer β it's a wxSizer that can lay out items in a virtual grid, kinda like a wxFlexGridSizer, except here you get explicit positioning of the items using wxGBPosition (which, heads up, is not implemented in wx π), and items can optionally span more than one row and/or column using wxGBSpan (also not implemented in wx π).
π¦ DESCRIPTION π¦
This class is derived from β so it can use all the functions of β these lil guys:
wxFlexGridSizerwxGridSizerwxSizer
wxWidgets docs: wxGridBagSizer β that's where the source of truth lives, iykyk π«Ά
π DATA TYPES π
wxGridBagSizer()::wx:wx_object().
π FUNCTIONS π
add
add(This, Item) -> wxSizerItem:wxSizerItem()
when
This :: wxGridBagSizer(),
Item :: wxGBSizerItem:wxGBSizerItem().
add(This, Width, Height, Pos) -> wxSizerItem:wxSizerItem()
when
This :: wxGridBagSizer(),
Width :: integer(),
Height :: integer(),
Pos :: {R :: integer(), C :: integer()};
(This, Window, Pos, [Option]) -> wxSizerItem:wxSizerItem()
when
This :: wxGridBagSizer(),
Window :: wxWindow:wxWindow() | wxSizer:wxSizer(),
Pos :: {R :: integer(), C :: integer()},
Option ::
{span, {RS :: integer(), CS :: integer()}} |
{flag, integer()} |
{border, integer()} |
{userData, wx:wx_object()}.
Adds the given item to the given position. Slay.
Return: a valid pointer if the item was successfully placed at the given position, or NULL if something was already there π (yes, it will fight you for the spot).
add(This, Width, Height, Pos, [Option]) ->
wxSizerItem:wxSizerItem()
when
This :: wxGridBagSizer(),
Width :: integer(),
Height :: integer(),
Pos :: {R :: integer(), C :: integer()},
Option ::
{span, {RS :: integer(), CS :: integer()}} |
{flag, integer()} |
{border, integer()} |
{userData, wx:wx_object()}.
This one adds a spacer to the given position β¨
width and height specify the dimension of the spacer to be added.
Return: a valid pointer if the spacer was successfully placed at the given position, or NULL if something was already there π
calcMin
calcMin(This) -> {W :: integer(), H :: integer()}
when This :: wxGridBagSizer().
Called when the managed size of the sizer is needed, or when layout needs done. It's giving main character energy, lowkey doing the math for you π«
checkForIntersection
checkForIntersection(This, Pos, Span) -> boolean()
when
This :: wxGridBagSizer(),
Pos ::
{R :: integer(), C :: integer()},
Span ::
{RS :: integer(), CS ::
integer()};
(This, Item, [Option]) -> boolean()
when
This :: wxGridBagSizer(),
Item :: wxGBSizerItem:wxGBSizerItem(),
Option ::
{excludeItem,
wxGBSizerItem:wxGBSizerItem()}.
Look at all items and see if any intersect (or would overlap) the given item. π
Returns true if so, false if there would be no overlap. And if an excludeItem is given, then it will not be checked for intersection β for example, it may be the item we are checking the position of. So thoughtful of it π
checkForIntersection(This, Pos, Span, [Option]) -> boolean()
when
This :: wxGridBagSizer(),
Pos ::
{R :: integer(), C :: integer()},
Span ::
{RS :: integer(), CS ::
integer()},
Option ::
{excludeItem,
wxGBSizerItem:wxGBSizerItem()}.
destroy
destroy(This :: wxGridBagSizer()) -> ok.
Destroys the object. Not me being dramatic but yes, it's over, it's done, periodt π
findItem
findItem(This, Window) -> wxGBSizerItem:wxGBSizerItem()
when
This :: wxGridBagSizer(),
Window :: wxWindow:wxWindow() | wxSizer:wxSizer().
Find the sizer item for the given window or subsizer, returns NULL if not found π
(non-recursive) β fr fr, it only looks one level deep.
findItemAtPoint
findItemAtPoint(This, Pt) -> wxGBSizerItem:wxGBSizerItem()
when
This :: wxGridBagSizer(),
Pt :: {X :: integer(), Y :: integer()}.
Return the sizer item located at the point given in pt, or NULL if there is no item at that point.
The (x,y) coordinates in pt correspond to the client coordinates of the window using the sizer for layout. (non-recursive) π―
findItemAtPosition
findItemAtPosition(This, Pos) -> wxGBSizerItem:wxGBSizerItem()
when
This :: wxGridBagSizer(),
Pos :: {R :: integer(), C :: integer()}.
Return the sizer item for the given grid cell, or NULL if there is no item at that position π«£
(non-recursive)
findItemWithData
findItemWithData(This, UserData) -> wxGBSizerItem:wxGBSizerItem()
when
This :: wxGridBagSizer(),
UserData :: wx:wx_object().
Return the sizer item that has a matching user data β heads up, it only compares pointer values β or NULL if not found π§
(non-recursive)
getCellSize
getCellSize(This, Row, Col) -> {W :: integer(), H :: integer()}
when
This :: wxGridBagSizer(),
Row :: integer(),
Col :: integer().
Get the size of the specified cell, including hgap and vgap π
β οΈ Only valid after window layout has been performed. Don't come for it early or it won't have the tea yet.
getEmptyCellSize
getEmptyCellSize(This) -> {W :: integer(), H :: integer()}
when This :: wxGridBagSizer().
Get the size used for cells in the grid with no item. Empty cells deserve respect too π«Ά
getItemPosition
getItemPosition(This, Window) -> {R :: integer(), C :: integer()}
when
This :: wxGridBagSizer(),
Window ::
wxWindow:wxWindow() |
wxSizer:wxSizer();
(This, Index) -> {R :: integer(), C :: integer()}
when
This :: wxGridBagSizer(),
Index :: integer().
Both flavors of the signature, right here, no cap π
getItemSpan
getItemSpan(This, Window) -> {RS :: integer(), CS :: integer()}
when
This :: wxGridBagSizer(),
Window ::
wxWindow:wxWindow() | wxSizer:wxSizer();
(This, Index) -> {RS :: integer(), CS :: integer()}
when This :: wxGridBagSizer(), Index :: integer().
Same vibe, but it's the span you're getting back β¨
new
new([Option]) -> wxGridBagSizer()
when Option :: {vgap, integer()} | {hgap, integer()}.
Constructor π with optional parameters to specify the gap between the rows and columns. Give it a vgap or an hgap and it will literally space things out for you π
setEmptyCellSize
setEmptyCellSize(This, Sz) -> ok
when
This :: wxGridBagSizer(),
Sz :: {W :: integer(), H :: integer()}.
Set the size used for cells in the grid with no item. Iconic behavior honestly π
setItemPosition
setItemPosition(This, Window, Pos) -> boolean()
when
This :: wxGridBagSizer(),
Window ::
wxWindow:wxWindow() |
wxSizer:wxSizer(),
Pos :: {R :: integer(), C :: integer()};
(This, Index, Pos) -> boolean()
when
This :: wxGridBagSizer(),
Index :: integer(),
Pos :: {R :: integer(), C :: integer()}.
You move the thing, it says true or it says... not true π
setItemSpan
setItemSpan(This, Window, Span) -> boolean()
when
This :: wxGridBagSizer(),
Window ::
wxWindow:wxWindow() | wxSizer:wxSizer(),
Span :: {RS :: integer(), CS :: integer()};
(This, Index, Span) -> boolean()
when
This :: wxGridBagSizer(),
Index :: integer(),
Span :: {RS :: integer(), CS :: integer()}.
Let it span, bestie π¦ multiple rows, multiple columns, main character grid energy.
π That's the whole module, no skips, no summaries, everything exactly where it belongs. Vibe check: passed.
Before you go β this page is brought to you by Ericsson AB, running wx 2.6, and it's filed under wxGridBagSizer(3) in section 3. Mwah, take care of her π
β¨π
π¦ 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