wxAuiManager(3erl)
π wxAuiManager(3erl) β Erlang Module Definition π (part 1)
πΈ NAME πΈ
wxAuiManager β Functions for wxAuiManager class.
β¨ DESCRIPTION β¨
Okay bestie, wxAuiManager is the central class of the wxAUI class framework. Periodt.
It manages the panes associated with it for a particular wxFrame, using a pane's wxAuiPaneInfo information to determine each pane's docking and floating behaviour.
wxAuiManager uses wxWidgets' sizer mechanism to plan the layout of each frame. It uses a replaceable dock art class to do all drawing, so all drawing is localized in one area, and may be customized depending on an application's specific needs.
Here's the whole vibe of how wxAuiManager works: 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.
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:
π¨ Styles π¨
This class supports the following styles:
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_buttonaui_pane_closeaui_pane_maximizeaui_pane_restoreaui_pane_activatedaui_render
π§Έ DATA TYPES π§Έ
wxAuiManager() = wx:wx_object()
π EXPORTS π
new() -> wxAuiManager()β the no-options constructor.new(Options :: [Option]) -> wxAuiManager()β constructor, and here are the option shapes it takes: Types:
Option =
{managed_wnd, wxWindow:wxWindow()} | {flags, integer()}
Constructor.
destroy(This :: wxAuiManager()) -> okβ dtor. Bye bestie πaddPane(This, Window) -> boolean()β the simplestaddPanesignature. Types:
This = wxAuiManager()
Window = wxWindow:wxWindow()
addPane(This, Window, Options :: [Option]) -> boolean()β the options-flavoredaddPanesignature.addPane(This, Window, Pane_info) -> boolean()β thewxAuiPaneInfo-passing signature. Types:
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.
addPane(This, Window, Pane_info, Drop_pos) -> boolean()β the drop-position version. Types:
This = wxAuiManager()
Window = wxWindow:wxWindow()
Pane_info = wxAuiPaneInfo:wxAuiPaneInfo()
Drop_pos = {X :: integer(), Y :: integer()}
detachPane(This, Window) -> boolean()β tells thewxAuiManagerto stop managing the pane specified by window. Types:
This = wxAuiManager()
Window = wxWindow:wxWindow()
The window, if in a floated frame, is reparented to the frame managed by wxAuiManager.
getAllPanes(This) -> [wxAuiPaneInfo:wxAuiPaneInfo()]β returns an array of all panes managed by the frame manager. Types:
This = wxAuiManager()
getArtProvider(This) -> wxAuiDockArt:wxAuiDockArt()β returns the current art provider being used. Types:
This = wxAuiManager()
See: wxAuiDockArt
getDockSizeConstraint(This) -> {Widthpct :: number(), Heightpct :: number()}β returns the current dock constraint values. Types:
This = wxAuiManager()
See setDockSizeConstraint/3 for more information.
getFlags(This) -> integer()β returns the current?wxAuiManagerOption's flags. Types:
This = wxAuiManager()
getManagedWindow(This) -> wxWindow:wxWindow()β returns the frame currently being managed bywxAuiManager. Types:
This = wxAuiManager()
getManager(Window) -> wxAuiManager()β calling this method will return thewxAuiManagerfor a given window. Types:
Window = wxWindow:wxWindow()
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.
getPane(This, Name) -> wxAuiPaneInfo:wxAuiPaneInfo()β the name-lookupgetPanesignature.getPane(This, Window) -> wxAuiPaneInfo:wxAuiPaneInfo()β the window-pointergetPanesignature. Types:
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.
hideHint(This) -> okβhideHint/1hides any docking hint that may be visible. Types:
This = wxAuiManager()
insertPane(This, Window, Insert_location) -> boolean()β the basicinsertPanesignature. Types:
This = wxAuiManager()
Window = wxWindow:wxWindow()
Insert_location = wxAuiPaneInfo:wxAuiPaneInfo()
insertPane(This, Window, Insert_location, Options :: [Option]) -> boolean()β theinsert_level-having signature. Types:
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.
loadPaneInfo(This, Pane_part, Pane) -> okβ loads info for just one pane. Types:
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(This, Perspective) -> boolean()β the basic perspective-loading signature. Types:
This = wxAuiManager()
Perspective = unicode:chardata()
loadPerspective(This, Perspective, Options :: [Option]) -> boolean()β the perspective-loading signature with options. Types:
This = wxAuiManager()
Perspective = unicode:chardata()
Option = {update, boolean()}
Loads a saved perspective.
A perspective is 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
See: loadPerspective/3
See: savePerspective/1
savePaneInfo(This, Pane) -> unicode:charlist()β saves info for just one pane. Types:
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.
See: loadPaneInfo/3
See: loadPerspective/3
See: savePerspective/1
savePerspective(This) -> unicode:charlist()β saves the whole layout vibe. Types:
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).
See: loadPerspective/3
See: loadPaneInfo/3
See: savePaneInfo/2
setArtProvider(This, Art_provider) -> okβ tellswxAuiManagerwhich art provider to use for all drawing calls. Types:
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.
See: wxAuiDockArt
setDockSizeConstraint(This, Widthpct, Heightpct) -> okβ sets the dock size constraint. Types:
This = wxAuiManager()
Widthpct = 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 β that's the actual allowed range, bestie. 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. (Yes, SetDockSizeContraint is spelled like that in the source β we keep it exactly as-is π
)
setFlags(This, Flags) -> ok β¨
Types:
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. So you hand over an integer, and it tweaks how the frame management situation behaves. Cute, controlled, iconic.
setManagedWindow(This, Managed_wnd) -> ok πͺ
Types:
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. Flexible queen behavior, honestly β not just frames get to be main character π«Ά
showHint(This, Rect) -> ok π
Types:
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. Screen coords, bestie β not whatever local-coordinate vibe you're in π
unInit(This) -> ok π¦
Types:
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 the automatic cleanup is lowkey carrying the team now, but the function is still here and still valid π
update(This) -> ok π₯
Types:
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. So batch the glow-up, then commit it all at once β no flickery chaos, periodt β¨
Big credit to the wxWidgets team π this page is from wx 2.2.2.1, and it's the wxAuiManager(3erl) manual page β catch you in the next one, bestie π«Άπ
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms