Version: 3.3.1
Loading...
Searching...
No Matches

#include <wx/aui/framemanager.h>

Inheritance diagram for wxAuiManager:

Detailed Description

wxAuiManager is the central class of the wxAUI class framework.

wxAuiManager manages the panes associated with it for a particular window, 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.

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 using AddPane():

wxTextCtrl* text1 = new wxTextCtrl(this, wxID_ANY);
wxTextCtrl* text2 = new wxTextCtrl(this, wxID_ANY);
m_mgr.AddPane(text1, wxLEFT, "Pane Caption");
m_mgr.AddPane(text2, wxBOTTOM, "Pane Caption");
m_mgr.Update();
A text control allows text to be displayed and edited.
Definition textctrl.h:1580
@ wxBOTTOM
Definition defs.h:50
@ wxLEFT
Definition defs.h:44
@ wxID_ANY
Any id: means that we don't care about the id, whether when installing an event handler or when creat...
Definition defs.h:591

Later on, the positions and other attributes can be modified, e.g. 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 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. The best way to understand layers is by running the wxAUI sample.

Minimizing Panes

Since wxWidgets 3.3.2, wxAuiManager supports minimizing panes which have the minimize button, see wxAuiPaneInfo::MinimizeButton(). Such panes appear in the special toolbar(s) showing the buttons for all panes that can be minimized and allowing to either hide or show them again.

By default, the toolbars showing the buttons for the minimized panes are created on the left, bottom and right sides of the managed window. You can change this using AllowDocksForMinPanes() but note that you must still allow for the toolbars to be created on at least one side and the only way not to have any such toolbar at all is to not have any panes with minimize button. See SetDocksForMinPanesStyle() and wxAuiPaneInfo::IconMin() for more customization possibilities.

Styles

This class supports the following styles:

  • wxAUI_MGR_ALLOW_FLOATING:
    Allow a pane to be undocked to take the form of a wxMiniFrame.
  • wxAUI_MGR_ALLOW_ACTIVE_PANE:
    Change the color of the title bar of the pane when it is activated.
  • wxAUI_MGR_TRANSPARENT_DRAG:
    Make the pane transparent during its movement.
  • wxAUI_MGR_TRANSPARENT_HINT:
    The possible location for docking is indicated by a translucent area.
  • wxAUI_MGR_VENETIAN_BLINDS_HINT:
    The possible location for docking is indicated by gradually appearing partially transparent hint.
  • wxAUI_MGR_RECTANGLE_HINT:
    The possible location for docking is indicated by a rectangular outline. Note that this flag doesn't work, i.e. doesn't show any hint in wxGTK and wxOSX, please use one of the hint flags above instead.
  • wxAUI_MGR_HINT_FADE:
    The translucent area where the pane could be docked appears gradually. Note that this flag is not included in wxAUI_MGR_DEFAULT since wxWidgets 3.3.0 any longer.
  • wxAUI_MGR_NO_VENETIAN_BLINDS_FADE:
    This style is obsolete and doesn't do anything, it is only defined as 0 for compatibility.
  • wxAUI_MGR_LIVE_RESIZE:
    When a docked pane is resized, its content is refreshed in live (instead of moving the border alone and refreshing the content at the end). Note that this flag is included in wxAUI_MGR_DEFAULT and so needs to be explicitly turned off if you don't need. Also note that it is always enabled in wxGTK3 and wxOSX ports as non-live resizing is not implemented in them.
  • wxAUI_MGR_DEFAULT:

Events emitted by this class

The following event handler macros redirect the events to member function handlers 'func' with prototypes like:

void handlerFuncName(wxAuiManagerEvent& event)

Event macros for events emitted by this class:

  • EVT_AUI_PANE_BUTTON(func):
    Triggered when any button is pressed for any docked panes.
  • EVT_AUI_PANE_CLOSE(func):
    Triggered when a docked or floating pane is closed.
  • EVT_AUI_PANE_MINIMIZE(func):
    Triggered when a pane is minimized. This event is new since wxWidgets 3.3.2.
  • EVT_AUI_PANE_MAXIMIZE(func):
    Triggered when a pane is maximized.
  • EVT_AUI_PANE_RESTORE(func):
    Triggered when a pane is restored.
  • EVT_AUI_PANE_ACTIVATED(func):
    Triggered when a pane is made 'active'. This event is new since wxWidgets 2.9.4.
  • EVT_AUI_RENDER(func):
    This event can be caught to override the default renderer in order to custom draw your wxAuiManager window (not recommended).

