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:
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.
Tells the frame manager to start managing a child window.
Tells the frame manager to start managing a child window with the specified pane_info
Just like add_pane_with_info, but includes an option position for the new pane.
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.
Returns the frame currently being managed by 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.
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.
Hides any docking hint that may be visible.
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:
Loads a saved perspective. If update is true, update_aui is automatically invoked, thus realizing the saved perspective on screen.
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.
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.
Specifies wxAuiManager's settings flags. flags specifies options which allow the frame management behavior to be modified.
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.
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.
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.
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.