wxAUI Class Reference

Class Reference

Below are the class members and definitions for wxAUI. Please note that this documentation is preliminary and is subject to change.


wxFrameManager manages the panes associated with it for a particular wxFrame, using a pane's wxPaneInfo information to determine each pane's docking and floating behavior. WxFrameManager 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 applications' specific needs.

wxFrameManager 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, wxFrameManager'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:

    wxTextCtrl* text1 = new wxTextCtrl(this, -1);
    wxTextCtrl* text2 = new wxTextCtrl(this, -1);
    m_mgr.AddPane(text1, wxLEFT, wxT("Pane Caption"));
    m_mgr.AddPane(text2, wxBOTTOM, wxT("Pane Caption"));


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.
  • Position ? More than one pane can be placed inside of a "dock." Imagine to 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 it's 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 in row 0, and the second in 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. The best way to understand layers is by running the wxAUI sample.


    wxFrameManager(wxFrame* frame = NULL, 
unsigned int flags = wxAUI_MGR_DEFAULT);

Constructor. frame specifies the wxFrame which should be managed. flags specifies options which allow the frame management behavior to be modified.

    void UnInit();

UnInit() uninitializes the framework and should be called before a frame is destroyed. UnInit() is usually called in the managed wxFrame's destructor.

    void SetFlags(unsigned int flags);

SetFlags() is used to specify wxFrameManager's settings flags. flags specifies options which allow the frame management behavior to be modified.

    unsigned int GetFlags() const;

GetFlags() returns the current manager's flags.

    void SetFrame(wxFrame* frame);

SetFrame() is called to specify the frame which is to be managed by wxFrameManager.

    wxFrame* GetFrame() const;

GetFrame() returns the frame currently being managed by wxFrameManager.

    void SetArtProvider(wxDockArt* art_provider);

SetArtProvider() instructs wxFrameManager 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 wxFrameManager.

    wxDockArt* GetArtProvider() const;

GetArtProvider() returns the current art provider being used.

    wxPaneInfo& GetPane(wxWindow* window);
    wxPaneInfo& GetPane(const wxString& name);

GetPane() is used to lookup a wxPaneInfo object either by window pointer or by pane name, which acts as a unique id for a window pane. The returned wxPaneInfo object may then be modified to change a pane's look, state or position. After one or more modifications to wxPaneInfo, wxFrameManager::Update() 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 wxPaneInfo's IsOk() method will return false.

    wxPaneInfoArray& GetAllPanes();

GetAllPanes() returns an array of all panes managed by the frame manager.

    bool AddPane(wxWindow* window, const wxPaneInfo& pane_info);
    bool AddPane(wxWindow* window, int direction = wxLEFT,
const wxString& caption = wxEmptyString);

AddPane() tells the frame manager to start managing a child window. There are two versions of this function. The first verison allows the full spectrum of pane parameter possibilities. The second version is used for simpler user interfaces which do not require as much configuration.

    bool InsertPane(wxWindow* window, const wxPaneInfo& insert_location,
int insert_level = wxAUI_INSERT_PANE);

InsertPane() 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 wxAUI_INSERT_PANE, wxAUI_INSERT_ROW or wxAUI_INSERT_DOCK.

    bool DetachPane(wxWindow* window);

DetachPane() tells the wxFrameManager to stop managing the pane specified by window. The window, if in a floated frame, is reparented to the frame managed by wxFrameManager.

    wxString SavePerspective();

SavePerspective() 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 LoadPerspective(), the entire user interface will return to the state it was when the perspective was saved.

    bool LoadPerspective(const wxString& perspective, bool update = true);

LoadPerspective() loads a saved perspective. If update is true, wxFrameManager::Update() is automatically invoked, thus realizing the saved perspective on screen.

    void Update();

Update() is called after any number of changes are made to any of the managed panes. Update() must be invoked after AddPane() or InsertPane() are called in order to "realize" or "commit" the changes. In addition, any number of changes may be made to wxPaneInfo structures (retrieved with wxFrameManager::GetPane), but to realize the changes, Update() must be called. This construction allows pane flicker to be avoided by updating the whole layout at one time.


wxPaneInfo specifies all the parameters for a pane. These parameters specify where the pane is on the screen, whether it is docked or floating, or hidden. In addition, these parameters specify the pane's docked position, floating position, preferred size, minimum size, caption text among many other parameters.

	bool IsOk() const;

IsOk() returns true if the wxPaneInfo structure is valid.

	bool IsFixed() const;

IsFixed() returns true if the pane cannot be resized.

	bool IsResizeable() const;

IsResizeable() returns true if the pane can be resized.

	bool IsShown() const;

IsShown() returns true if the pane should be drawn on the screen.

	bool IsFloating() const;

IsFloating() returns true if the pane is floating.

	bool IsDocked() const;

IsDocked() returns true if the pane is docked.

	bool IsToolbar() const;

IsToolbar() returns true if the pane contains a toolbar.

	bool IsTopDockable() const;

IsTopDockable() returns true if the pane can be docked at the top of the managed frame.

	bool IsBottomDockable() const;

IsBottomDockable() returns true if the pane can be docked at the bottom of the managed frame.

	bool IsLeftDockable() const;

IsLeftDockable() returns true if the pane can be docked on the left of the managed frame.

	bool IsRightDockable() const;

IsRightDockable() returns true if the pane can be docked on the right of the managed frame.

	bool IsFloatable() const;

IsFloatable() returns true if the pane can be undocked and displayed as a floating window.

	bool IsMovable() const;

IsMoveable() returns true if the docked frame can be undocked or moved to another dock position.

	bool HasCaption() const;