Library:  wxAui
Category:  Window Docking (wxAUI)
See also
wxAUI Overview, wxAuiNotebook, wxAuiDockArt, wxAuiPaneInfo

Public Member Functions

 wxAuiManager (wxWindow *managedWindow=nullptr, unsigned int flags=wxAUI_MGR_DEFAULT)
 Constructor.
virtual ~wxAuiManager ()
 Dtor.
bool AddPane (wxWindow *window, const wxAuiPaneInfo &pane_info)
 AddPane() tells the frame manager to start managing a child window.
bool AddPane (wxWindow *window, int direction=wxLEFT, const wxString &caption=wxEmptyString)
bool AddPane (wxWindow *window, const wxAuiPaneInfo &pane_info, const wxPoint &drop_pos)
void AllowDocksForMinPanes (int directions)
 Change the sides where docks for minimized panes can be created.
void SetDocksForMinPanesStyle (unsigned int style)
 Set style of for the items representing minimized panes in the docking toolbars.
wxRect CalculateHintRect (wxWindow *paneWindow, const wxPoint &pt, const wxPoint &offset=wxPoint{0, 0})
 This function is used by controls to calculate the drop hint rectangle.
wxSize CalculateNewSplitSize () const
 Return a reasonable size to use for a new split.
virtual bool CanDockPanel (const wxAuiPaneInfo &p)
 Check if a key modifier is pressed (actually WXK_CONTROL or WXK_ALT) while dragging the frame to not dock the window.
void ClosePane (wxAuiPaneInfo &paneInfo)
 Destroys or hides the given pane depending on its flags.
virtual wxAuiFloatingFrameCreateFloatingFrame (wxWindow *parent, const wxAuiPaneInfo &p)
 Creates a floating frame in this wxAuiManager with the given parent and wxAuiPaneInfo.
bool DetachPane (wxWindow *window)
 Tells the wxAuiManager to stop managing the pane specified by window.
void DrawHintRect (wxWindow *paneWindow, const wxPoint &pt, const wxPoint &offset=wxPoint{0, 0})
 This function is used by controls to draw the hint window.
wxAuiPaneInfoArray & GetAllPanes ()
 Returns an array of all panes managed by the frame manager.
const wxAuiPaneInfoArray & GetAllPanes () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
wxAuiDockArtGetArtProvider () const
 Returns the current art provider being used.
void GetDockSizeConstraint (double *widthpct, double *heightpct) const
 Returns the current dock constraint values.
unsigned int GetFlags () const
 Returns the current wxAuiManagerOption's flags.
wxWindowGetManagedWindow () const
 Returns the frame currently being managed by wxAuiManager.
wxAuiPaneInfoGetPane (wxWindow *window)
 GetPane() 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.
wxAuiPaneInfoGetPane (const wxString &name)
bool HasLiveResize () const
 Returns true if windows are resized live.
virtual void HideHint ()
 HideHint() hides any docking hint that may be visible.
bool InsertPane (wxWindow *window, const wxAuiPaneInfo &insert_location, int insert_level=wxAUI_INSERT_PANE)
 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.
void LoadLayout (wxAuiDeserializer &deserializer)
 Load the layout information saved by SaveLayout().
void LoadPaneInfo (wxString pane_part, wxAuiPaneInfo &pane)
 LoadPaneInfo() is similar to LoadPerspective, with the exception that it only loads information about a single pane.
bool LoadPerspective (const wxString &perspective, bool update=true)
 Loads a saved perspective.
void MinimizePane (wxAuiPaneInfo &paneInfo)
 Minimize the given pane.
void MaximizePane (wxAuiPaneInfo &paneInfo)
 Maximize the given pane.
void RestorePane (wxAuiPaneInfo &paneInfo)
 Restore the last state of the given pane.
