wxGridBagSizer(3erl)

πŸ’… wxGridBagSizer β€” Erlang Module Definition, manual 3erl πŸ’…

πŸŽ€ NAME πŸŽ€

wxGridBagSizer β€” Functions for wxGridBagSizer class

✨ DESCRIPTION ✨

Okay so bestie, wxGridBagSizer is a wxSizer that can lay out items in a virtual grid like a wxFlexGridSizer, but plot twist: here you get explicit positioning of the items using wxGBPosition (not implemented in wx), and items can optionally span more than one row and/or column using wxGBSpan (not implemented in wx). 🫢

Heads up: both wxGBPosition and wxGBSpan are marked not implemented in wx in the original. Don't come for me, I'm just the messenger πŸ’€

This class is derived (and can use functions) from: wxFlexGridSizer, wxGridSizer, wxSizer.

wxWidgets docs: wxGridBagSizer


πŸ¦‹ DATA TYPES πŸ¦‹

wxGridBagSizer() = wx:wx_object()

πŸ”₯ EXPORTS πŸ”₯

🌸 new

new() -> wxGridBagSizer()

Basic constructor. No options, no extra drama. ✨

new(Options :: [Option]) -> wxGridBagSizer()

Types:

Option = {vgap, integer()} | {hgap, integer()}

Constructor, with optional parameters to specify the gap between the rows and columns. Gap vibes only πŸ’…

πŸ’– add

This one has a whole little collection, so stay with me.

add(This, Item) -> wxSizerItem:wxSizerItem()

Types:

This = wxGridBagSizer()
Item = wxGBSizerItem:wxGBSizerItem()

The manpage gives just the signature and types here β€” no extra description attached. Keep it moving πŸŽ€

add(This, Window, Pos) -> wxSizerItem:wxSizerItem()

Types:

This = wxGridBagSizer()
Window = wxWindow:wxWindow() | wxSizer:wxSizer()
Pos = {R :: integer(), C :: integer()}
add(This, Width, Height, Pos) -> wxSizerItem:wxSizerItem()

This one is listed bare in the original, with no separate Types block next to it. Not me adding lore πŸ™ˆ

add(This, Window, Pos, Pos :: [Option]) -> wxSizerItem:wxSizerItem()

Types:

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.

Return: A valid pointer if the item was successfully placed at the given position, or NULL if something was already there.

add(This, Width, Height, Pos, Options :: [Option]) -> wxSizerItem:wxSizerItem()

Types:

This = wxGridBagSizer()
Width = Height = integer()
Pos = {R :: integer(), C :: integer()}
Option =
    {span, {RS :: integer(), CS :: integer()}} |
    {flag, integer()} |
    {border, integer()} |
    {userData, wx:wx_object()}

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()}

Types:

This = wxGridBagSizer()

Called when the managed size of the sizer is needed or when layout needs done. It's giving "the sizer needs its measurements, bestie" energy πŸ“βœ¨

🌈 checkForIntersection

checkForIntersection(This, Item) -> boolean()

Types:

This = wxGridBagSizer()
Item = wxGBSizerItem:wxGBSizerItem()
checkForIntersection(This, Pos, Span) -> boolean()

No separate Types block in the original for this one β€” just the signature.

checkForIntersection(This, Item, Span :: [Option]) -> boolean()

Types:

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. 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.

checkForIntersection(This, Pos, Span, Options :: [Option]) -> boolean()

Types:

This = wxGridBagSizer()
Pos = {R :: integer(), C :: integer()}
Span = {RS :: integer(), CS :: integer()}
Option = {excludeItem, wxGBSizerItem:wxGBSizerItem()}

🧚 findItem

findItem(This, Window) -> wxGBSizerItem:wxGBSizerItem()

Types:

This = wxGridBagSizer()
Window = wxWindow:wxWindow() | wxSizer:wxSizer()

Find the sizer item for the given window or subsizer, returns NULL if not found.

(non-recursive)

πŸ¦‹ findItemAtPoint

findItemAtPoint(This, Pt) -> wxGBSizerItem:wxGBSizerItem()

Types:

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()

Types:

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()

Types:

This = wxGridBagSizer()
UserData = wx:wx_object()

Return the sizer item that has a matching user data (it only compares pointer values) or NULL if not found.

(non-recursive)

πŸ“ getCellSize

getCellSize(This, Row, Col) -> {W :: integer(), H :: integer()}

Types:

This = wxGridBagSizer()
Row = Col = integer()

Get the size of the specified cell, including hgap and vgap.

Only valid after window layout has been performed.

πŸŽ€ getEmptyCellSize

getEmptyCellSize(This) -> {W :: integer(), H :: integer()}

Types:

This = wxGridBagSizer()

Get the size used for cells in the grid with no item.

πŸ‘‘ getItemPosition

getItemPosition(This, Window) -> {R :: integer(), C :: integer()}
getItemPosition(This, Index) -> {R :: integer(), C :: integer()}

Types:

This = wxGridBagSizer()
Index = integer()

The manpage gives no extra description here β€” just the two overloads and the Index type. No invented behaviour, periodt πŸ’…

🧚 getItemSpan

getItemSpan(This, Window) -> {RS :: integer(), CS :: integer()}
getItemSpan(This, Index) -> {RS :: integer(), CS :: integer()}

Types:

This = wxGridBagSizer()
Index = integer()

Again: no extra prose in the original, just signatures and types. πŸ¦‹

🌈 setEmptyCellSize

setEmptyCellSize(This, Sz) -> ok

Types:

This = wxGridBagSizer()
Sz = {W :: integer(), H :: integer()}

Set the size used for cells in the grid with no item.

πŸ”₯ setItemPosition

setItemPosition(This, Window, Pos) -> boolean()
setItemPosition(This, Index, Pos) -> boolean()

Types:

This = wxGridBagSizer()
Index = integer()
Pos = {R :: integer(), C :: integer()}

No extra description in the original β€” just the overloads and types. Keep it cute, keep it exact ✨

πŸ¦‹ setItemSpan

setItemSpan(This, Window, Span) -> boolean()
setItemSpan(This, Index, Span) -> boolean()

Types:

This = wxGridBagSizer()
Index = integer()
Span = {RS :: integer(), CS :: integer()}

No extra description given here either. Signature, types, done πŸŽ€

πŸ’€ destroy

destroy(This :: wxGridBagSizer()) -> ok

Destroys the object. Bye bestie πŸ‘‹πŸ’–


And that's the footer sign-off, bestie: source wxWidgets team., version wx 2.2.2.1, and the page tag wxGridBagSizer(3erl). That's a wrap πŸ’…βœ¨

πŸ“¦ where this page comes from