wxSashLayoutWindow(3erl)

πŸ’… wxSashLayoutWindow πŸ’…

okay so this is the Erlang Module Definition for wxSashLayoutWindow, and bestie, it's literally the chillest way to lay out your windows. Let's get into it ✨


🌸 NAME 🌸

wxSashLayoutWindow β€” Functions for wxSashLayoutWindow class. that's it, that's the name, slay πŸŽ€


✨ DESCRIPTION ✨

so wxSashLayoutWindow responds to OnCalculateLayout events generated by wxLayoutAlgorithm. the whole point? it lets your app use simple accessors to specify how the window should be laid out, instead of making you respond to events yourself. no cap, it's giving "let me handle the tedious stuff so you don't have to" πŸ’…

the fact that the class derives from wxSashWindow means sashes can be used if required, so the windows can be user-resizable. highkey convenient πŸ¦‹

the documentation for wxLayoutAlgorithm explains the purpose of this class in more detail β€” go read that one too, iykyk.

for the window styles, see wxSashWindow. 🌈

this class handles the EVT_QUERY_LAYOUT_INFO and EVT_CALCULATE_LAYOUT events for you. however β€” if you use sashes, see wxSashWindow for relevant event information. and see also wxLayoutAlgorithm for info about the layout events. πŸ‘‘

See: wxLayoutAlgorithm, wxSashWindow, Overview events

This class is derived (and can use functions) from: wxSashWindow wxWindow wxEvtHandler

wxWidgets docs: wxSashLayoutWindow


🧚 DATA TYPES 🧚

wxSashLayoutWindow() = wx:wx_object()

that's your object type, periodt. πŸ’œ


πŸ”₯ EXPORTS πŸ”₯

⭐ new() -> wxSashLayoutWindow()

Default ctor. that's it. no args, no stress, just vibes. 🫢

⭐ new(Parent) -> wxSashLayoutWindow()

Types:

Parent = wxWindow:wxWindow()

⭐ new(Parent, Options :: [Option]) -> wxSashLayoutWindow()

Types:

Parent = wxWindow:wxWindow()
Option =
    {id, integer()} |
    {pos, {X :: integer(), Y :: integer()}} |
    {size, {W :: integer(), H :: integer()}} |
    {style, integer()}

Constructs a sash layout window, which can be a child of a frame, dialog or any other non-control window. iconic behavior ngl 🌸

⭐ create(This, Parent) -> boolean()

Types:

This = wxSashLayoutWindow()
Parent = wxWindow:wxWindow()

⭐ create(This, Parent, Options :: [Option]) -> boolean()

Types:

This = wxSashLayoutWindow()
Parent = wxWindow:wxWindow()
Option =
    {id, integer()} |
    {pos, {X :: integer(), Y :: integer()}} |
    {size, {W :: integer(), H :: integer()}} |
    {style, integer()}

Initializes a sash layout window, which can be a child of a frame, dialog or any other non-control window. same energy as new, but make it initialize πŸ’…

⭐ getAlignment(This) -> wx:wx_enum()

Types:

This = wxSashLayoutWindow()

Returns the alignment of the window: one of wxLAYOUT_TOP, wxLAYOUT_LEFT, wxLAYOUT_RIGHT, wxLAYOUT_BOTTOM. so you know which edge it's clinging to πŸŽ€

⭐ getOrientation(This) -> wx:wx_enum()

Types:

This = wxSashLayoutWindow()

Returns the orientation of the window: one of wxLAYOUT_HORIZONTAL, wxLAYOUT_VERTICAL. which way it stretches, basically πŸ¦‹

⭐ setAlignment(This, Alignment) -> ok

Types:

This = wxSashLayoutWindow()
Alignment = wx:wx_enum()

Sets the alignment of the window (which edge of the available parent client area the window is attached to).

alignment is one of wxLAYOUT_TOP, wxLAYOUT_LEFT, wxLAYOUT_RIGHT, wxLAYOUT_BOTTOM. pick your edge, bestie, main character energy only πŸ‘‘

⭐ setDefaultSize(This, Size) -> ok

Types:

This = wxSashLayoutWindow()
Size = {W :: integer(), H :: integer()}

Sets the default dimensions of the window. πŸ’–

the dimension other than the orientation will be fixed to this value, and the orientation dimension will be ignored and the window stretched to fit the available space. so like β€” one of your numbers actually matters, the other one gets ignored completely. rude but that's the rules 😭

⭐ setOrientation(This, Orientation) -> ok

Types:

This = wxSashLayoutWindow()
Orientation = wx:wx_enum()

Sets the orientation of the window (the direction the window will stretch in, to fill the available parent client area).

orientation is one of wxLAYOUT_HORIZONTAL, wxLAYOUT_VERTICAL. 🌈

⭐ destroy(This :: wxSashLayoutWindow()) -> ok

Destroys the object. rip little window, you ate while you lasted πŸ’€βœ¨


fr fr, use destroy when you're done with it β€” don't just leave your windows hanging around, that's not the vibe πŸ™ˆ

and that's the whole page, no notes! πŸ’œ this lil' manual page was brought to you by the wxWidgets team, version wx 2.2.2.1, for wxSashLayoutWindow(3erl) β€” mwah, hope your layout algorithm slays πŸ“πŸ’…

πŸ“¦ where this page comes from