void RestoreMaximizedPane ()
 Restore the previously maximized pane.
void SaveLayout (wxAuiSerializer &serializer) const
 Save the layout information using the provided object.
wxString SavePaneInfo (const wxAuiPaneInfo &pane)
 SavePaneInfo() is similar to SavePerspective, with the exception that it only saves information about a single pane.
wxString SavePerspective ()
 Saves the entire user interface layout into an encoded wxString, which can then be stored by the application (probably using wxConfig).
void SetArtProvider (wxAuiDockArt *art_provider)
 Instructs wxAuiManager to use art provider specified by parameter art_provider for all drawing calls.
void SetDockSizeConstraint (double widthpct, double heightpct)
 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.
void SetFlags (unsigned int flags)
 This method is used to specify wxAuiManagerOption's flags.
void SetManagedWindow (wxWindow *managedWindow)
 Set the window which is to be managed by wxAuiManager.
virtual void ShowHint (const wxRect &rect)
 This function is used to show a hint window at the specified rectangle.
bool SplitPane (wxWindow *window, wxWindow *newWindow, int direction, const wxPoint &dropPos=wxDefaultPosition)
 Create a new pane with the given window near an existing pane.
void StartPaneDrag (wxWindow *paneWindow, const wxPoint &offset)
 Mostly used internally to define the drag action parameters.
void UnInit ()
 Dissociate the managed window from the manager.
void Update ()
 This method is called after any number of changes are made to any of the managed panes.
void UpdateHint (const wxRect &rect)
 Show or hide the hint window.
Public Member Functions inherited from wxEvtHandler
 wxEvtHandler ()
 Constructor.
virtual ~wxEvtHandler ()
 Destructor.
virtual void QueueEvent (wxEvent *event)
 Queue event for a later processing.
virtual void AddPendingEvent (const wxEvent &event)
 Post an event to be processed later.
template<typename T, typename T1, ...>
void CallAfter (void(T::*method)(T1,...), T1 x1,...)
 Asynchronously call the given method.
template<typename T>
void CallAfter (const T &functor)
 Asynchronously call the given functor.
virtual bool ProcessEvent (wxEvent &event)
 Processes an event, searching event tables and calling zero or more suitable event handler function(s).
bool ProcessEventLocally (wxEvent &event)
 Try to process the event in this handler and all those chained to it.
bool SafelyProcessEvent (wxEvent &event)
 Processes an event by calling ProcessEvent() and handles any exceptions that occur in the process.
void ProcessPendingEvents ()
 Processes the pending events previously queued using QueueEvent() or AddPendingEvent(); you must call this function only if you are sure there are pending events for this handler, otherwise a wxCHECK will fail.
void DeletePendingEvents ()
 Deletes all events queued on this event handler using QueueEvent() or AddPendingEvent().
void Connect (int id, int lastId, wxEventType eventType, wxObjectEventFunction function, wxObject *userData=nullptr, wxEvtHandler *eventSink=nullptr)
 Connects the given function dynamically with the event handler, id and event type.
void Connect (int id, wxEventType eventType, wxObjectEventFunction function, wxObject *userData=nullptr, wxEvtHandler *eventSink=nullptr)
 See the Connect(int, int, wxEventType, wxObjectEventFunction, wxObject*, wxEvtHandler*) overload for more info.
void Connect (wxEventType eventType, wxObjectEventFunction function, wxObject *userData=nullptr, wxEvtHandler *eventSink=nullptr)
 See the Connect(int, int, wxEventType, wxObjectEventFunction, wxObject*, wxEvtHandler*) overload for more info.
bool Disconnect (wxEventType eventType, wxObjectEventFunction function, wxObject *userData=nullptr, wxEvtHandler *eventSink=nullptr)
 Disconnects the given function dynamically from the event handler, using the specified parameters as search criteria and returning true if a matching function has been found and removed.
bool Disconnect (int id=wxID_ANY, wxEventType eventType=wxEVT_NULL, wxObjectEventFunction function=nullptr, wxObject *userData=nullptr, wxEvtHandler *eventSink=nullptr)
 See the Disconnect(wxEventType, wxObjectEventFunction, wxObject*, wxEvtHandler*) overload for more info.
