wxAuiManager(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

πŸ’– wxAuiManager πŸ’–

okay bestie, welcome to wxAuiManager(3) β€” yes, the man page, but make it cute. This is the central class of the wxAUI class framework, and she is literally the main character of docking layouts. Periodt.


✨ NAME ✨

wxAuiManager β€” the central class of the wxAUI class framework. She runs the whole dock, fr fr.

🌸 DESCRIPTION 🌸

wxAuiManager manages the panes associated with it for a particular wxFrame, using a pane's wxAuiPaneInfo information to figure out each pane's docking and floating behaviour. Like, she's the one keeping track of everybody's vibe and position. πŸ’…

wxAuiManager uses wxWidgets' sizer mechanism to plan the layout of each frame. It uses a replaceable dock art class to do all the drawing, so all drawing is localized in one area, and may be customized depending on an application's specific needs. One spot for the aesthetics β€” iconic behaviour honestly. πŸŽ€

wxAuiManager works as follows: the programmer adds panes to the class, or makes changes to existing pane properties (dock position, floating state, show state, etc.). To apply these changes, wxAuiManager's update/1 function is called. This batch processing can be used to avoid flicker, by modifying more than one pane at a time, and then "committing" all of the changes at once by calling update/1. So like, do all your little edits, then hit update/1 once and let her cook. πŸ”₯

Panes can be added quite easily:

Later on, the positions can be modified easily. The following will float an existing pane in a tool window:

πŸ§… Layers, Rows and Directions, Positions πŸ§…

Inside wxAUI, the docking layout is figured out by checking several pane parameters. Four of these are important for determining where a pane will end up:

  • Direction: Each docked pane has a direction, Top, Bottom, Left, Right, or Center. This is fairly self-explanatory. The pane will be placed in the location specified by this variable. No mystery, she goes where you tell her.
  • Position: More than one pane can be placed inside of a dock. Imagine two panes being docked on the left side of a window. One pane can be placed over another. In proportionally managed docks, the pane position indicates its sequential position, starting with zero. So, in our scenario with two panes docked on the left side, the top pane in the dock would have position 0, and the second one would occupy position 1. Counting from zero, as one does. ✨
  • Row: A row can allow for two docks to be placed next to each other. One of the most common places for this to happen is in the toolbar. Multiple toolbar rows are allowed, the first row being row 0, and the second row 1. Rows can also be used on vertically docked panes. Rows are giving "squad lined up" energy.
  • Layer: A layer is akin to an onion. Layer 0 is the very center of the managed pane. Thus, if a pane is in layer 0, it will be closest to the center window (also sometimes known as the "content window"). Increasing layers "swallow up" all layers of a lower value. This can look very similar to multiple rows, but is different because all panes in a lower level yield to panes in higher levels. The best way to understand layers is by running the wxAUI sample. πŸ§…βœ¨

πŸ’… Styles πŸ’…

This class supports the following styles:

  • wxAUI_MGR_ALLOW_FLOATING β€” Allow a pane to be undocked to take the form of a wxMiniFrame.
  • wxAUI_MGR_ALLOW_ACTIVE_PANE β€” Change the color of the title bar of the pane when it is activated. Little glow-up when she's noticed. πŸ‘‘
  • wxAUI_MGR_TRANSPARENT_DRAG β€” Make the pane transparent during its movement.
  • wxAUI_MGR_TRANSPARENT_HINT β€” The possible location for docking is indicated by a translucent area.
  • wxAUI_MGR_VENETIAN_BLINDS_HINT β€” The possible location for docking is indicated by gradually appearing partially transparent hint.
  • wxAUI_MGR_RECTANGLE_HINT β€” The possible location for docking is indicated by a rectangular outline.
  • wxAUI_MGR_HINT_FADE β€” The translucent area where the pane could be docked appears gradually.
  • wxAUI_MGR_NO_VENETIAN_BLINDS_FADE β€” Used in complement of wxAUI_MGR_VENETIAN_BLINDS_HINT to show the docking hint immediately. No waiting, no fade, instant. πŸ’€
  • wxAUI_MGR_LIVE_RESIZE β€” When a docked pane is resized, its content is refreshed in live (instead of moving the border alone and refreshing the content at the end).
  • wxAUI_MGR_DEFAULT β€” Default behaviour, combines: wxAUI_MGR_ALLOW_FLOATING | wxAUI_MGR_TRANSPARENT_HINT | wxAUI_MGR_HINT_FADE | wxAUI_MGR_NO_VENETIAN_BLINDS_FADE. The classic starter pack. 🫢

See:

  • Overview aui
  • wxAuiNotebook
  • wxAuiDockArt
  • wxAuiPaneInfo

This class is derived, and can use functions, from:

  • wxEvtHandler

wxWidgets docs: wxAuiManager

πŸ¦‹ Events πŸ¦‹

Event types emitted from this class:

  • aui_pane_button
  • aui_pane_close
  • aui_pane_maximize
  • aui_pane_restore
  • aui_pane_activated
  • aui_render

🌈 DATA TYPES 🌈

wxAuiManager() :: wx:wx_object().

⭐ FUNCTIONS ⭐


πŸ“ addPane πŸ“

addPane(This, Window, [Option]) -> boolean()
                 when
                     This :: wxAuiManager(),
                     Window :: wxWindow:wxWindow(),
                     Option ::
                         {direction, integer()} |
                         {caption, unicode:chardata()};
             (This, Window, Pane_info) -> boolean()
                 when
                     This :: wxAuiManager(),
                     Window :: wxWindow:wxWindow(),
                     Pane_info :: wxAuiPaneInfo:wxAuiPaneInfo().

addPane/4 tells the frame manager to start managing a child window.

There are several versions of this function. The first version allows the full spectrum of pane parameter possibilities. The second version is used for simpler user interfaces which do not require as much configuration. The last version allows a drop position to be specified, which will determine where the pane will be added. Basically: full-control mode, chill-mode, and "put it right here" mode. Pick your fighter. πŸ’–


πŸ¦‹ addPane (with Drop_pos) πŸ¦‹

addPane(This, Window, Pane_info, Drop_pos) -> boolean()
                 when
                     This :: wxAuiManager(),
                     Window :: wxWindow:wxWindow(),
                     Pane_info :: wxAuiPaneInfo:wxAuiPaneInfo(),
                     Drop_pos :: {X :: integer(), Y :: integer()}.

πŸ’€ destroy πŸ’€

destroy(This :: wxAuiManager()) -> ok.

Destroys the object. She's gone, bestie. Not in a sad way, in a "freeing resources" way.


πŸŽ€ detachPane πŸŽ€

detachPane(This, Window) -> boolean()
                    when
                        This :: wxAuiManager(),
                        Window :: wxWindow:wxWindow().

Tells the wxAuiManager to stop managing the pane specified by window.

The window, if in a floated frame, is reparented to the frame managed by wxAuiManager. So she's not abandoning it, she's just handing it back to the frame. Gentle release, no drama. 🫢


✨ getAllPanes ✨

getAllPanes(This) -> [wxAuiPaneInfo:wxAuiPaneInfo()]
                     when This :: wxAuiManager().

Returns an array of all panes managed by the frame manager. The whole roster, no one left out. πŸ‘‘


🌸 getArtProvider 🌸

getArtProvider(This) -> wxAuiDockArt:wxAuiDockArt()
                        when This :: wxAuiManager().

Returns the current art provider being used.

See: wxAuiDockArt


πŸ’œ getDockSizeConstraint πŸ’œ

getDockSizeConstraint(This) ->
                               {Widthpct :: number(),
                                Heightpct :: number()}
                               when This :: wxAuiManager().

Returns the current dock constraint values.

See setDockSizeConstraint/3 for more information.


⭐ getFlags ⭐

getFlags(This) -> integer() when This :: wxAuiManager().

Returns the current ?wxAuiManagerOption's flags.


🌈 getManagedWindow 🌈

getManagedWindow(This) -> wxWindow:wxWindow()
                          when This :: wxAuiManager().

Returns the frame currently being managed by wxAuiManager.


🧚 getManager 🧚

getManager(Window) -> wxAuiManager()
                    when Window :: wxWindow:wxWindow().

Calling this method will return the wxAuiManager for a given window.

The window parameter should specify any child window or sub-child window of the frame or window managed by wxAuiManager.

The window parameter need not be managed by the manager itself, nor does it even need to be a child or sub-child of a managed window. It must however be inside the window hierarchy underneath the managed window. So like, she'll still find you as long as you're somewhere in the family tree. πŸ’–


πŸ’… getPane πŸ’…

getPane(This, Name) -> wxAuiPaneInfo:wxAuiPaneInfo()
                 when This :: wxAuiManager(), Name :: unicode:chardata();
             (This, Window) -> wxAuiPaneInfo:wxAuiPaneInfo()
                 when
                     This :: wxAuiManager(),
                     Window :: wxWindow:wxWindow().

getPane/2 is used to lookup a wxAuiPaneInfo object either by window pointer or by pane name, which acts as a unique id for a window pane.

The returned wxAuiPaneInfo object may then be modified to change a pane's look, state or position. After one or more modifications to wxAuiPaneInfo, update/1 should be called to commit the changes to the user interface. If the lookup failed (meaning the pane could not be found in the manager), a call to the returned wxAuiPaneInfo's IsOk() method will return false. So always check IsOk() before you start editing, bestie β€” no cap. 😭


πŸ™ˆ hideHint πŸ™ˆ

hideHint(This) -> ok when This :: wxAuiManager().

hideHint/1 hides any docking hint that may be visible. Bye-bye little ghost hint. πŸ’€


πŸ”₯ insertPane πŸ”₯

insertPane(This, Window, Insert_location, [Option]) -> boolean()
                    when
                        This :: wxAuiManager(),
                        Window :: wxWindow:wxWindow(),
                        Insert_location :: wxAuiPaneInfo:wxAuiPaneInfo(),
                        Option :: {insert_level, integer()}.

This method is used to insert either a previously unmanaged pane window into the frame manager, or to insert a currently managed pane somewhere else.

insertPane/4 will push all panes, rows, or docks aside and insert the window into the position specified by insert_location.

Because insert_location can specify either a pane, dock row, or dock layer, the insert_level parameter is used to disambiguate this. The parameter insert_level can take a value of wxAUI_INSERT_PANE, wxAUI_INSERT_ROW or wxAUI_INSERT_DOCK. Choose wisely, queen. πŸ‘‘


πŸ’– loadPaneInfo πŸ’–

loadPaneInfo(This, Pane_part, Pane) -> ok
                      when
                          This :: wxAuiManager(),
                          Pane_part :: unicode:chardata(),
                          Pane :: wxAuiPaneInfo:wxAuiPaneInfo().

loadPaneInfo/3 is similar to LoadPerspective, with the exception that it only loads information about a single pane.

This method writes the serialized data into the passed pane. Pointers to UI elements are not modified.

Note: This operation also changes the name in the pane information!

See: loadPerspective/3

See: savePaneInfo/2

See: savePerspective/1


πŸŽ€ loadPerspective πŸŽ€

loadPerspective(This, Perspective, [Option]) -> boolean()
                         when
                             This :: wxAuiManager(),
                             Perspective :: unicode:chardata(),
                             Option :: {update, boolean()}.

Loads a saved perspective.

Okay so a perspective is literally the layout state of an AUI managed window. πŸ’…

All currently existing panes that have an object in "perspective" with the same name ("equivalent") will receive the layout parameters of the object in "perspective". Existing panes that do not have an equivalent in "perspective" remain unchanged, objects in "perspective" having no equivalent in the manager are ignored.

See:

  • loadPaneInfo/3
  • loadPerspective/3
  • savePerspective/1

new/1 ✨

new([Option]) -> wxAuiManager()
             when
                 Option ::
                     {managed_wnd, wxWindow:wxWindow()} |
                     {flags, integer()}.

Constructor. That's it, bestie. It takes an Option which is either {managed_wnd, wxWindow:wxWindow()} or {flags, integer()}. Periodt. πŸ‘‘


savePaneInfo/2 πŸŽ€

savePaneInfo(This, Pane) -> unicode:charlist()
                             when
                                 This :: wxAuiManager(),
                                 Pane :: wxAuiPaneInfo:wxAuiPaneInfo().

savePaneInfo/2 is similar to SavePerspective, with the exception that it only saves information about a single pane. 🫢

Return: The serialized layout parameters of the pane are returned within the string. Information about the pointers to UI elements stored in the pane are not serialized. No cap. πŸ’…

See:

  • loadPaneInfo/3
  • loadPerspective/3
  • savePerspective/1

savePerspective/1 🌸

savePerspective(This) -> unicode:charlist()
                                when This :: wxAuiManager().

Saves the entire user interface layout into an encoded wxString (not implemented in wx), which can then be stored by the application (probably using wxConfig). Iconic. ✨

See:

  • loadPerspective/3
  • loadPaneInfo/3
  • savePaneInfo/2

setArtProvider/2 🎨

setArtProvider(This, Art_provider) -> ok
                               when
                                   This :: wxAuiManager(),
                                   Art_provider :: wxAuiDockArt:wxAuiDockArt().

Instructs wxAuiManager to use art provider specified by parameter art_provider for all drawing calls. This allows pluggable look-and-feel features. The previous art provider object, if any, will be deleted by wxAuiManager. Heads up, bestie, it's giving "out with the old, in with the new". πŸ’€

See: wxAuiDockArt


setDockSizeConstraint/3 πŸ“

setDockSizeConstraint(This, Widthpct, Heightpct) -> ok
                                      when
                                          This :: wxAuiManager(),
                                          Widthpct :: number(),
                                          Heightpct :: number().

When a user creates a new dock by dragging a window into a docked position, often times the large size of the window will create a dock that is unwieldy large. 😭

wxAuiManager by default limits the size of any new dock to 1/3 of the window size. For horizontal docks, this would be 1/3 of the window height. For vertical docks, 1/3 of the width.

Calling this function will adjust this constraint value. The numbers must be between 0.0 and 1.0. For instance, calling SetDockSizeContraint with 0.5, 0.5 will cause new docks to be limited to half of the size of the entire managed window. Slay. πŸ’…


setFlags/2 🚩

setFlags(This, Flags) -> ok
                         when This :: wxAuiManager(), Flags :: integer().

This method is used to specify ?wxAuiManagerOption's flags. flags specifies options which allow the frame management behaviour to be modified. Lowkey essential. ✨


setManagedWindow/2 πŸͺŸ

setManagedWindow(This, Managed_wnd) -> ok
                                 when
                                     This :: wxAuiManager(),
                                     Managed_wnd :: wxWindow:wxWindow().

Called to specify the frame or window which is to be managed by wxAuiManager. Frame management is not restricted to just frames. Child windows or custom controls are also allowed. Main character energy for real. πŸ‘‘


showHint/2 πŸ’‘

showHint(This, Rect) -> ok
                         when
                             This :: wxAuiManager(),
                             Rect ::
                                 {X :: integer(),
                                  Y :: integer(),
                                  W :: integer(),
                                  H :: integer()}.

This function is used by controls to explicitly show a hint window at the specified rectangle. It is rarely called, and is mostly used by controls implementing custom pane drag/drop behaviour. The specified rectangle should be in screen coordinates. So don't come at me with window coords, bestie. 🫢


unInit/1 🧹

unInit(This) -> ok when This :: wxAuiManager().

Dissociate the managed window from the manager. This function may be called before the managed frame or window is destroyed, but, since wxWidgets 3.1.4, it's unnecessary to call it explicitly, as it will be called automatically when this window is destroyed, as well as when the manager itself is. So you can chill, fr fr. 😌


update/1 πŸ”„

update(This) -> ok when This :: wxAuiManager().

This method is called after any number of changes are made to any of the managed panes. update/1 must be invoked after addPane/4 or insertPane/4 are called in order to "realize" or "commit" the changes. In addition, any number of changes may be made to wxAuiPaneInfo structures (retrieved with getPane/2), but to realize the changes, update/1 must be called. This construction allows pane flicker to be avoided by updating the whole layout at one time. No flicker, all vibes. ✨


Okay bestie, that's the whole function list. This page comes from Ericsson AB, version wx 2.6, and it's the wxAuiManager(3) man page. Stay slay, and don't forget to call update/1 after you touch panes! πŸ’–

πŸ“¦ where this page comes from