wxAuiManager

wxAuiManager
wxAuiManager is the central class of the wxAUI class framework.

Creation Parameters

See also Advanced User Interface overview.

wxAuiManager manages the panes associated with it for a particular wxFrame, using a pane's wxAuiPaneInfo information to determine each pane's docking and floating behavior. wxAuiManager uses wxWidgets' sizer mechanism to plan the layout of each frame. It uses a replaceable dock art class (not yet implemented in wxEuphoria v0.12) to do all drawing, so all drawing is localized in one area, and may be customized depending on an application's specific needs.

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

Panes can be added quite easily:

 constant text1 = create( wxTextCtrl, parent )
 constant text2 = create( wxTextCtrl, parent )

 add_pane_simple( manager, text1, wxLEFT, "Pane Caption" )
 add_pane_simple( manager, text1, wxBOTTOM, "Pane Caption" )
 update_aui( manager )

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

 aui_float( get_pane( manager, text1 ) )

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.

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.

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.

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.

Functions/Procedures
Supertopics

wxAuiManager

[proc]
add_pane_simple
( atom manager, atom win, atom direction, sequence caption )

Category: wxAuiManager

Tells the frame manager to start managing a child window.


wxAuiManager

[proc]
add_pane_with_info
( atom manager, atom win, atom pane_info )

Category: wxAuiManager

Tells the frame manager to start managing a child window with the specified pane_info


wxAuiManager

[proc]
add_pane_with_pos
( atom manager, atom win, atom pane_info, atom x, atom y )

Category: wxAuiManager

Just like add_pane_with_info, but includes an option position for the new pane.


wxAuiManager

[func]
detach_pane
( atom manager, atom window )

Category: wxAuiManager

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.


wxAuiManager

[func]
get_managed_window
( atom manager )

Category: wxAuiManager

Returns the frame currently being managed by wxAuiManager.


wxAuiManager

[func]
get_manager
( atom window )

Category: wxAuiManager

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.


wxAuiManager

[func]
get_pane
( atom manager, atom window )

Category: wxAuiManager

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


wxAuiManager

[proc]
hide_hint
( atom manager )

Category: wxAuiManager

Hides any docking hint that may be visible.


wxAuiManager

[func]
insert_pane
( atom manager, atom window, atom insert_location, atom insert_level )

Category: wxAuiManager

This routine is used to insert either a previously unmanaged pane window into the frame manager, or to insert a currently managed pane somewhere else. InsertPane 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:


wxAuiManager

[proc]
load_pane_info
( atom manager, sequence pane_part, atom pane )

Category: wxAuiManager

Similar to to load_perspective, with the exception that it only loads information about a single pane. Used in combination with save_pane_info.


wxAuiManager

[func]
load_perspective
( atom manager, sequence perspective, atom update )

Category: wxAuiManager

Loads a saved perspective. If update is true, update_aui is automatically invoked, thus realizing the saved perspective on screen.


wxAuiManager

[func]
save_pane_info
( atom manager, atom pane )

Category: wxAuiManager

Similar to save_perspective, with the exception that it only saves information about a single pane. Used in combination with load_pane_info.


wxAuiManager

[func]
save_perspective
( atom manager )

Category: wxAuiManager

Saves the entire user interface layout into an encoded wxString, which can then be stored by the application (probably using wxConfig). When a perspective is restored using load_perspective, the entire user interface will return to the state it was when the perspective was saved.


wxAuiManager

[proc]
set_art_provider
( atom manager, atom art_provider )

Category: wxAuiManager

Instructs wxAuiManager to use art provider specified by parameter art_provider for all drawing calls. This allows plugable look-and-feel features. The previous art provider object, if any, will be deleted by wxAuiManager.


wxAuiManager

[proc]
set_aui_flags
( atom manager, atom flags )

Category: wxAuiManager

Specifies wxAuiManager's settings flags. flags specifies options which allow the frame management behavior to be modified.


wxAuiManager

[proc]
set_dock_size_constraint
( atom manager, atom widthpct, atom heightpct )

Category: wxAuiManager

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


wxAuiManager

[proc]
set_managed_window
( atom manager, atom managed_wnd )

Category: wxAuiManager

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.


wxAuiManager

[proc]
uninit_aui
( atom manager )

Category: wxAuiManager

Uninitializes the framework and should be called before a managed frame or window is destroyed. uninit_aui is usually called in the managed s destructor. It is necessary to call this function before the managed frame or window is destroyed, otherwise the manager cannot remove its custom event handlers from a window.


wxAuiManager

[proc]
update_aui
( atom manager )

Category: wxAuiManager

This method is called after any number of changes are made to any of the managed panes. update_aui() must be invoked after adding or inserting a pane ( add_pane_simple(), add_pane_with_info(), add_pane_with_pos, insert_pane() )are called in order to "realize" or "commit" the changes. In addition, any number of changes may be made to wxAuiPaneInfo structures (retrieved with get_pane() ), but to realize the changes, update_aui() must be called. This construction allows pane flicker to be avoided by updating the whole layout at one time.