bool Disconnect (int id, int lastId, wxEventType eventType, wxObjectEventFunction function=nullptr, wxObject *userData=nullptr, wxEvtHandler *eventSink=nullptr)
 See the Disconnect(wxEventType, wxObjectEventFunction, wxObject*, wxEvtHandler*) overload for more info.
template<typename EventTag, typename Functor>
void Bind (const EventTag &eventType, Functor functor, int id=wxID_ANY, int lastId=wxID_ANY, wxObject *userData=nullptr)
 Binds the given function, functor or method dynamically with the event.
template<typename EventTag, typename Class, typename EventArg, typename EventHandler>
void Bind (const EventTag &eventType, void(Class::*method)(EventArg &), EventHandler *handler, int id=wxID_ANY, int lastId=wxID_ANY, wxObject *userData=nullptr)
 See the Bind<>(const EventTag&, Functor, int, int, wxObject*) overload for more info.
template<typename EventTag, typename Functor>
bool Unbind (const EventTag &eventType, Functor functor, int id=wxID_ANY, int lastId=wxID_ANY, wxObject *userData=nullptr)
 Unbinds the given function, functor or method dynamically from the event handler, using the specified parameters as search criteria and returning true if a matching function has been found and removed.
template<typename EventTag, typename Class, typename EventArg, typename EventHandler>
bool Unbind (const EventTag &eventType, void(Class::*method)(EventArg &), EventHandler *handler, int id=wxID_ANY, int lastId=wxID_ANY, wxObject *userData=nullptr)
 See the Unbind<>(const EventTag&, Functor, int, int, wxObject*) overload for more info.
void * GetClientData () const
 Returns user-supplied client data.
wxClientDataGetClientObject () const
 Returns a pointer to the user-supplied client data object.
void SetClientData (void *data)
 Sets user-supplied client data.
void SetClientObject (wxClientData *data)
 Set the client data object.
bool GetEvtHandlerEnabled () const
 Returns true if the event handler is enabled, false otherwise.
wxEvtHandlerGetNextHandler () const
 Returns the pointer to the next handler in the chain.
wxEvtHandlerGetPreviousHandler () const
 Returns the pointer to the previous handler in the chain.
void SetEvtHandlerEnabled (bool enabled)
 Enables or disables the event handler.
virtual void SetNextHandler (wxEvtHandler *handler)
 Sets the pointer to the next handler.
virtual void SetPreviousHandler (wxEvtHandler *handler)
 Sets the pointer to the previous handler.
void Unlink ()
 Unlinks this event handler from the chain it's part of (if any); then links the "previous" event handler to the "next" one (so that the chain won't be interrupted).
bool IsUnlinked () const
 Returns true if the next and the previous handler pointers of this event handler instance are nullptr.
Public Member Functions inherited from wxObject
 wxObject ()
 Default ctor; initializes to nullptr the internal reference data.
 wxObject (const wxObject &other)
 Copy ctor.
virtual ~wxObject ()
 Destructor.
virtual wxClassInfoGetClassInfo () const
 This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar).
wxObjectRefDataGetRefData () const
 Returns the wxObject::m_refData pointer, i.e. the data referenced by this object.
bool IsKindOf (const wxClassInfo *info) const
 Determines whether this class is a subclass of (or the same class as) the given class.
bool IsSameAs (const wxObject &obj) const
 Returns true if this object has the same data pointer as obj.
void Ref (const wxObject &clone)
 Makes this object refer to the data in clone.
void SetRefData (wxObjectRefData *data)
 Sets the wxObject::m_refData pointer.
void UnRef ()
 Decrements the reference count in the associated data, and if it is zero, deletes the data.
void UnShare ()
 This is the same of AllocExclusive() but this method is public.
void operator delete (void *buf)
 The delete operator is defined for debugging versions of the library only, when the identifier __WXDEBUG__ is defined.
void * operator new (size_t size, const wxString &filename=nullptr, int lineNum=0)
 The new operator is defined for debugging versions of the library only, when the identifier __WXDEBUG__ is defined.

Static Public Member Functions

static bool AlwaysUsesLiveResize (const wxWindow *window)
 Returns true if live resize is always used on the current platform.
