1 \section{\class{wxAuiManager
}}\label{wxauimanager
}
3 wxAuiManager is the central class of the wxAUI class framework.
5 See also
\helpref{wxAUI overview
}{wxauioverview
}.
7 wxAuiManager manages the panes associated with it
8 for a particular wxFrame, using a pane's wxAuiPaneInfo information to
9 determine each pane's docking and floating behavior. wxAuiManager
10 uses wxWidgets' sizer mechanism to plan the layout of each frame. It
11 uses a replaceable dock art class to do all drawing, so all drawing is
12 localized in one area, and may be customized depending on an
13 application's specific needs.
15 wxAuiManager works as follows: the programmer adds panes to the class,
16 or makes changes to existing pane properties (dock position, floating
17 state, show state, etc.). To apply these changes, wxAuiManager's
18 Update() function is called. This batch processing can be used to avoid
19 flicker, by modifying more than one pane at a time, and then "committing"
20 all of the changes at once by calling Update().
22 Panes can be added quite easily:
25 wxTextCtrl* text1 = new wxTextCtrl(this, -
1);
26 wxTextCtrl* text2 = new wxTextCtrl(this, -
1);
27 m_mgr.AddPane(text1, wxLEFT, wxT("Pane Caption"));
28 m_mgr.AddPane(text2, wxBOTTOM, wxT("Pane Caption"));
32 Later on, the positions can be modified easily. The following will float
33 an existing pane in a tool window:
36 m_mgr.GetPane(text1).Float();
39 \wxheading{Layers, Rows and Directions, Positions
}
41 Inside wxAUI, the docking layout is figured out by checking several
42 pane parameters. Four of these are important for determining where a
46 Each docked pane has a direction, Top, Bottom, Left, Right, or
47 Center. This is fairly self-explanatory. The pane will be placed in the
48 location specified by this variable.
51 More than one pane can be placed inside of a dock. Imagine two panes
52 being docked on the left side of a window. One pane can be placed over
53 another. In proportionally managed docks, the pane position indicates
54 its sequential position, starting with zero. So, in our scenario with
55 two panes docked on the left side, the top pane in the dock would have
56 position
0, and the second one would occupy position
1.
59 A row can allow for two docks to be placed next to each other. One of
60 the most common places for this to happen is in the toolbar. Multiple
61 toolbar rows are allowed, the first row being row
0, and the second
62 row
1. Rows can also be used on vertically docked panes.
65 A layer is akin to an onion. Layer
0 is the very center of the
66 managed pane. Thus, if a pane is in layer
0, it will be closest to the
67 center window (also sometimes known as the "content window").
68 Increasing layers "swallow up" all layers of a lower value. This can
69 look very similar to multiple rows, but is different because all panes
70 in a lower level yield to panes in higher levels. The best way to
71 understand layers is by running the wxAUI sample.
73 \wxheading{Derived from
}
75 \helpref{wxEvtHandler
}{wxevthandler
}\\
76 \helpref{wxObject
}{wxobject
}
78 \wxheading{Include files
}
84 \helpref{wxAuiPaneInfo
}{wxauipaneinfo
},
85 \helpref{wxAuiDockArt
}{wxauidockart
}
87 \wxheading{Data structures
}
95 wxAUI_DOCK_BOTTOM =
3,
97 wxAUI_DOCK_CENTER =
5,
98 wxAUI_DOCK_CENTRE = wxAUI_DOCK_CENTER
103 enum wxAuiManagerOption
105 wxAUI_MGR_ALLOW_FLOATING =
1 <<
0,
106 wxAUI_MGR_ALLOW_ACTIVE_PANE =
1 <<
1,
107 wxAUI_MGR_TRANSPARENT_DRAG =
1 <<
2,
108 wxAUI_MGR_TRANSPARENT_HINT =
1 <<
3,
109 wxAUI_MGR_VENETIAN_BLINDS_HINT =
1 <<
4,
110 wxAUI_MGR_RECTANGLE_HINT =
1 <<
5,
111 wxAUI_MGR_HINT_FADE =
1 <<
6,
112 wxAUI_MGR_NO_VENETIAN_BLINDS_FADE =
1 <<
7,
114 wxAUI_MGR_DEFAULT = wxAUI_MGR_ALLOW_FLOATING |
115 wxAUI_MGR_TRANSPARENT_HINT |
116 wxAUI_MGR_HINT_FADE |
117 wxAUI_MGR_NO_VENETIAN_BLINDS_FADE
122 \latexignore{\rtfignore{\wxheading{Members
}}}
125 \membersection{wxAuiManager::wxAuiManager
}\label{wxauimanagerwxauimanager
}
127 \func{}{wxAuiManager
}{\param{wxWindow*
}{managed
\_wnd = NULL
},
\param{unsigned int
}{flags = wxAUI
\_MGR\_DEFAULT}}
129 Constructor.
\arg{managed
\_wnd} specifies the wxFrame which should be managed.
130 \arg{flags
} specifies options which allow the frame management behavior
133 \membersection{wxAuiManager::
\destruct{wxAuiManager
}}\label{wxauimanagerdtor
}
135 \func{}{\destruct{wxAuiManager
}}{\void}
137 \membersection{wxAuiManager::AddPane
}\label{wxauimanageraddpane
}
139 \func{bool
}{AddPane
}{\param{wxWindow*
}{window
},
\param{const wxAuiPaneInfo\&
}{pane
\_info}}
141 \func{bool
}{AddPane
}{\param{wxWindow*
}{window
},
\param{int
}{direction = wxLEFT
},
\param{const wxString\&
}{caption = wxEmptyString
}}
143 \func{bool
}{AddPane
}{\param{wxWindow*
}{window
},
\param{const wxAuiPaneInfo\&
}{pane
\_info},
\param{const wxPoint\&
}{drop
\_pos}}
146 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.
148 \membersection{wxAuiManager::DetachPane
}\label{wxauimanagerdetachpane
}
150 \func{bool
}{DetachPane
}{\param{wxWindow*
}{window
}}
152 Tells the wxAuiManager to stop managing the pane specified by window.
153 The window, if in a floated frame, is reparented to the frame managed
156 \membersection{wxAuiManager::GetAllPanes
}\label{wxauimanagergetallpanes
}
158 \func{wxAuiPaneInfoArray\&
}{GetAllPanes
}{\void}
160 Returns an array of all panes managed by the frame manager.
162 \membersection{wxAuiManager::GetArtProvider
}\label{wxauimanagergetartprovider
}
164 \constfunc{wxAuiDockArt*
}{GetArtProvider
}{\void}
166 Returns the current art provider being used.
168 See also:
\helpref{wxAuiDockArt
}{wxauidockart
}.
170 \membersection{wxAuiManager::GetDockSizeConstraint
}\label{wxauimanagergetdocksizeconstraint
}
172 \func{void
}{GetDockSizeConstraint
}{\param{double*
}{widthpct
},
\param{double*
}{heightpct
}}
174 Returns the current dock constraint values. See
\helpref{SetDockSizeConstraint()
}{wxauimanagersetdocksizeconstraint
} for more information.
176 \membersection{wxAuiManager::GetFlags
}\label{wxauimanagergetflags
}
178 \constfunc{unsigned int
}{GetFlags
}{\void}
180 Returns the current manager's flags.
182 \membersection{wxAuiManager::GetManagedWindow
}\label{wxauimanagergetmanagedwindow
}
184 \constfunc{wxWindow*
}{GetManagedWindow
}{\void}
186 Returns the frame currently being managed by wxAuiManager.
188 \membersection{wxAuiManager::GetManager
}\label{wxauimanagergetmanager
}
190 \func{static wxAuiManager*
}{GetManager
}{\param{wxWindow*
}{window
}}
192 Calling this method will return the wxAuiManager for a given window. The
\arg{window
} parameter should
193 specify any child window or sub-child window of the frame or window managed by wxAuiManager.
194 The
\arg{window
} parameter need not be managed by the manager itself, nor does it even need to be a child
195 or sub-child of a managed window. It must however be inside the window hierarchy underneath the managed
198 \membersection{wxAuiManager::GetPane
}\label{wxauimanagergetpane
}
200 \func{wxAuiPaneInfo\&
}{GetPane
}{\param{wxWindow*
}{window
}}
202 \func{wxAuiPaneInfo\&
}{GetPane
}{\param{const wxString\&
}{name
}}
204 {\it GetPane
} is used to lookup a wxAuiPaneInfo object
205 either by window pointer or by pane name, which acts as a unique id for
206 a window pane. The returned wxAuiPaneInfo object may then be modified to
207 change a pane's look, state or position. After one or more
208 modifications to wxAuiPaneInfo, wxAuiManager::Update() should be called
209 to commit the changes to the user interface. If the lookup failed
210 (meaning the pane could not be found in the manager), a call to the
211 returned wxAuiPaneInfo's IsOk() method will return false.
213 \membersection{wxAuiManager::HideHint
}\label{wxauimanagerhidehint
}
215 \func{void
}{HideHint
}{\void}
217 HideHint() hides any docking hint that may be visible.
219 \membersection{wxAuiManager::InsertPane
}\label{wxauimanagerinsertpane
}
221 \func{bool
}{InsertPane
}{\param{wxWindow*
}{window
},
\param{const wxAuiPaneInfo\&
}{insert
\_location},
\param{int
}{insert
\_level = wxAUI
\_INSERT\_PANE}}
223 This method is used to insert either a previously unmanaged pane window
224 into the frame manager, or to insert a currently managed pane somewhere
225 else.
{\it InsertPane
} will push all panes, rows, or docks aside and
226 insert the window into the position specified by
\arg{insert
\_location}.
227 Because
\arg{insert
\_location} can specify either a pane, dock row, or dock
228 layer, the
\arg{insert
\_level} parameter is used to disambiguate this. The
229 parameter
\arg{insert
\_level} can take a value of wxAUI
\_INSERT\_PANE, wxAUI
\_INSERT\_ROW
230 or wxAUI
\_INSERT\_DOCK.
232 \membersection{wxAuiManager::LoadPaneInfo
}\label{wxauimanagerloadpaneinfo
}
234 \func{void
}{LoadPaneInfo
}{\param{wxString
}{pane
\_part},
\param{wxAuiPaneInfo\&
}{pane
}}
236 LoadPaneInfo() is similar to to LoadPerspective, with the exception that it only loads information about a single pane. It is used in combination with SavePaneInfo().
238 \membersection{wxAuiManager::LoadPerspective
}\label{wxauimanagerloadperspective
}
240 \func{bool
}{LoadPerspective
}{\param{const wxString\&
}{perspective
},
\param{bool
}{update = true
}}
242 Loads a saved perspective. If update is true, wxAuiManager::Update()
243 is automatically invoked, thus realizing the saved perspective on screen.
245 \membersection{wxAuiManager::ProcessDockResult
}\label{wxauimanagerprocessdockresult
}
247 \func{bool
}{ProcessDockResult
}{\param{wxAuiPaneInfo\&
}{target
},
\param{const wxAuiPaneInfo\&
}{new
\_pos}}
249 ProcessDockResult() is a protected member of the wxAUI layout manager. It can be overridden by derived classes to provide custom docking calculations.
251 \membersection{wxAuiManager::SavePaneInfo
}\label{wxauimanagersavepaneinfo
}
253 \func{wxString
}{SavePaneInfo
}{\param{wxAuiPaneInfo\&
}{pane
}}
255 SavePaneInfo() is similar to SavePerspective, with the exception that it only saves information about a single pane. It is used in combination with LoadPaneInfo().
257 \membersection{wxAuiManager::SavePerspective
}\label{wxauimanagersaveperspective
}
259 \func{wxString
}{SavePerspective
}{\void}
261 Saves the entire user interface layout into an encoded wxString, which
262 can then be stored by the application (probably using wxConfig). When
263 a perspective is restored using LoadPerspective(), the entire user
264 interface will return to the state it was when the perspective was saved.
266 \membersection{wxAuiManager::SetArtProvider
}\label{wxauimanagersetartprovider
}
268 \func{void
}{SetArtProvider
}{\param{wxAuiDockArt*
}{art
\_provider}}
270 Instructs wxAuiManager to use art provider specified by parameter
271 \arg{art
\_provider} for all drawing calls. This allows plugable
272 look-and-feel features. The previous art provider object, if any,
273 will be deleted by wxAuiManager.
275 See also:
\helpref{wxAuiDockArt
}{wxauidockart
}.
277 \membersection{wxAuiManager::SetDockSizeConstraint
}\label{wxauimanagersetdocksizeconstraint
}
279 \func{void
}{SetDockSizeConstraint
}{\param{double
}{widthpct
},
\param{double
}{heightpct
}}
281 When a user creates a new dock by dragging a window into a docked position, often times the large size of the
282 window will create a dock that is unwieldly large. wxAuiManager by default limits the size of any
283 new dock to
1/
3 of the window size. For horizontal docks, this would be
1/
3 of the window height. For
284 vertical docks,
1/
3 of the width. Calling this function will adjust this constraint value. The numbers
285 must be between
0.0 and
1.0. For instance, calling SetDockSizeContraint with
0.5,
0.5 will cause new
286 docks to be limited to half of the size of the entire managed window.
288 \membersection{wxAuiManager::SetFlags
}\label{wxauimanagersetflags
}
290 \func{void
}{SetFlags
}{\param{unsigned int
}{flags
}}
292 This method is used to specify wxAuiManager's settings flags.
\arg{flags
}
293 specifies options which allow the frame management behavior to be modified.
295 \membersection{wxAuiManager::SetManagedWindow
}\label{wxauimanagersetmanagedwindow
}
297 \func{void
}{SetManagedWindow
}{\param{wxWindow*
}{managed
\_wnd}}
299 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.
301 \membersection{wxAuiManager::ShowHint
}\label{wxauimanagershowhint
}
303 \func{void
}{ShowHint
}{\param{const wxRect\&
}{rect
}}
305 This function is used by controls to explicitly show a hint window at the specified rectangle. It is rarely called, and is mostly used by controls implementing custom pane drag/drop behaviour. The specified rectangle should be in screen coordinates.
307 \membersection{wxAuiManager::UnInit
}\label{wxauimanageruninit
}
309 \func{void
}{UnInit
}{\void}
311 Uninitializes the framework and should be called before a managed frame or window is destroyed. UnInit() is usually called in the managed wxFrame'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.
313 \membersection{wxAuiManager::Update
}\label{wxauimanagerupdate
}
315 \func{void
}{Update
}{\void}
317 This method is called after any number of changes are
318 made to any of the managed panes. Update() must be invoked after
319 AddPane() or InsertPane() are called in order to "realize" or "commit"
320 the changes. In addition, any number of changes may be made to
321 wxAuiPaneInfo structures (retrieved with wxAuiManager::GetPane), but to
322 realize the changes, Update() must be called. This construction allows
323 pane flicker to be avoided by updating the whole layout at one time.