]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/auimanager.tex
fixed typos in last check in
[wxWidgets.git] / docs / latex / wx / auimanager.tex
CommitLineData
e67635d4
RR
1\section{\class{wxAuiManager}}\label{wxauimanager}
2
3wxAuiManager is the central class of the wxAUI class framework.
4
5See also \helpref{wxAUI overview}{wxauioverview}.
6
7wxAuiManager manages the panes associated with it
8for a particular wxFrame, using a pane's wxAuiPaneInfo information to
9determine each pane's docking and floating behavior. wxAuiManager
10uses wxWidgets' sizer mechanism to plan the layout of each frame. It
11uses a replaceable dock art class to do all drawing, so all drawing is
12localized in one area, and may be customized depending on an
13applications' specific needs.
14
15wxAuiManager works as follows: The programmer adds panes to the class,
16or makes changes to existing pane properties (dock position, floating
17state, show state, etc.). To apply these changes, wxAuiManager's
18Update() function is called. This batch processing can be used to avoid
19flicker, by modifying more than one pane at a time, and then "committing"
20all of the changes at once by calling Update().
21
22Panes can be added quite easily:
23
24\begin{verbatim}
25wxTextCtrl* text1 = new wxTextCtrl(this, -1);
26wxTextCtrl* text2 = new wxTextCtrl(this, -1);
27m_mgr.AddPane(text1, wxLEFT, wxT("Pane Caption"));
28m_mgr.AddPane(text2, wxBOTTOM, wxT("Pane Caption"));
29m_mgr.Update();
30\end{verbatim}
31
32Later on, the positions can be modified easily. The following will float
33an existing pane in a tool window:
34
35\begin{verbatim}
36m_mgr.GetPane(text1).Float();
37\end{verbatim}
38
39\wxheading{Layers, Rows and Directions, Positions}
40
41Inside wxAUI, the docking layout is figured out by checking several
42pane parameters. Four of these are important for determining where a
43pane will end up:
44
45{\bf Direction:}
46Each docked pane has a direction, Top, Bottom, Left, Right, or
47Center. This is fairly self-explanatory. The pane will be placed in the
48location specified by this variable.
49
50{\bf Position:}
51More than one pane can be placed inside of a dock. Imagine to panes
52being docked on the left side of a window. One pane can be placed over
53another. In proportionally managed docks, the pane position indicates
54it's sequential position, starting with zero. So, in our scenario with
55two panes docked on the left side, the top pane in the dock would have
56position 0, and the second one would occupy position 1.
57
58{\bf Row:}
59A row can allow for two docks to be placed next to each other. One of
60the most common places for this to happen is in the toolbar. Multiple
61toolbar rows are allowed, the first row being in row 0, and the second
62in row 1. Rows can also be used on vertically docked panes.
63
64
65{\bf Layer:}
66A layer is akin to an onion. Layer 0 is the very center of the
67managed pane. Thus, if a pane is in layer 0, it will be closest to the
68center window (also sometimes known as the "content window").
69Increasing layers "swallow up" all layers of a lower value. This can
70look very similar to multiple rows, but is different because all panes
71in a lower level yield to panes in higher levels. The best way to
72understand layers is by running the wxAUI sample.
73
74\wxheading{Derived from}
75
76\helpref{wxEvent}{wxevent}
77
78\wxheading{Include files}
79
80<wx/aui/aui.h>
81
82\wxheading{See also}
83
84\helpref{wxAuiPaneInfo}{wxauipaneinfo},
85\helpref{wxAuiDockArt}{wxauidockart}
86
87\wxheading{Data structures}
88
89\begin{verbatim}
90enum wxAuiManagerDock
91{
92 wxAUI_DOCK_NONE = 0,
93 wxAUI_DOCK_TOP = 1,
94 wxAUI_DOCK_RIGHT = 2,
95 wxAUI_DOCK_BOTTOM = 3,
96 wxAUI_DOCK_LEFT = 4,
97 wxAUI_DOCK_CENTER = 5,
98 wxAUI_DOCK_CENTRE = wxAUI_DOCK_CENTER
99}
100\end{verbatim}
101
102\begin{verbatim}
103enum wxAuiManagerOption
104{
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,
113
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
118}
119\end{verbatim}
120
121
122\latexignore{\rtfignore{\wxheading{Members}}}
123
124
125\membersection{wxAuiManager::wxAuiManager}\label{wxauimanagerwxauimanager}
126
127\func{}{wxAuiManager}{\param{wxWindow* }{managed\_wnd = NULL}, \param{unsigned int }{flags = wxAUI\_MGR\_DEFAULT}}
128
129Constructor. \arg{frame} specifies the wxFrame which should be managed.
130\arg{flags} specifies options which allow the frame management behavior
131to be modified.
132
133\membersection{wxAuiManager::\destruct{wxAuiManager}}\label{wxauimanagerdtor}
134
135\func{}{\destruct{wxAuiManager}}{\void}
136
137\membersection{wxAuiManager::AddPane}\label{wxauimanageraddpane}
138
139\func{bool}{AddPane}{\param{wxWindow* }{window}, \param{const wxAuiPaneInfo\& }{pane\_info}}
140
141\func{bool}{AddPane}{\param{wxWindow* }{window}, \param{int }{direction = wxLEFT}, \param{const wxString\& }{caption = wxEmptyString}}
142
143\func{bool}{AddPane}{\param{wxWindow* }{window}, \param{const wxAuiPaneInfo\& }{pane\_info}, \param{const wxPoint\& }{drop\_pos}}
144
145
146AddPane() 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.
147
148\membersection{wxAuiManager::DetachPane}\label{wxauimanagerdetachpane}
149
150\func{bool}{DetachPane}{\param{wxWindow* }{window}}
151
152Tells the wxAuiManager to stop managing the pane specified by window.
153The window, if in a floated frame, is reparented to the frame managed
154by wxAuiManager.
155
156\membersection{wxAuiManager::GetAllPanes}\label{wxauimanagergetallpanes}
157
158\func{wxAuiPaneInfoArray\&}{GetAllPanes}{\void}
159
160Returns an array of all panes managed by the frame manager.
161
162\membersection{wxAuiManager::GetArtProvider}\label{wxauimanagergetartprovider}
163
164\constfunc{wxAuiDockArt*}{GetArtProvider}{\void}
165
166Returns the current art provider being used.
167
168See also: \helpref{wxAuiDockArt}{wxauidockart}.
169
170\membersection{wxAuiManager::GetFlags}\label{wxauimanagergetflags}
171
172\constfunc{unsigned int}{GetFlags}{\void}
173
174Returns the current manager's flags.
175
176\membersection{wxAuiManager::GetManagedWindow}\label{wxauimanagergetmanagedwindow}
177
178\constfunc{wxWindow*}{GetManagedWindow}{\void}
179
180Returns the frame currently being managed by wxAuiManager.
181
a95dd1d8
BW
182\func{static wxAuiManager*}{GetManager}{\param{wxWindow* }{window}}
183
184Calling this method will return the wxAuiManager for a given window. The \arg{window} parameter should
185specify any child window or sub-child window of the frame or window managed by wxAuiManager.
186The \arg{window} parameter need not be managed by the manager itself, nor does it even need to be a child
187or sub-child of a managed window. It must however be inside the window hierarchy underneath the managed
188window.
189
e67635d4
RR
190\membersection{wxAuiManager::GetPane}\label{wxauimanagergetpane}
191
192\func{wxAuiPaneInfo\&}{GetPane}{\param{wxWindow* }{window}}
193
194\func{wxAuiPaneInfo\&}{GetPane}{\param{const wxString\& }{name}}
195
196{\it GetPane} is used to lookup a wxAuiPaneInfo object
197either by window pointer or by pane name, which acts as a unique id for
198a window pane. The returned wxAuiPaneInfo object may then be modified to
199change a pane's look, state or position. After one or more
200modifications to wxAuiPaneInfo, wxAuiManager::Update() should be called
201to commit the changes to the user interface. If the lookup failed
202(meaning the pane could not be found in the manager), a call to the
203returned wxAuiPaneInfo's IsOk() method will return false.
204
205\membersection{wxAuiManager::HideHint}\label{wxauimanagerhidehint}
206
207\func{void}{HideHint}{\void}
208
209HideHint() hides any docking hint that may be visible.
210
211\membersection{wxAuiManager::InsertPane}\label{wxauimanagerinsertpane}
212
213\func{bool}{InsertPane}{\param{wxWindow* }{window}, \param{const wxAuiPaneInfo\& }{insert\_location}, \param{int }{insert\_level = wxAUI\_INSERT\_PANE}}
214
215This method is used to insert either a previously unmanaged pane window
216into the frame manager, or to insert a currently managed pane somewhere
217else. {\it InsertPane} will push all panes, rows, or docks aside and
218insert the window into the position specified by \arg{insert\_location}.
219Because \arg{insert\_location} can specify either a pane, dock row, or dock
220layer, the \arg{insert\_level} parameter is used to disambiguate this. The
221parameter \arg{insert\_level} can take a value of wxAUI\_INSERT\_PANE, wxAUI\_INSERT\_ROW
222or wxAUI\_INSERT\_DOCK.
223
224\membersection{wxAuiManager::LoadPaneInfo}\label{wxauimanagerloadpaneinfo}
225
226\func{void}{LoadPaneInfo}{\param{wxString }{pane\_part}, \param{wxAuiPaneInfo\& }{pane}}
227
228LoadPaneInfo() is similar to to LoadPerspective, with the exception that it only loads information about a single pane. It is used in combination with SavePaneInfo().
229
230\membersection{wxAuiManager::LoadPerspective}\label{wxauimanagerloadperspective}
231
232\func{bool}{LoadPerspective}{\param{const wxString\& }{perspective}, \param{bool }{update = true}}
233
234Loads a saved perspective. If update is true, wxAuiManager::Update()
235is automatically invoked, thus realizing the saved perspective on screen.
236
237\membersection{wxAuiManager::ProcessDockResult}\label{wxauimanagerprocessdockresult}
238
239\func{bool}{ProcessDockResult}{\param{wxAuiPaneInfo\& }{target}, \param{const wxAuiPaneInfo\& }{new\_pos}}
240
241ProcessDockResult() is a protected member of the wxAUI layout manager. It can be overridden by derived classes to provide custom docking calculations.
242
243\membersection{wxAuiManager::SavePaneInfo}\label{wxauimanagersavepaneinfo}
244
245\func{wxString}{SavePaneInfo}{\param{wxAuiPaneInfo\& }{pane}}
246
247SavePaneInfo() is similar to SavePerspective, with the exception that it only saves information about a single pane. It is used in combination with LoadPaneInfo().
248
249\membersection{wxAuiManager::SavePerspective}\label{wxauimanagersaveperspective}
250
251\func{wxString}{SavePerspective}{\void}
252
253Saves the entire user interface layout into an encoded wxString, which
254can then be stored by the application (probably using wxConfig). When
255a perspective is restored using LoadPerspective(), the entire user
256interface will return to the state it was when the perspective was saved.
257
258\membersection{wxAuiManager::SetArtProvider}\label{wxauimanagersetartprovider}
259
260\func{void}{SetArtProvider}{\param{wxAuiDockArt* }{art\_provider}}
261
262Instructs wxAuiManager to use art provider specified by parameter
263\arg{art\_provider} for all drawing calls. This allows plugable
264look-and-feel features. The previous art provider object, if any,
265will be deleted by wxAuiManager.
266
267See also: \helpref{wxAuiDockArt}{wxauidockart}.
268
269\membersection{wxAuiManager::SetFlags}\label{wxauimanagersetflags}
270
271\func{void}{SetFlags}{\param{unsigned int }{flags}}
272
273This method is used to specify wxAuiManager's settings flags. \arg{flags}
274specifies options which allow the frame management behavior to be modified.
275
276\membersection{wxAuiManager::SetManagedWindow}\label{wxauimanagersetmanagedwindow}
277
278\func{void}{SetManagedWindow}{\param{wxWindow* }{managed\_wnd}}
279
280Called 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.
281
282\membersection{wxAuiManager::ShowHint}\label{wxauimanagershowhint}
283
284\func{void}{ShowHint}{\param{const wxRect\& }{rect}}
285
286This 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.
287
288\membersection{wxAuiManager::UnInit}\label{wxauimanageruninit}
289
290\func{void}{UnInit}{\void}
291
292Uninitializes 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.
293
294\membersection{wxAuiManager::Update}\label{wxauimanagerupdate}
295
296\func{void}{Update}{\void}
297
298This method is called after any number of changes are
299made to any of the managed panes. Update() must be invoked after
300AddPane() or InsertPane() are called in order to "realize" or "commit"
301the changes. In addition, any number of changes may be made to
302wxAuiPaneInfo structures (retrieved with wxAuiManager::GetPane), but to
303realize the changes, Update() must be called. This construction allows
304pane flicker to be avoided by updating the whole layout at one time.
305