static wxAuiManagerGetManager (wxWindow *window)
 Calling this method will return the wxAuiManager for a given window.
Static Public Member Functions inherited from wxEvtHandler
static void AddFilter (wxEventFilter *filter)
 Add an event filter whose FilterEvent() method will be called for each and every event processed by wxWidgets.
static void RemoveFilter (wxEventFilter *filter)
 Remove a filter previously installed with AddFilter().

Protected Member Functions

virtual bool ProcessDockResult (wxAuiPaneInfo &target, const wxAuiPaneInfo &new_pos)
 ProcessDockResult() is a protected member of the wxAUI layout manager.
Protected Member Functions inherited from wxEvtHandler
virtual bool TryBefore (wxEvent &event)
 Method called by ProcessEvent() before examining this object event tables.
virtual bool TryAfter (wxEvent &event)
 Method called by ProcessEvent() as last resort.
Protected Member Functions inherited from wxObject
void AllocExclusive ()
 Ensure that this object's data is not shared with any other object.
virtual wxObjectRefDataCreateRefData () const
 Creates a new instance of the wxObjectRefData-derived class specific to this object and returns it.
virtual wxObjectRefDataCloneRefData (const wxObjectRefData *data) const
 Creates a new instance of the wxObjectRefData-derived class specific to this object and initializes it copying data.

Additional Inherited Members

Protected Attributes inherited from wxObject
wxObjectRefDatam_refData
 Pointer to an object which is the object's reference-counted data.

Constructor & Destructor Documentation

◆ wxAuiManager()

wxAuiManager::wxAuiManager ( wxWindow * managedWindow = nullptr,
unsigned int flags = wxAUI_MGR_DEFAULT )

Constructor.

Parameters
managedWindowSpecifies the window which will contain AUI panes. If it is not specified here, it must be set later using SetManagedWindow().
flagsSpecifies the frame management behaviour and visual effects with the wxAuiManagerOption's style flags.

◆ ~wxAuiManager()

virtual wxAuiManager::~wxAuiManager ( )
virtual

Dtor.

Member Function Documentation

◆ AddPane() [1/3]

bool wxAuiManager::AddPane ( wxWindow * window,
const wxAuiPaneInfo & pane_info )

AddPane() 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() [2/3]

bool wxAuiManager::AddPane ( wxWindow * window,
const wxAuiPaneInfo & pane_info,
const wxPoint & drop_pos )

◆ AddPane() [3/3]

bool wxAuiManager::AddPane ( wxWindow * window,
int direction = wxLEFT,
const wxString & caption = wxEmptyString )

◆ AllowDocksForMinPanes()

void wxAuiManager::AllowDocksForMinPanes ( int directions)

Change the sides where docks for minimized panes can be created.

The argument direction must be a combination of one or more of wxLEFT, wxRIGHT, wxTOP and wxBOTTOM flags.

This function must currently be called before there any minimized panes, so it is recommended to call it before adding any panes at all.

Example of using this function to only allow docks showing the buttons for the minimized panes on the left and right sides of the window:

mgr.AllowDocksForMinPanes(wxLEFT | wxRIGHT);
// This pane will be shown in the toolbar on the left side of the
// window.
mgr.AddPane(someWindow, wxAuiPaneInfo().Left().MinimizeButton());
// But so will will this one, as creating a toolbar along the bottom
// side is not allowed.
mgr.AddPane(otherWindow, wxAuiPaneInfo().Bottom().MinimizeButton());
wxAuiPaneInfo is part of the wxAUI class framework.
Definition framemanager.h:801
@ wxRIGHT
Definition defs.h:45
wxString Left(size_t count) const
Returns the first count characters of the string.
Since
3.3.2

◆ AlwaysUsesLiveResize()

bool wxAuiManager::AlwaysUsesLiveResize ( const wxWindow * window)
static

Returns true if live resize is always used on the current platform.

If this function returns true, wxAUI_MGR_LIVE_RESIZE flag is ignored and live resize is always used, whether it's specified or not.

Currently this is the case for wxOSX and wxGTK3 when using Wayland, as live resizing is the only implemented method there. See wxClientDC::CanBeUsedForDrawing() for more details.

