Class Reference

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

wxFrameManager

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"));
    m_mgr.Update();

 

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

    m_mgr.GetPane(text1).Float();

 

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::wxFrameManager
    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.

wxFrameManager::UnInit
    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.

wxFrameManager::SetFlags
    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.

wxFrameManager::GetFlags
    unsigned int GetFlags() const;

GetFlags() returns the current manager's flags.

wxFrameManager::SetFrame
    void SetFrame(wxFrame* frame);

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

wxFrameManager::GetFrame
    wxFrame* GetFrame() const;

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

wxFrameManager::SetArtProvider
    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.

wxFrameManager::GetArtProvider
    wxDockArt* GetArtProvider() const;

GetArtProvider() returns the current art provider being used.

wxFrameManager::GetPane
    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.

wxFrameManager::GetAllPanes
    wxPaneInfoArray& GetAllPanes();

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

    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.

wxFrameManager::InsertPane
    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.

wxFrameManager::DetachPane
    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.

wxFrameManager::SavePerspective
    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.

wxFrameManager::LoadPerspective
    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.

wxFrameManager::Update
    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

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.

wxPaneInfo::IsOk
	bool IsOk() const;

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

wxPaneInfo::IsFixed
	bool IsFixed() const;

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

wxPaneInfo::IsResizable
	bool IsResizeable() const;

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

wxPaneInfo::IsShown
	bool IsShown() const;

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

wxPaneInfo::IsFloating
	bool IsFloating() const;

IsFloating() returns true if the pane is floating.

wxPaneInfo::IsDocked
	bool IsDocked() const;

IsDocked() returns true if the pane is docked.

wxPaneInfo::IsToolbar
	bool IsToolbar() const;

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

wxPaneInfo::IsTopDockable
	bool IsTopDockable() const;

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

wxPaneInfo::IsBottomDockable
	bool IsBottomDockable() const;

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

wxPaneInfo::IsLeftDockable
	bool IsLeftDockable() const;

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

wxPaneInfo::IsRightDockable
	bool IsRightDockable() const;

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

wxPaneInfo::IsFloatable
	bool IsFloatable() const;

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

wxPaneInfo::IsMovable
	bool IsMovable() const;

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

wxPaneInfo::HasCaption
	bool HasCaption() const;

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

wxPaneInfo::HasGripper
	bool HasGripper() const;

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

wxPaneInfo::HasBorder
	bool HasBorder() const;

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

wxPaneInfo::HasCloseButton
	bool HasCloseButton() const;

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

wxPaneInfo::HasMaximizeButton
	bool HasMaximizeButton() const;

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

wxPaneInfo::HasMinimizeButton
	bool HasMinimizeButton() const;

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

wxPaneInfo::HasPinButton
	bool HasPinButton() const;

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

wxPaneInfo::Name
	wxPaneInfo& Name(const wxString& n);

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

wxPaneInfo::Caption
	wxPaneInfo& Caption(const wxString& c);

Caption() sets the caption of the pane.

wxPaneInfo::Left
	wxPaneInfo& Left();

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

wxPaneInfo::Right
	wxPaneInfo& Right();

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

wxPaneInfo::Top
	wxPaneInfo& Top();

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

wxPaneInfo::Bottom
	wxPaneInfo& Bottom();

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

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

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

wxPaneInfo::Direction
	wxPaneInfo& Direction(int direction);

Direction() determines the direction of the docked pane.

wxPaneInfo::Layer
	wxPaneInfo& Layer(int layer);

Layer() determines the layer of the docked pane.

wxPaneInfo::Row
	wxPaneInfo& Row(int row);

Row() determines the row of the docked pane.

wxPaneInfo::Position
	wxPaneInfo& Position(int pos);

Position() determines the position of the docked pane.

wxPaneInfo::BestSize
	wxPaneInfo& BestSize(const wxSize& size);

BestSize() sets the ideal size for the pane.

wxPaneInfo::MinSize
	wxPaneInfo& MinSize(const wxSize& size);

MinSize() sets the minimum size of the pane.

wxPaneInfo::MaxSize
	wxPaneInfo& MaxSize(const wxSize& size);

MaxSize() sets the maximum size of the pane.

wxPaneInfo::BestSize
	wxPaneInfo& BestSize(int x, int y);

BestSize() sets the ideal size for the pane.

wxPaneInfo::MinSize
	wxPaneInfo& MinSize(int x, int y);

MinSize() sets the minimum size of the pane.

wxPaneInfo::MaxSize
	wxPaneInfo& MaxSize(int x, int y);

MaxSize() sets the maximum size of the pane.

wxPaneInfo::FloatingPosition
	wxPaneInfo& FloatingPosition(const wxPoint& pos);

FloatingPosition() sets the position of the floating pane.

wxPaneInfo::FloatingSize
	wxPaneInfo& FloatingSize(const wxSize& size);

FloatingSize() sets the size of the floating pane.

wxPaneInfo::Fixed
	wxPaneInfo& Fixed();

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

wxPaneInfo::Resizable
	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
	wxPaneInfo& Dock();

Dock() indicates that a pane should be docked.

wxPaneInfo::Float
	wxPaneInfo& Float();

Float() indicates that a pane should be floated.

wxPaneInfo::Hide
	wxPaneInfo& Hide();

Hide() indicates that a pane should be hidden.

wxPaneInfo::Show
	wxPaneInfo& Show(bool show = true);

Show() indicates that a pane should be shown.

wxPaneInfo::CaptionVisible
	wxPaneInfo& CaptionVisible(bool visible = true);

CaptionVisible indicates that a pane caption should be visible.

wxPaneInfo::PaneBorder
	wxPaneInfo& PaneBorder(bool visible = true);

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

wxPaneInfo::Gripper
	wxPaneInfo& Gripper(bool visible = true);

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

wxPaneInfo::CloseButton
	wxPaneInfo& CloseButton(bool visible = true);

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

wxPaneInfo::MaximizeButton
	wxPaneInfo& MaximizeButton(bool visible = true);

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

wxPaneInfo::MinimizeButton
	wxPaneInfo& MinimizeButton(bool visible = true);

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

wxPaneInfo::PinButton
	wxPaneInfo& PinButton(bool visible = true);

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

wxPaneInfo::DestroyOnClose
	wxPaneInfo& DestroyOnClose(bool b = true);

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

wxPaneInfo::TopDockable
	wxPaneInfo& TopDockable(bool b = true);

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

wxPaneInfo::BottomDockable
	wxPaneInfo& BottomDockable(bool b = true);

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

wxPaneInfo::LeftDockable
	wxPaneInfo& LeftDockable(bool b = true);

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

wxPaneInfo::RightDockable
	wxPaneInfo& RightDockable(bool b = true);

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

wxPaneInfo::Floatable
	wxPaneInfo& Floatable(bool b = true);

Floatable() indicates whether a frame can be floated.

wxPaneInfo::Movable
	wxPaneInfo& Movable(bool b = true);

Movable indicates whether a frame can be moved.

wxPaneInfo::DefaultPane
	wxPaneInfo& DefaultPane();

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

wxPaneInfo::CentrePane
	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
	wxPaneInfo& SetFlag(unsigned int flag, bool option_state);

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

wxPaneInfo::HasFlag
	bool HasFlag(unsigned int flag) const;

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