HasCaption() returns true if the pane displays a caption.

	bool HasGripper() const;

HasGripper() returns true if the pane displays a gripper.

	bool HasBorder() const;

HasBorder() returns true if the pane displays a border.

	bool HasCloseButton() const;

HasCloseButton() returns true if the pane displays a button to close the pane.

	bool HasMaximizeButton() const;

HasMaximizeButton() returns true if the pane displays a button to maximize the pane.

	bool HasMinimizeButton() const;

HasMinimizeButton() returns true if the pane displays a button to minimize the pane.

	bool HasPinButton() const;

HasPinButton() returns true if the pane displays a button to float the pane.

	wxPaneInfo& Name(const wxString& n);

Name() sets the name of the pane so it can be referenced in lookup functions.

	wxPaneInfo& Caption(const wxString& c);

Caption() sets the caption of the pane.

	wxPaneInfo& Left();

Left() sets the pane dock position to the left side of the frame.

	wxPaneInfo& Right();

Right() sets the pane dock position to the right side of the frame.

	wxPaneInfo& Top();

Top() sets the pane dock position to the top of the frame.

	wxPaneInfo& Bottom();

Bottom() sets the pane dock position to the bottom of the frame.

	wxPaneInfo& Center();
wxPaneInfo& Centre();

Center() sets the pane to the center position of the frame.

	wxPaneInfo& Direction(int direction);

Direction() determines the direction of the docked pane.

	wxPaneInfo& Layer(int layer);

Layer() determines the layer of the docked pane.

	wxPaneInfo& Row(int row);

Row() determines the row of the docked pane.

	wxPaneInfo& Position(int pos);

Position() determines the position of the docked pane.

	wxPaneInfo& BestSize(const wxSize& size);

BestSize() sets the ideal size for the pane.

	wxPaneInfo& MinSize(const wxSize& size);

MinSize() sets the minimum size of the pane.

	wxPaneInfo& MaxSize(const wxSize& size);

MaxSize() sets the maximum size of the pane.

	wxPaneInfo& BestSize(int x, int y);

BestSize() sets the ideal size for the pane.

	wxPaneInfo& MinSize(int x, int y);

MinSize() sets the minimum size of the pane.

	wxPaneInfo& MaxSize(int x, int y);

MaxSize() sets the maximum size of the pane.

	wxPaneInfo& FloatingPosition(const wxPoint& pos);

FloatingPosition() sets the position of the floating pane.

	wxPaneInfo& FloatingSize(const wxSize& size);

FloatingSize() sets the size of the floating pane.

	wxPaneInfo& Fixed();

Fixed() forces a pane to be fixed size so that it cannot be resized.

	wxPaneInfo& Resizable(bool resizable = true);

Resized() allows a pane to be resized if resizable is true, and forces it to be a fixed size if resizeable is false.

	wxPaneInfo& Dock();

Dock() indicates that a pane should be docked.

	wxPaneInfo& Float();

Float() indicates that a pane should be floated.

	wxPaneInfo& Hide();

Hide() indicates that a pane should be hidden.

	wxPaneInfo& Show(bool show = true);

Show() indicates that a pane should be shown.

	wxPaneInfo& CaptionVisible(bool visible = true);

CaptionVisible indicates that a pane caption should be visible.

	wxPaneInfo& PaneBorder(bool visible = true);

PaneBorder indicates that a border should be drawn for the pane.

	wxPaneInfo& Gripper(bool visible = true);

Gripper() indicates that a gripper should be drawn for the pane..

	wxPaneInfo& CloseButton(bool visible = true);

CloseButton() indicates that a close button should be drawn for the pane.

	wxPaneInfo& MaximizeButton(bool visible = true);

MaximizeButton() indicates that a maximize button should be drawn for the pane.

	wxPaneInfo& MinimizeButton(bool visible = true);

MinimizeButton() indicates that a minimize button should be drawn for the pane.

	wxPaneInfo& PinButton(bool visible = true);

PinButton() indicates that a pin button should be drawn for the pane.

	wxPaneInfo& DestroyOnClose(bool b = true);

DestroyOnClose() indicates whether a pane should be detroyed when it is closed.

	wxPaneInfo& TopDockable(bool b = true);

TopDockable() indicates whether a pane can be docked at the top of the frame.

	wxPaneInfo& BottomDockable(bool b = true);

BottomDockable() indicates whether a pane can be docked at the bottom of the frame.

	wxPaneInfo& LeftDockable(bool b = true);

LeftDockable() indicates whether a pane can be docked on the left of the frame.

	wxPaneInfo& RightDockable(bool b = true);

RightDockable() indicates whether a pane can be docked on the right of the frame.

	wxPaneInfo& Floatable(bool b = true);

Floatable() indicates whether a frame can be floated.

	wxPaneInfo& Movable(bool b = true);

Movable indicates whether a frame can be moved.

	wxPaneInfo& DefaultPane();

DefaultPane() specifies that the pane should adopt the default pane settings.

	wxPaneInfo& CentrePane();
wxPaneInfo& CenterPane();

CenterPane() specifies that the pane should adopt the default center pane settings.

wxPaneInfo:: ToolbarPane
	wxPaneInfo& ToolbarPane();

ToolbarPane() specifies that the pane should adopt the default toolbar pane settings.

	wxPaneInfo& SetFlag(unsigned int flag, bool option_state);

SetFlag() turns the property given by flag on or off with the option_state parameter.

	bool HasFlag(unsigned int flag) const;

HasFlag() returns true if the the property specified by flag is active for the pane.