Parameters
windowThe associated window, may be null (this parameter was added in wxWidgets 3.3.0)
Note
As of wxWidgets 3.3.0 this function always returns false.
Since
3.1.4

◆ CalculateHintRect()

wxRect wxAuiManager::CalculateHintRect ( wxWindow * paneWindow,
const wxPoint & pt,
const wxPoint & offset = wxPoint{0, 0} )

This function is used by controls to calculate the drop hint rectangle.

The method first calls DoDrop() to determine the exact position the pane would be at were if dropped.

Parameters
paneWindowThe window pointer of the pane being dragged.
ptThe mouse position, in client coordinates.
offsetDescribes the offset that the mouse is from the upper-left corner of the item being dragged, 0 by default (since wxWidgets 3.3.0, this parameter had to be specified in the earlier versions).
Returns
The rectangle hint will be returned in screen coordinates if the pane would indeed become docked at the specified drop point. Otherwise, an empty rectangle is returned.

◆ CalculateNewSplitSize()

wxSize wxAuiManager::CalculateNewSplitSize ( ) const

Return a reasonable size to use for a new split.

This function currently calculates the number of columns and rows in the current layout and returns the size of the managed window divided by one more than that number, i.e. returns half of the available size if there is currently just one row or column, a third if there are two rows or columns, and so on.

The implementation may change in the future, but it will always return some reasonable size to use for a new split.

See also
SplitPane(), wxAuiNotebook::CalculateNewSplitSize()
Since
3.3.2

◆ CanDockPanel()

virtual bool wxAuiManager::CanDockPanel ( const wxAuiPaneInfo & p)
virtual

Check if a key modifier is pressed (actually WXK_CONTROL or WXK_ALT) while dragging the frame to not dock the window.

◆ ClosePane()

void wxAuiManager::ClosePane ( wxAuiPaneInfo & paneInfo)

Destroys or hides the given pane depending on its flags.

See also
wxAuiPaneInfo::DestroyOnClose

◆ CreateFloatingFrame()

virtual wxAuiFloatingFrame * wxAuiManager::CreateFloatingFrame ( wxWindow * parent,
const wxAuiPaneInfo & p )
virtual

Creates a floating frame in this wxAuiManager with the given parent and wxAuiPaneInfo.

◆ DetachPane()

bool wxAuiManager::DetachPane ( wxWindow * window)

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.

◆ DrawHintRect()

void wxAuiManager::DrawHintRect ( wxWindow * paneWindow,
const wxPoint & pt,
const wxPoint & offset = wxPoint{0, 0} )

This function is used by controls to draw the hint window.

It is rarely called, and is mostly used by controls implementing custom pane drag/drop behaviour.

Calling it is equivalent to calling CalculateHintRect() and UpdateHint() with the resulting rectangle.

Parameters
paneWindowWindow passed to CalculateHintRect().
ptMouse position passed to CalculateHintRect().
offsetOffset passed to CalculateHintRect(), 0 by default (since wxWidgets 3.3.0, this parameter had to be specified in the earlier versions).

◆ GetAllPanes() [1/2]

wxAuiPaneInfoArray & wxAuiManager::GetAllPanes ( )

Returns an array of all panes managed by the frame manager.

◆ GetAllPanes() [2/2]

const wxAuiPaneInfoArray & wxAuiManager::GetAllPanes ( ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ GetArtProvider()

wxAuiDockArt * wxAuiManager::GetArtProvider ( ) const

Returns the current art provider being used.

See also
wxAuiDockArt.

◆ GetDockSizeConstraint()

void wxAuiManager::GetDockSizeConstraint ( double * widthpct,
double * heightpct ) const

Returns the current dock constraint values.

See SetDockSizeConstraint() for more information.

◆ GetFlags()

unsigned int wxAuiManager::GetFlags ( ) const

Returns the current wxAuiManagerOption's flags.

◆ GetManagedWindow()

wxWindow * wxAuiManager::GetManagedWindow ( ) const

Returns the frame currently being managed by wxAuiManager.

◆ GetManager()

wxAuiManager * wxAuiManager::GetManager ( wxWindow * window)
static

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.

◆ GetPane() [1/2]

wxAuiPaneInfo & wxAuiManager::GetPane ( const wxString & name)

◆ GetPane() [2/2]

wxAuiPaneInfo & wxAuiManager::GetPane ( wxWindow * window)

GetPane() 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, wxAuiManager::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 wxAuiPaneInfo's IsOk() method will return false.

◆ HasLiveResize()

bool wxAuiManager::HasLiveResize ( ) const

Returns true if windows are resized live.

This function combines the check for AlwaysUsesLiveResize() and, for the platforms where live resizing is optional, the check for wxAUI_MGR_LIVE_RESIZE flag.

Using this accessor allows to verify whether live resizing is being actually used.

Since
3.1.4

◆ HideHint()

virtual void wxAuiManager::HideHint ( )
virtual

HideHint() hides any docking hint that may be visible.

See also
UpdateHint()

◆ InsertPane()

bool wxAuiManager::InsertPane ( wxWindow * window,
const wxAuiPaneInfo & insert_location,
int insert_level = wxAUI_INSERT_PANE )

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

◆ LoadLayout()

void wxAuiManager::LoadLayout ( wxAuiDeserializer & deserializer)

Load the layout information saved by SaveLayout().

The implementation of wxAuiDeserializer object passed to this function should be consistent with that of the serializer used to save the layout. See page_samples_aui for an example of using serializer saving the layout in XML format and matching deserializer restoring the layout from it.

Since
3.3.0

◆ LoadPaneInfo()

void wxAuiManager::LoadPaneInfo ( wxString pane_part,
wxAuiPaneInfo & pane )

LoadPaneInfo() 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 also
LoadPerspective
SavePaneInfo()
SavePerspective

◆ LoadPerspective()

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

Loads a saved perspective.

This function is used to load layouts previously saved with SavePerspective(), use LoadLayout() to load a layout saved with SaveLayout().

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.

Parameters
perspectiveSerialized layout information of a perspective (excl. pointers to UI elements).
updateIf update is true, wxAuiManager::Update() is automatically invoked, thus realizing the specified perspective on screen.
See also
LoadPaneInfo
LoadPerspective
SavePerspective

◆ MaximizePane()

void wxAuiManager::MaximizePane ( wxAuiPaneInfo & paneInfo)

Maximize the given pane.

◆ MinimizePane()

void wxAuiManager::MinimizePane ( wxAuiPaneInfo & paneInfo)

Minimize the given pane.

Note that the pane must have the minimize button enabled for this function to work, it cannot be used to minimize the panes without it.

Minimizing a pane hides it, but it can be later shown again by the user by clicking the button corresponding to it in the minimized panes toolbar.

See also
Minimizing Panes
Since
3.3.2

◆ ProcessDockResult()

virtual bool wxAuiManager::ProcessDockResult ( wxAuiPaneInfo & target,
const wxAuiPaneInfo & new_pos )
protectedvirtual

ProcessDockResult() is a protected member of the wxAUI layout manager.

It can be overridden by derived classes to provide custom docking calculations.

◆ RestoreMaximizedPane()

void wxAuiManager::RestoreMaximizedPane ( )

Restore the previously maximized pane.

◆ RestorePane()

void wxAuiManager::RestorePane ( wxAuiPaneInfo & paneInfo)

Restore the last state of the given pane.

◆ SaveLayout()

void wxAuiManager::SaveLayout ( wxAuiSerializer & serializer) const

Save the layout information using the provided object.

This function allows to use a custom serializer to save the layout information in any format, e.g. page_samples_aui shows how to save it in XML format.

See wxAuiSerializer documentation for more details.

Since
3.3.0

◆ SavePaneInfo()

wxString wxAuiManager::SavePaneInfo ( const wxAuiPaneInfo & pane)

SavePaneInfo() is similar to SavePerspective, with the exception that it only saves information about a single pane.

Parameters
panePane whose layout parameters should be serialized.
Returns
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 also
LoadPaneInfo
LoadPerspective
SavePerspective

◆ SavePerspective()

wxString wxAuiManager::SavePerspective ( )

Saves the entire user interface layout into an encoded wxString, which can then be stored by the application (probably using wxConfig).

Note
You may prefer to use SaveLayout() instead of this function for more flexibility.
See also
LoadPerspective
LoadPaneInfo
SavePaneInfo

◆ SetArtProvider()

void wxAuiManager::SetArtProvider ( wxAuiDockArt * art_provider)

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 also
wxAuiDockArt.

◆ SetDocksForMinPanesStyle()

void wxAuiManager::SetDocksForMinPanesStyle ( unsigned int style)

Set style of for the items representing minimized panes in the docking toolbars.

If wxAUI_MIN_DOCK_ICONS is specified as part of the style, the pane icon specified by wxAuiPaneInfo::IconMin() or, if it is not set, wxAuiPaneInfo::Icon(), will be shown for the minimized panes.

If wxAUI_MIN_DOCK_TEXT is specified, the pane title will be shown (possible in addition to its icon). Note that the text will be rendered vertically for the panes shown in the toolbars docked on the left and right sides of the window and that the icons will be rotated to match the text orientation.

By default, both the text and the icons are shown, which corresponds to wxAUI_MIN_DOCK_BOTH. When using this style it may be desired to also use wxAUI_MIN_DOCK_ROTATE_ICON_WITH_TEXT style which makes the icons match the text orientation.

This function must currently be called before there any minimized panes, so it is recommended to call it before adding any panes at all.

Parameters
styleCombination of wxAuiMinDockOption elements.
See also
AllowDocksForMinPanes()
Since
3.3.2

◆ SetDockSizeConstraint()

void wxAuiManager::SetDockSizeConstraint ( double widthpct,
double heightpct )

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

◆ SetFlags()

void wxAuiManager::SetFlags ( unsigned int flags)

This method is used to specify wxAuiManagerOption's flags.

flags specifies options which allow the frame management behaviour to be modified.

◆ SetManagedWindow()

void wxAuiManager::SetManagedWindow ( wxWindow * managedWindow)

Set the window which is to be managed by wxAuiManager.

This window will often be a wxFrame but an arbitrary child window can also be used.

Note that wxAuiManager handles many events for the managed window, including wxEVT_SIZE, so any application-defined handlers for this window should take care to call wxEvent::Skip() to let wxAuiManager perform its own processing.

◆ ShowHint()

virtual void wxAuiManager::ShowHint ( const wxRect & rect)
virtual

This function is used to show a hint window at the specified rectangle.

It can be overridden to customize the hint appearance. When overriding it, HideHint() should normally be also overridden as well.

Do not call this function directly to show the hint, use UpdateHint() instead.

Parameters
rectThe area where the hint window should be shown, in screen coordinates, or an empty rectangle to hide the window.

◆ SplitPane()

bool wxAuiManager::SplitPane ( wxWindow * window,
wxWindow * newWindow,
int direction,
const wxPoint & dropPos = wxDefaultPosition )

Create a new pane with the given window near an existing pane.

The size of the new pane is determined by CalculateNewSplitSize() and the existing panes are resized to have the same size in the split direction.

Note that this function calls Update() internally, so there is no need to call it separately.

Parameters
windowA window already managed by this wxAuiManager identifying the pane to split.
newWindowThe window to be added as a new pane.
directionThe direction where the new pane should be added, one of wxLEFT, wxRIGHT, wxTOP or wxBOTTOM.
dropPosThe position where the pane is dropped, if this function is called in response to a drag-and-drop operation. If not specified, the position is determined by direction.
Since
3.3.2

◆ StartPaneDrag()

void wxAuiManager::StartPaneDrag ( wxWindow * paneWindow,
const wxPoint & offset )

Mostly used internally to define the drag action parameters.

◆ UnInit()

void wxAuiManager::UnInit ( )

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.

◆ Update()

void wxAuiManager::Update ( )

This method 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 wxAuiPaneInfo structures (retrieved with wxAuiManager::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.

◆ UpdateHint()

void wxAuiManager::UpdateHint ( const wxRect & rect)

Show or hide the hint window.

This function is mostly used internally.

Parameters
rectThe area where the hint window should be shown, in screen coordinates, or an empty rectangle to hide the window.
Since
3.3.0