]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: aui/aui.h | |
e54c96f1 | 3 | // Purpose: interface of wxAuiManager |
23324ae1 | 4 | // Author: wxWidgets team |
526954c5 | 5 | // Licence: wxWindows licence |
23324ae1 FM |
6 | ///////////////////////////////////////////////////////////////////////////// |
7 | ||
47d602c1 FM |
8 | |
9 | /** | |
ea6e8ec5 | 10 | @todo wxAuiPaneInfo dock direction types used with wxAuiManager. |
47d602c1 FM |
11 | */ |
12 | enum wxAuiManagerDock | |
13 | { | |
14 | wxAUI_DOCK_NONE = 0, | |
15 | wxAUI_DOCK_TOP = 1, | |
16 | wxAUI_DOCK_RIGHT = 2, | |
17 | wxAUI_DOCK_BOTTOM = 3, | |
18 | wxAUI_DOCK_LEFT = 4, | |
19 | wxAUI_DOCK_CENTER = 5, | |
20 | wxAUI_DOCK_CENTRE = wxAUI_DOCK_CENTER | |
21 | }; | |
22 | ||
23 | ||
24 | /** | |
c75e580c | 25 | wxAuiManager behaviour and visual effects style flags. |
47d602c1 FM |
26 | */ |
27 | enum wxAuiManagerOption | |
28 | { | |
c75e580c | 29 | /// Allow a pane to be undocked to take the form of a wxMiniFrame. |
47d602c1 | 30 | wxAUI_MGR_ALLOW_FLOATING = 1 << 0, |
c75e580c | 31 | /// Change the color of the title bar of the pane when it is activated. |
47d602c1 | 32 | wxAUI_MGR_ALLOW_ACTIVE_PANE = 1 << 1, |
c75e580c | 33 | /// Make the pane transparent during its movement. |
47d602c1 | 34 | wxAUI_MGR_TRANSPARENT_DRAG = 1 << 2, |
c75e580c | 35 | /// The possible location for docking is indicated by a translucent area. |
47d602c1 | 36 | wxAUI_MGR_TRANSPARENT_HINT = 1 << 3, |
c75e580c VZ |
37 | /// The possible location for docking is indicated by a gradually appearing |
38 | /// partially transparent area. | |
47d602c1 | 39 | wxAUI_MGR_VENETIAN_BLINDS_HINT = 1 << 4, |
c75e580c | 40 | /// The possible location for docking is indicated by a rectangular outline. |
47d602c1 | 41 | wxAUI_MGR_RECTANGLE_HINT = 1 << 5, |
c75e580c | 42 | /// The translucent area where the pane could be docked appears gradually. |
47d602c1 | 43 | wxAUI_MGR_HINT_FADE = 1 << 6, |
c75e580c | 44 | /// Used in complement of wxAUI_MGR_VENETIAN_BLINDS_HINT to show the hint immediately. |
47d602c1 | 45 | wxAUI_MGR_NO_VENETIAN_BLINDS_FADE = 1 << 7, |
c75e580c VZ |
46 | /// When a docked pane is resized, its content is refreshed in live (instead of moving |
47 | /// the border alone and refreshing the content at the end). | |
68030cae | 48 | wxAUI_MGR_LIVE_RESIZE = 1 << 8, |
c75e580c | 49 | /// Default behavior. |
47d602c1 FM |
50 | wxAUI_MGR_DEFAULT = wxAUI_MGR_ALLOW_FLOATING | |
51 | wxAUI_MGR_TRANSPARENT_HINT | | |
52 | wxAUI_MGR_HINT_FADE | | |
53 | wxAUI_MGR_NO_VENETIAN_BLINDS_FADE | |
54 | }; | |
55 | ||
23324ae1 FM |
56 | /** |
57 | @class wxAuiManager | |
7c913512 | 58 | |
23324ae1 | 59 | wxAuiManager is the central class of the wxAUI class framework. |
7c913512 | 60 | |
47d602c1 FM |
61 | wxAuiManager manages the panes associated with it for a particular wxFrame, |
62 | using a pane's wxAuiPaneInfo information to determine each pane's docking | |
4c51a665 | 63 | and floating behaviour. |
7c913512 | 64 | |
ea6e8ec5 BP |
65 | wxAuiManager uses wxWidgets' sizer mechanism to plan the layout of each |
66 | frame. It uses a replaceable dock art class to do all drawing, so all | |
67 | drawing is localized in one area, and may be customized depending on an | |
68 | application's specific needs. | |
7c913512 | 69 | |
23324ae1 FM |
70 | wxAuiManager works as follows: the programmer adds panes to the class, |
71 | or makes changes to existing pane properties (dock position, floating | |
72 | state, show state, etc.). To apply these changes, wxAuiManager's | |
73 | Update() function is called. This batch processing can be used to avoid | |
74 | flicker, by modifying more than one pane at a time, and then "committing" | |
75 | all of the changes at once by calling Update(). | |
7c913512 | 76 | |
23324ae1 | 77 | Panes can be added quite easily: |
7c913512 | 78 | |
23324ae1 FM |
79 | @code |
80 | wxTextCtrl* text1 = new wxTextCtrl(this, -1); | |
81 | wxTextCtrl* text2 = new wxTextCtrl(this, -1); | |
f8ebb70d FM |
82 | m_mgr.AddPane(text1, wxLEFT, "Pane Caption"); |
83 | m_mgr.AddPane(text2, wxBOTTOM, "Pane Caption"); | |
23324ae1 FM |
84 | m_mgr.Update(); |
85 | @endcode | |
7c913512 | 86 | |
23324ae1 FM |
87 | Later on, the positions can be modified easily. The following will float |
88 | an existing pane in a tool window: | |
7c913512 | 89 | |
23324ae1 FM |
90 | @code |
91 | m_mgr.GetPane(text1).Float(); | |
92 | @endcode | |
7c913512 | 93 | |
47d602c1 | 94 | |
3a74a290 | 95 | @section auimanager_layers Layers, Rows and Directions, Positions |
47d602c1 | 96 | |
8d483c9b | 97 | Inside wxAUI, the docking layout is figured out by checking several pane |
ea6e8ec5 BP |
98 | parameters. Four of these are important for determining where a pane will |
99 | end up: | |
100 | ||
101 | @li Direction: Each docked pane has a direction, Top, Bottom, Left, Right, | |
102 | or Center. This is fairly self-explanatory. The pane will be placed in | |
103 | the location specified by this variable. | |
104 | @li Position: More than one pane can be placed inside of a dock. Imagine | |
105 | two panes being docked on the left side of a window. One pane can be | |
106 | placed over another. In proportionally managed docks, the pane | |
107 | position indicates its sequential position, starting with zero. So, in | |
108 | our scenario with two panes docked on the left side, the top pane in | |
109 | the dock would have position 0, and the second one would occupy | |
47d602c1 | 110 | position 1. |
ea6e8ec5 BP |
111 | @li Row: A row can allow for two docks to be placed next to each other. |
112 | One of the most common places for this to happen is in the toolbar. | |
113 | Multiple toolbar rows are allowed, the first row being row 0, and the | |
114 | second row 1. Rows can also be used on vertically docked panes. | |
115 | @li Layer: A layer is akin to an onion. Layer 0 is the very center of the | |
116 | managed pane. Thus, if a pane is in layer 0, it will be closest to the | |
117 | center window (also sometimes known as the "content window"). | |
118 | Increasing layers "swallow up" all layers of a lower value. This can | |
119 | look very similar to multiple rows, but is different because all panes | |
120 | in a lower level yield to panes in higher levels. The best way to | |
121 | understand layers is by running the wxAUI sample. | |
122 | ||
c75e580c VZ |
123 | @beginStyleTable |
124 | @style{wxAUI_MGR_ALLOW_FLOATING} | |
125 | Allow a pane to be undocked to take the form of a wxMiniFrame. | |
126 | @style{wxAUI_MGR_ALLOW_ACTIVE_PANE} | |
127 | Change the color of the title bar of the pane when it is activated. | |
128 | @style{wxAUI_MGR_TRANSPARENT_DRAG} | |
129 | Make the pane transparent during its movement. | |
130 | @style{wxAUI_MGR_TRANSPARENT_HINT} | |
131 | The possible location for docking is indicated by a translucent area. | |
132 | @style{wxAUI_MGR_VENETIAN_BLINDS_HINT} | |
133 | The possible location for docking is indicated by gradually | |
134 | appearing partially transparent hint. | |
135 | @style{wxAUI_MGR_RECTANGLE_HINT} | |
136 | The possible location for docking is indicated by a rectangular | |
137 | outline. | |
138 | @style{wxAUI_MGR_HINT_FADE} | |
139 | The translucent area where the pane could be docked appears gradually. | |
140 | @style{wxAUI_MGR_NO_VENETIAN_BLINDS_FADE} | |
141 | Used in complement of wxAUI_MGR_VENETIAN_BLINDS_HINT to show the | |
142 | docking hint immediately. | |
143 | @style{wxAUI_MGR_LIVE_RESIZE} | |
144 | When a docked pane is resized, its content is refreshed in live (instead of moving | |
145 | the border alone and refreshing the content at the end). | |
146 | @style{wxAUI_MGR_DEFAULT} | |
147 | Default behavior, combines: wxAUI_MGR_ALLOW_FLOATING | wxAUI_MGR_TRANSPARENT_HINT | | |
148 | wxAUI_MGR_HINT_FADE | wxAUI_MGR_NO_VENETIAN_BLINDS_FADE. | |
149 | @endStyleTable | |
ea6e8ec5 | 150 | |
3051a44a | 151 | @beginEventEmissionTable{wxAuiManagerEvent} |
ea6e8ec5 BP |
152 | @event{EVT_AUI_PANE_BUTTON(func)} |
153 | Triggered when any button is pressed for any docked panes. | |
154 | @event{EVT_AUI_PANE_CLOSE(func)} | |
155 | Triggered when a docked or floating pane is closed. | |
156 | @event{EVT_AUI_PANE_MAXIMIZE(func)} | |
157 | Triggered when a pane is maximized. | |
158 | @event{EVT_AUI_PANE_RESTORE(func)} | |
159 | Triggered when a pane is restored. | |
3a1ec1d5 VZ |
160 | @event{EVT_AUI_PANE_ACTIVATED(func)} |
161 | Triggered when a pane is made 'active'. This event is new since | |
162 | wxWidgets 2.9.4. | |
ea6e8ec5 BP |
163 | @event{EVT_AUI_RENDER(func)} |
164 | This event can be caught to override the default renderer in order to | |
165 | custom draw your wxAuiManager window (not recommended). | |
166 | @endEventTable | |
47d602c1 | 167 | |
35b8c1a0 | 168 | @library{wxaui} |
23324ae1 | 169 | @category{aui} |
7c913512 | 170 | |
ea6e8ec5 | 171 | @see @ref overview_aui, wxAuiNotebook, wxAuiDockArt, wxAuiPaneInfo |
23324ae1 FM |
172 | */ |
173 | class wxAuiManager : public wxEvtHandler | |
174 | { | |
175 | public: | |
176 | /** | |
94cac3bf VZ |
177 | Constructor. |
178 | ||
179 | @param managed_wnd | |
180 | Specifies the wxFrame which should be managed. | |
181 | @param flags | |
182 | Specifies the frame management behaviour and visual effects | |
183 | with the ::wxAuiManagerOption's style flags. | |
23324ae1 | 184 | */ |
4cc4bfaf | 185 | wxAuiManager(wxWindow* managed_wnd = NULL, |
23324ae1 FM |
186 | unsigned int flags = wxAUI_MGR_DEFAULT); |
187 | ||
188 | /** | |
47d602c1 | 189 | Dtor. |
23324ae1 | 190 | */ |
8d483c9b | 191 | virtual ~wxAuiManager(); |
23324ae1 FM |
192 | |
193 | //@{ | |
194 | /** | |
47d602c1 FM |
195 | AddPane() tells the frame manager to start managing a child window. |
196 | There are several versions of this function. The first version allows | |
197 | the full spectrum of pane parameter possibilities. The second version is | |
198 | used for simpler user interfaces which do not require as much configuration. | |
199 | The last version allows a drop position to be specified, which will determine | |
200 | where the pane will be added. | |
23324ae1 FM |
201 | */ |
202 | bool AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info); | |
7c913512 FM |
203 | bool AddPane(wxWindow* window, int direction = wxLEFT, |
204 | const wxString& caption = wxEmptyString); | |
205 | bool AddPane(wxWindow* window, | |
206 | const wxAuiPaneInfo& pane_info, | |
207 | const wxPoint& drop_pos); | |
23324ae1 FM |
208 | //@} |
209 | ||
210 | /** | |
211 | Tells the wxAuiManager to stop managing the pane specified by window. | |
212 | The window, if in a floated frame, is reparented to the frame managed | |
213 | by wxAuiManager. | |
214 | */ | |
215 | bool DetachPane(wxWindow* window); | |
216 | ||
217 | /** | |
218 | Returns an array of all panes managed by the frame manager. | |
219 | */ | |
d2aa927a | 220 | wxAuiPaneInfoArray& GetAllPanes(); |
23324ae1 FM |
221 | |
222 | /** | |
223 | Returns the current art provider being used. | |
47d602c1 | 224 | @see wxAuiDockArt. |
23324ae1 | 225 | */ |
328f5751 | 226 | wxAuiDockArt* GetArtProvider() const; |
23324ae1 FM |
227 | |
228 | /** | |
47d602c1 FM |
229 | Returns the current dock constraint values. |
230 | See SetDockSizeConstraint() for more information. | |
23324ae1 | 231 | */ |
d2aa927a | 232 | void GetDockSizeConstraint(double* widthpct, double* heightpct) const; |
23324ae1 FM |
233 | |
234 | /** | |
94cac3bf | 235 | Returns the current ::wxAuiManagerOption's flags. |
23324ae1 | 236 | */ |
328f5751 | 237 | unsigned int GetFlags() const; |
23324ae1 FM |
238 | |
239 | /** | |
240 | Returns the frame currently being managed by wxAuiManager. | |
241 | */ | |
328f5751 | 242 | wxWindow* GetManagedWindow() const; |
23324ae1 FM |
243 | |
244 | /** | |
47d602c1 | 245 | Calling this method will return the wxAuiManager for a given window. |
8d483c9b | 246 | The @a window parameter should specify any child window or sub-child |
47d602c1 FM |
247 | window of the frame or window managed by wxAuiManager. |
248 | ||
4cc4bfaf | 249 | The @a window parameter need not be managed by the manager itself, nor does it |
47d602c1 FM |
250 | even need to be a child or sub-child of a managed window. It must however |
251 | be inside the window hierarchy underneath the managed window. | |
23324ae1 FM |
252 | */ |
253 | static wxAuiManager* GetManager(wxWindow* window); | |
254 | ||
255 | //@{ | |
256 | /** | |
47d602c1 FM |
257 | GetPane() is used to lookup a wxAuiPaneInfo object either by window pointer |
258 | or by pane name, which acts as a unique id for a window pane. | |
259 | ||
260 | The returned wxAuiPaneInfo object may then be modified to change a pane's | |
8d483c9b FM |
261 | look, state or position. After one or more modifications to wxAuiPaneInfo, |
262 | wxAuiManager::Update() should be called to commit the changes to the user | |
263 | interface. If the lookup failed (meaning the pane could not be found in the | |
47d602c1 | 264 | manager), a call to the returned wxAuiPaneInfo's IsOk() method will return @false. |
23324ae1 | 265 | */ |
882678eb FM |
266 | wxAuiPaneInfo& GetPane(wxWindow* window); |
267 | wxAuiPaneInfo& GetPane(const wxString& name); | |
23324ae1 FM |
268 | //@} |
269 | ||
270 | /** | |
271 | HideHint() hides any docking hint that may be visible. | |
272 | */ | |
d2aa927a | 273 | virtual void HideHint(); |
23324ae1 FM |
274 | |
275 | /** | |
276 | This method is used to insert either a previously unmanaged pane window | |
7c913512 | 277 | into the frame manager, or to insert a currently managed pane somewhere |
47d602c1 FM |
278 | else. InsertPane() will push all panes, rows, or docks aside and |
279 | insert the window into the position specified by @a insert_location. | |
280 | ||
4cc4bfaf | 281 | Because @a insert_location can specify either a pane, dock row, or dock |
47d602c1 FM |
282 | layer, the @a insert_level parameter is used to disambiguate this. |
283 | The parameter @a insert_level can take a value of wxAUI_INSERT_PANE, | |
284 | wxAUI_INSERT_ROW or wxAUI_INSERT_DOCK. | |
23324ae1 FM |
285 | */ |
286 | bool InsertPane(wxWindow* window, | |
287 | const wxAuiPaneInfo& insert_location, | |
288 | int insert_level = wxAUI_INSERT_PANE); | |
289 | ||
290 | /** | |
57ab6f23 | 291 | LoadPaneInfo() is similar to LoadPerspective, with the exception that it |
47d602c1 FM |
292 | only loads information about a single pane. It is used in combination with |
293 | SavePaneInfo(). | |
23324ae1 FM |
294 | */ |
295 | void LoadPaneInfo(wxString pane_part, wxAuiPaneInfo& pane); | |
296 | ||
297 | /** | |
298 | Loads a saved perspective. If update is @true, wxAuiManager::Update() | |
299 | is automatically invoked, thus realizing the saved perspective on screen. | |
300 | */ | |
301 | bool LoadPerspective(const wxString& perspective, | |
4cc4bfaf | 302 | bool update = true); |
23324ae1 | 303 | |
23324ae1 FM |
304 | /** |
305 | SavePaneInfo() is similar to SavePerspective, with the exception that it only | |
47d602c1 FM |
306 | saves information about a single pane. It is used in combination with |
307 | LoadPaneInfo(). | |
23324ae1 FM |
308 | */ |
309 | wxString SavePaneInfo(wxAuiPaneInfo& pane); | |
310 | ||
311 | /** | |
312 | Saves the entire user interface layout into an encoded wxString, which | |
47d602c1 FM |
313 | can then be stored by the application (probably using wxConfig). |
314 | ||
315 | When a perspective is restored using LoadPerspective(), the entire user | |
23324ae1 FM |
316 | interface will return to the state it was when the perspective was saved. |
317 | */ | |
318 | wxString SavePerspective(); | |
319 | ||
320 | /** | |
321 | Instructs wxAuiManager to use art provider specified by parameter | |
8d483c9b | 322 | @a art_provider for all drawing calls. |
47d602c1 FM |
323 | This allows plugable look-and-feel features. The previous art provider object, |
324 | if any, will be deleted by wxAuiManager. | |
325 | ||
326 | @see wxAuiDockArt. | |
23324ae1 FM |
327 | */ |
328 | void SetArtProvider(wxAuiDockArt* art_provider); | |
329 | ||
330 | /** | |
331 | When a user creates a new dock by dragging a window into a docked position, | |
47d602c1 | 332 | often times the large size of the window will create a dock that is unwieldly |
8d483c9b | 333 | large. wxAuiManager by default limits the size of any new dock to 1/3 of the |
47d602c1 FM |
334 | window size. For horizontal docks, this would be 1/3 of the window height. |
335 | For vertical docks, 1/3 of the width. | |
336 | ||
337 | Calling this function will adjust this constraint value. The numbers must be | |
338 | between 0.0 and 1.0. For instance, calling SetDockSizeContraint with | |
339 | 0.5, 0.5 will cause new docks to be limited to half of the size of the | |
340 | entire managed window. | |
23324ae1 FM |
341 | */ |
342 | void SetDockSizeConstraint(double widthpct, double heightpct); | |
343 | ||
344 | /** | |
94cac3bf | 345 | This method is used to specify ::wxAuiManagerOption's flags. @a flags |
4c51a665 | 346 | specifies options which allow the frame management behaviour to be modified. |
23324ae1 | 347 | */ |
d56f17d8 | 348 | void SetFlags(unsigned int flags); |
23324ae1 FM |
349 | |
350 | /** | |
7c913512 | 351 | Called to specify the frame or window which is to be managed by wxAuiManager. |
47d602c1 FM |
352 | Frame management is not restricted to just frames. Child windows or custom |
353 | controls are also allowed. | |
23324ae1 FM |
354 | */ |
355 | void SetManagedWindow(wxWindow* managed_wnd); | |
356 | ||
357 | /** | |
358 | This function is used by controls to explicitly show a hint window at the | |
47d602c1 | 359 | specified rectangle. It is rarely called, and is mostly used by controls |
8d483c9b | 360 | implementing custom pane drag/drop behaviour. |
47d602c1 | 361 | The specified rectangle should be in screen coordinates. |
23324ae1 | 362 | */ |
d2aa927a | 363 | virtual void ShowHint(const wxRect& rect); |
23324ae1 FM |
364 | |
365 | /** | |
366 | Uninitializes the framework and should be called before a managed frame or | |
8d483c9b FM |
367 | window is destroyed. UnInit() is usually called in the managed wxFrame's |
368 | destructor. It is necessary to call this function before the managed frame | |
369 | or window is destroyed, otherwise the manager cannot remove its custom event | |
47d602c1 | 370 | handlers from a window. |
23324ae1 FM |
371 | */ |
372 | void UnInit(); | |
373 | ||
374 | /** | |
375 | This method is called after any number of changes are | |
376 | made to any of the managed panes. Update() must be invoked after | |
377 | AddPane() or InsertPane() are called in order to "realize" or "commit" | |
378 | the changes. In addition, any number of changes may be made to | |
379 | wxAuiPaneInfo structures (retrieved with wxAuiManager::GetPane), but to | |
380 | realize the changes, Update() must be called. This construction allows | |
381 | pane flicker to be avoided by updating the whole layout at one time. | |
382 | */ | |
383 | void Update(); | |
1d497b99 FM |
384 | |
385 | protected: | |
386 | ||
387 | /** | |
388 | ProcessDockResult() is a protected member of the wxAUI layout manager. | |
389 | It can be overridden by derived classes to provide custom docking calculations. | |
390 | */ | |
391 | virtual bool ProcessDockResult(wxAuiPaneInfo& target, | |
392 | const wxAuiPaneInfo& new_pos); | |
23324ae1 FM |
393 | }; |
394 | ||
395 | ||
e54c96f1 | 396 | |
23324ae1 FM |
397 | /** |
398 | @class wxAuiPaneInfo | |
7c913512 | 399 | |
23324ae1 | 400 | wxAuiPaneInfo is part of the wxAUI class framework. |
47d602c1 | 401 | See also @ref overview_aui. |
7c913512 | 402 | |
23324ae1 | 403 | wxAuiPaneInfo specifies all the parameters for a pane. |
47d602c1 FM |
404 | These parameters specify where the pane is on the screen, whether it is docked |
405 | or floating, or hidden. | |
8d483c9b | 406 | In addition, these parameters specify the pane's docked position, floating |
47d602c1 | 407 | position, preferred size, minimum size, caption text among many other parameters. |
7c913512 | 408 | |
f00f01b3 | 409 | @library{wxaui} |
23324ae1 | 410 | @category{aui} |
7c913512 | 411 | |
e54c96f1 | 412 | @see wxAuiManager, wxAuiDockArt |
23324ae1 | 413 | */ |
7c913512 | 414 | class wxAuiPaneInfo |
23324ae1 FM |
415 | { |
416 | public: | |
47d602c1 FM |
417 | wxAuiPaneInfo(); |
418 | ||
23324ae1 FM |
419 | /** |
420 | Copy constructor. | |
421 | */ | |
7c913512 | 422 | wxAuiPaneInfo(const wxAuiPaneInfo& c); |
23324ae1 FM |
423 | |
424 | //@{ | |
425 | /** | |
426 | BestSize() sets the ideal size for the pane. The docking manager will attempt | |
427 | to use this size as much as possible when docking or floating the pane. | |
428 | */ | |
882678eb FM |
429 | wxAuiPaneInfo& BestSize(const wxSize& size); |
430 | wxAuiPaneInfo& BestSize(int x, int y); | |
23324ae1 FM |
431 | //@} |
432 | ||
433 | /** | |
434 | Bottom() sets the pane dock position to the bottom side of the frame. This is | |
435 | the same thing as calling Direction(wxAUI_DOCK_BOTTOM). | |
436 | */ | |
d2aa927a | 437 | wxAuiPaneInfo& Bottom(); |
23324ae1 FM |
438 | |
439 | /** | |
440 | BottomDockable() indicates whether a pane can be docked at the bottom of the | |
441 | frame. | |
442 | */ | |
d2aa927a | 443 | wxAuiPaneInfo& BottomDockable(bool b = true); |
23324ae1 FM |
444 | |
445 | /** | |
446 | Caption() sets the caption of the pane. | |
447 | */ | |
d2aa927a | 448 | wxAuiPaneInfo& Caption(const wxString& c); |
23324ae1 FM |
449 | |
450 | /** | |
451 | CaptionVisible indicates that a pane caption should be visible. If @false, no | |
452 | pane caption is drawn. | |
453 | */ | |
d2aa927a | 454 | wxAuiPaneInfo& CaptionVisible(bool visible = true); |
23324ae1 FM |
455 | |
456 | //@{ | |
457 | /** | |
458 | Center() sets the pane dock position to the left side of the frame. | |
459 | The centre pane is the space in the middle after all border panes (left, top, | |
460 | right, bottom) are subtracted from the layout. | |
23324ae1 FM |
461 | This is the same thing as calling Direction(wxAUI_DOCK_CENTRE). |
462 | */ | |
382f12e4 FM |
463 | wxAuiPaneInfo& Centre(); |
464 | wxAuiPaneInfo& Center(); | |
23324ae1 FM |
465 | //@} |
466 | ||
467 | //@{ | |
468 | /** | |
469 | CentrePane() specifies that the pane should adopt the default center pane | |
8d483c9b | 470 | settings. Centre panes usually do not have caption bars. |
47d602c1 FM |
471 | This function provides an easy way of preparing a pane to be displayed in |
472 | the center dock position. | |
23324ae1 | 473 | */ |
382f12e4 FM |
474 | wxAuiPaneInfo& CentrePane(); |
475 | wxAuiPaneInfo& CenterPane(); | |
23324ae1 FM |
476 | //@} |
477 | ||
478 | /** | |
479 | CloseButton() indicates that a close button should be drawn for the pane. | |
480 | */ | |
d2aa927a | 481 | wxAuiPaneInfo& CloseButton(bool visible = true); |
23324ae1 FM |
482 | |
483 | /** | |
484 | DefaultPane() specifies that the pane should adopt the default pane settings. | |
485 | */ | |
d2aa927a | 486 | wxAuiPaneInfo& DefaultPane(); |
23324ae1 FM |
487 | |
488 | /** | |
57ab6f23 | 489 | DestroyOnClose() indicates whether a pane should be destroyed when it is closed. |
8d483c9b | 490 | Normally a pane is simply hidden when the close button is clicked. |
47d602c1 FM |
491 | Setting DestroyOnClose to @true will cause the window to be destroyed when |
492 | the user clicks the pane's close button. | |
23324ae1 | 493 | */ |
d2aa927a | 494 | wxAuiPaneInfo& DestroyOnClose(bool b = true); |
23324ae1 FM |
495 | |
496 | /** | |
497 | Direction() determines the direction of the docked pane. It is functionally the | |
47d602c1 FM |
498 | same as calling Left(), Right(), Top() or Bottom(), except that docking direction |
499 | may be specified programmatically via the parameter. | |
23324ae1 | 500 | */ |
d2aa927a | 501 | wxAuiPaneInfo& Direction(int direction); |
23324ae1 FM |
502 | |
503 | /** | |
504 | Dock() indicates that a pane should be docked. It is the opposite of Float(). | |
505 | */ | |
d2aa927a | 506 | wxAuiPaneInfo& Dock(); |
23324ae1 FM |
507 | |
508 | /** | |
509 | DockFixed() causes the containing dock to have no resize sash. This is useful | |
8d483c9b | 510 | for creating panes that span the entire width or height of a dock, but should |
47d602c1 | 511 | not be resizable in the other direction. |
23324ae1 | 512 | */ |
d2aa927a | 513 | wxAuiPaneInfo& DockFixed(bool b = true); |
23324ae1 FM |
514 | |
515 | /** | |
516 | Dockable() specifies whether a frame can be docked or not. It is the same as | |
517 | specifying TopDockable(b).BottomDockable(b).LeftDockable(b).RightDockable(b). | |
518 | */ | |
d2aa927a | 519 | wxAuiPaneInfo& Dockable(bool b = true); |
23324ae1 FM |
520 | |
521 | /** | |
522 | Fixed() forces a pane to be fixed size so that it cannot be resized. After | |
523 | calling Fixed(), IsFixed() will return @true. | |
524 | */ | |
d2aa927a | 525 | wxAuiPaneInfo& Fixed(); |
23324ae1 FM |
526 | |
527 | /** | |
528 | Float() indicates that a pane should be floated. It is the opposite of Dock(). | |
529 | */ | |
d2aa927a | 530 | wxAuiPaneInfo& Float(); |
23324ae1 FM |
531 | |
532 | /** | |
533 | Floatable() sets whether the user will be able to undock a pane and turn it | |
534 | into a floating window. | |
535 | */ | |
d2aa927a | 536 | wxAuiPaneInfo& Floatable(bool b = true); |
23324ae1 FM |
537 | |
538 | //@{ | |
539 | /** | |
540 | FloatingPosition() sets the position of the floating pane. | |
541 | */ | |
882678eb FM |
542 | wxAuiPaneInfo& FloatingPosition(const wxPoint& pos); |
543 | wxAuiPaneInfo& FloatingPosition(int x, int y); | |
23324ae1 FM |
544 | //@} |
545 | ||
546 | //@{ | |
547 | /** | |
548 | FloatingSize() sets the size of the floating pane. | |
549 | */ | |
882678eb FM |
550 | wxAuiPaneInfo& FloatingSize(const wxSize& size); |
551 | wxAuiPaneInfo& FloatingSize(int x, int y); | |
23324ae1 FM |
552 | //@} |
553 | ||
554 | /** | |
555 | Gripper() indicates that a gripper should be drawn for the pane. | |
556 | */ | |
d2aa927a | 557 | wxAuiPaneInfo& Gripper(bool visible = true); |
23324ae1 FM |
558 | |
559 | /** | |
560 | GripperTop() indicates that a gripper should be drawn at the top of the pane. | |
561 | */ | |
d2aa927a | 562 | wxAuiPaneInfo& GripperTop(bool attop = true); |
23324ae1 FM |
563 | |
564 | /** | |
565 | HasBorder() returns @true if the pane displays a border. | |
566 | */ | |
328f5751 | 567 | bool HasBorder() const; |
23324ae1 FM |
568 | |
569 | /** | |
570 | HasCaption() returns @true if the pane displays a caption. | |
571 | */ | |
328f5751 | 572 | bool HasCaption() const; |
23324ae1 FM |
573 | |
574 | /** | |
575 | HasCloseButton() returns @true if the pane displays a button to close the pane. | |
576 | */ | |
328f5751 | 577 | bool HasCloseButton() const; |
23324ae1 FM |
578 | |
579 | /** | |
e227438f VZ |
580 | HasFlag() returns @true if the property specified by flag is active for |
581 | the pane. | |
23324ae1 | 582 | */ |
e227438f | 583 | bool HasFlag(int flag) const; |
23324ae1 FM |
584 | |
585 | /** | |
586 | HasGripper() returns @true if the pane displays a gripper. | |
587 | */ | |
328f5751 | 588 | bool HasGripper() const; |
23324ae1 FM |
589 | |
590 | /** | |
591 | HasGripper() returns @true if the pane displays a gripper at the top. | |
592 | */ | |
328f5751 | 593 | bool HasGripperTop() const; |
23324ae1 FM |
594 | |
595 | /** | |
596 | HasMaximizeButton() returns @true if the pane displays a button to maximize the | |
597 | pane. | |
598 | */ | |
328f5751 | 599 | bool HasMaximizeButton() const; |
23324ae1 FM |
600 | |
601 | /** | |
602 | HasMinimizeButton() returns @true if the pane displays a button to minimize the | |
603 | pane. | |
604 | */ | |
328f5751 | 605 | bool HasMinimizeButton() const; |
23324ae1 FM |
606 | |
607 | /** | |
608 | HasPinButton() returns @true if the pane displays a button to float the pane. | |
609 | */ | |
328f5751 | 610 | bool HasPinButton() const; |
23324ae1 FM |
611 | |
612 | /** | |
613 | Hide() indicates that a pane should be hidden. | |
614 | */ | |
d2aa927a | 615 | wxAuiPaneInfo& Hide(); |
23324ae1 | 616 | |
4254f672 VZ |
617 | /** |
618 | Icon() sets the icon of the pane. | |
619 | ||
620 | Notice that the height of the icon should be smaller than the value | |
621 | returned by wxAuiDockArt::GetMetric(wxAUI_DOCKART_CAPTION_SIZE) to | |
622 | ensure that it appears correctly. | |
623 | ||
624 | @since 2.9.2 | |
625 | */ | |
626 | wxAuiPaneInfo& Icon(const wxBitmap& b); | |
627 | ||
23324ae1 FM |
628 | /** |
629 | IsBottomDockable() returns @true if the pane can be docked at the bottom of the | |
630 | managed frame. | |
ab84bafe VZ |
631 | |
632 | @see IsDockable() | |
23324ae1 | 633 | */ |
328f5751 | 634 | bool IsBottomDockable() const; |
23324ae1 FM |
635 | |
636 | /** | |
ab84bafe VZ |
637 | Returns @true if the pane can be docked at any side. |
638 | ||
639 | @see IsTopDockable(), IsBottomDockable(), IsLeftDockable(), IsRightDockable() | |
640 | ||
641 | @since 2.9.2 | |
642 | */ | |
643 | bool IsDockable() const; | |
644 | ||
645 | /** | |
646 | IsDocked() returns @true if the pane is currently docked. | |
23324ae1 | 647 | */ |
328f5751 | 648 | bool IsDocked() const; |
23324ae1 FM |
649 | |
650 | /** | |
651 | IsFixed() returns @true if the pane cannot be resized. | |
652 | */ | |
328f5751 | 653 | bool IsFixed() const; |
23324ae1 FM |
654 | |
655 | /** | |
656 | IsFloatable() returns @true if the pane can be undocked and displayed as a | |
657 | floating window. | |
658 | */ | |
328f5751 | 659 | bool IsFloatable() const; |
23324ae1 FM |
660 | |
661 | /** | |
662 | IsFloating() returns @true if the pane is floating. | |
663 | */ | |
328f5751 | 664 | bool IsFloating() const; |
23324ae1 FM |
665 | |
666 | /** | |
667 | IsLeftDockable() returns @true if the pane can be docked on the left of the | |
668 | managed frame. | |
ab84bafe VZ |
669 | |
670 | @see IsDockable() | |
23324ae1 | 671 | */ |
328f5751 | 672 | bool IsLeftDockable() const; |
23324ae1 FM |
673 | |
674 | /** | |
675 | IsMoveable() returns @true if the docked frame can be undocked or moved to | |
676 | another dock position. | |
677 | */ | |
328f5751 | 678 | bool IsMovable() const; |
23324ae1 FM |
679 | |
680 | /** | |
681 | IsOk() returns @true if the wxAuiPaneInfo structure is valid. A pane structure | |
682 | is valid if it has an associated window. | |
683 | */ | |
328f5751 | 684 | bool IsOk() const; |
23324ae1 FM |
685 | |
686 | /** | |
687 | IsResizable() returns @true if the pane can be resized. | |
688 | */ | |
328f5751 | 689 | bool IsResizable() const; |
23324ae1 FM |
690 | |
691 | /** | |
692 | IsRightDockable() returns @true if the pane can be docked on the right of the | |
693 | managed frame. | |
ab84bafe VZ |
694 | |
695 | @see IsDockable() | |
23324ae1 | 696 | */ |
328f5751 | 697 | bool IsRightDockable() const; |
23324ae1 FM |
698 | |
699 | /** | |
700 | IsShown() returns @true if the pane is currently shown. | |
701 | */ | |
328f5751 | 702 | bool IsShown() const; |
23324ae1 FM |
703 | |
704 | /** | |
705 | IsToolbar() returns @true if the pane contains a toolbar. | |
706 | */ | |
328f5751 | 707 | bool IsToolbar() const; |
23324ae1 FM |
708 | |
709 | /** | |
710 | IsTopDockable() returns @true if the pane can be docked at the top of the | |
711 | managed frame. | |
ab84bafe VZ |
712 | |
713 | @see IsDockable() | |
23324ae1 | 714 | */ |
328f5751 | 715 | bool IsTopDockable() const; |
23324ae1 FM |
716 | |
717 | /** | |
718 | Layer() determines the layer of the docked pane. The dock layer is similar to | |
8d483c9b FM |
719 | an onion, the inner-most layer being layer 0. Each shell moving in the outward |
720 | direction has a higher layer number. This allows for more complex docking layout | |
47d602c1 | 721 | formation. |
23324ae1 | 722 | */ |
d2aa927a | 723 | wxAuiPaneInfo& Layer(int layer); |
23324ae1 FM |
724 | |
725 | /** | |
726 | Left() sets the pane dock position to the left side of the frame. This is the | |
727 | same thing as calling Direction(wxAUI_DOCK_LEFT). | |
728 | */ | |
d2aa927a | 729 | wxAuiPaneInfo& Left(); |
23324ae1 FM |
730 | |
731 | /** | |
732 | LeftDockable() indicates whether a pane can be docked on the left of the frame. | |
733 | */ | |
d2aa927a | 734 | wxAuiPaneInfo& LeftDockable(bool b = true); |
23324ae1 FM |
735 | |
736 | //@{ | |
737 | /** | |
738 | MaxSize() sets the maximum size of the pane. | |
739 | */ | |
882678eb FM |
740 | wxAuiPaneInfo& MaxSize(const wxSize& size); |
741 | wxAuiPaneInfo& MaxSize(int x, int y); | |
23324ae1 FM |
742 | //@} |
743 | ||
744 | /** | |
745 | MaximizeButton() indicates that a maximize button should be drawn for the pane. | |
746 | */ | |
d2aa927a | 747 | wxAuiPaneInfo& MaximizeButton(bool visible = true); |
23324ae1 FM |
748 | |
749 | //@{ | |
750 | /** | |
751 | MinSize() sets the minimum size of the pane. Please note that this is only | |
752 | partially supported as of this writing. | |
753 | */ | |
882678eb FM |
754 | wxAuiPaneInfo& MinSize(const wxSize& size); |
755 | wxAuiPaneInfo& MinSize(int x, int y); | |
23324ae1 FM |
756 | //@} |
757 | ||
758 | /** | |
759 | MinimizeButton() indicates that a minimize button should be drawn for the pane. | |
760 | */ | |
d2aa927a | 761 | wxAuiPaneInfo& MinimizeButton(bool visible = true); |
23324ae1 FM |
762 | |
763 | /** | |
764 | Movable indicates whether a frame can be moved. | |
765 | */ | |
d2aa927a | 766 | wxAuiPaneInfo& Movable(bool b = true); |
23324ae1 FM |
767 | |
768 | /** | |
769 | Name() sets the name of the pane so it can be referenced in lookup functions. | |
8d483c9b | 770 | If a name is not specified by the user, a random name is assigned to the pane |
47d602c1 | 771 | when it is added to the manager. |
23324ae1 | 772 | */ |
d2aa927a | 773 | wxAuiPaneInfo& Name(const wxString& n); |
23324ae1 FM |
774 | |
775 | /** | |
776 | PaneBorder indicates that a border should be drawn for the pane. | |
777 | */ | |
d2aa927a | 778 | wxAuiPaneInfo& PaneBorder(bool visible = true); |
23324ae1 FM |
779 | |
780 | /** | |
781 | PinButton() indicates that a pin button should be drawn for the pane. | |
782 | */ | |
d2aa927a | 783 | wxAuiPaneInfo& PinButton(bool visible = true); |
23324ae1 FM |
784 | |
785 | /** | |
786 | Position() determines the position of the docked pane. | |
787 | */ | |
d2aa927a | 788 | wxAuiPaneInfo& Position(int pos); |
23324ae1 FM |
789 | |
790 | /** | |
791 | Resizable() allows a pane to be resized if the parameter is @true, and forces it | |
792 | to be a fixed size if the parameter is @false. This is simply an antonym for Fixed(). | |
793 | */ | |
d2aa927a | 794 | wxAuiPaneInfo& Resizable(bool resizable = true); |
23324ae1 FM |
795 | |
796 | /** | |
797 | Right() sets the pane dock position to the right side of the frame. | |
798 | */ | |
d2aa927a | 799 | wxAuiPaneInfo& Right(); |
23324ae1 FM |
800 | |
801 | /** | |
802 | RightDockable() indicates whether a pane can be docked on the right of the | |
803 | frame. | |
804 | */ | |
d2aa927a | 805 | wxAuiPaneInfo& RightDockable(bool b = true); |
23324ae1 FM |
806 | |
807 | /** | |
808 | Row() determines the row of the docked pane. | |
809 | */ | |
d2aa927a | 810 | wxAuiPaneInfo& Row(int row); |
23324ae1 FM |
811 | |
812 | /** | |
813 | Write the safe parts of a newly loaded PaneInfo structure "source" into "this" | |
814 | used on loading perspectives etc. | |
815 | */ | |
816 | void SafeSet(wxAuiPaneInfo source); | |
817 | ||
818 | /** | |
819 | SetFlag() turns the property given by flag on or off with the option_state | |
820 | parameter. | |
821 | */ | |
d56f17d8 | 822 | wxAuiPaneInfo& SetFlag(int flag, bool option_state); |
23324ae1 FM |
823 | |
824 | /** | |
825 | Show() indicates that a pane should be shown. | |
826 | */ | |
d2aa927a | 827 | wxAuiPaneInfo& Show(bool show = true); |
23324ae1 FM |
828 | |
829 | /** | |
830 | ToolbarPane() specifies that the pane should adopt the default toolbar pane | |
831 | settings. | |
832 | */ | |
d2aa927a | 833 | wxAuiPaneInfo& ToolbarPane(); |
23324ae1 FM |
834 | |
835 | /** | |
836 | Top() sets the pane dock position to the top of the frame. | |
837 | */ | |
d2aa927a | 838 | wxAuiPaneInfo& Top(); |
23324ae1 FM |
839 | |
840 | /** | |
841 | TopDockable() indicates whether a pane can be docked at the top of the frame. | |
842 | */ | |
d2aa927a | 843 | wxAuiPaneInfo& TopDockable(bool b = true); |
23324ae1 FM |
844 | |
845 | /** | |
8d483c9b FM |
846 | Window() assigns the window pointer that the wxAuiPaneInfo should use. |
847 | This normally does not need to be specified, as the window pointer is | |
848 | automatically assigned to the wxAuiPaneInfo structure as soon as it is added | |
47d602c1 | 849 | to the manager. |
23324ae1 | 850 | */ |
d2aa927a | 851 | wxAuiPaneInfo& Window(wxWindow* w); |
23324ae1 FM |
852 | |
853 | /** | |
854 | Makes a copy of the wxAuiPaneInfo object. | |
855 | */ | |
1d497b99 | 856 | wxAuiPaneInfo& operator=(const wxAuiPaneInfo& c); |
23324ae1 | 857 | }; |
e54c96f1 | 858 | |
ea6e8ec5 BP |
859 | |
860 | ||
861 | /** | |
862 | @class wxAuiManagerEvent | |
863 | ||
864 | Event used to indicate various actions taken with wxAuiManager. | |
865 | ||
866 | See wxAuiManager for available event types. | |
867 | ||
9ccf8289 FM |
868 | @beginEventTable{wxAuiManagerEvent} |
869 | @event{EVT_AUI_PANE_BUTTON(func)} | |
870 | Triggered when any button is pressed for any docked panes. | |
871 | @event{EVT_AUI_PANE_CLOSE(func)} | |
872 | Triggered when a docked or floating pane is closed. | |
873 | @event{EVT_AUI_PANE_MAXIMIZE(func)} | |
874 | Triggered when a pane is maximized. | |
875 | @event{EVT_AUI_PANE_RESTORE(func)} | |
876 | Triggered when a pane is restored. | |
3a1ec1d5 VZ |
877 | @event{EVT_AUI_PANE_ACTIVATED(func)} |
878 | Triggered when a pane is made 'active'. This event is new since | |
879 | wxWidgets 2.9.4. | |
9ccf8289 FM |
880 | @event{EVT_AUI_RENDER(func)} |
881 | This event can be caught to override the default renderer in order to | |
882 | custom draw your wxAuiManager window (not recommended). | |
883 | @endEventTable | |
3a1ec1d5 | 884 | |
ea6e8ec5 BP |
885 | @library{wxaui} |
886 | @category{events,aui} | |
887 | ||
888 | @see wxAuiManager, wxAuiPaneInfo | |
889 | */ | |
890 | class wxAuiManagerEvent : public wxEvent | |
891 | { | |
892 | public: | |
893 | /** | |
894 | Constructor. | |
895 | */ | |
896 | wxAuiManagerEvent(wxEventType type = wxEVT_NULL); | |
897 | ||
898 | /** | |
899 | @return @true if this event can be vetoed. | |
900 | ||
901 | @see Veto() | |
902 | */ | |
903 | bool CanVeto(); | |
904 | ||
905 | /** | |
906 | @return The ID of the button that was clicked. | |
907 | */ | |
908 | int GetButton(); | |
909 | ||
910 | /** | |
911 | @todo What is this? | |
912 | */ | |
913 | wxDC* GetDC(); | |
914 | ||
915 | /** | |
916 | @return @true if this event was vetoed. | |
917 | ||
918 | @see Veto() | |
919 | */ | |
920 | bool GetVeto(); | |
921 | ||
922 | /** | |
923 | @return The wxAuiManager this event is associated with. | |
924 | */ | |
925 | wxAuiManager* GetManager(); | |
926 | ||
927 | /** | |
928 | @return The pane this event is associated with. | |
929 | */ | |
930 | wxAuiPaneInfo* GetPane(); | |
931 | ||
932 | /** | |
933 | Sets the ID of the button clicked that triggered this event. | |
934 | */ | |
935 | void SetButton(int button); | |
936 | ||
937 | /** | |
938 | Sets whether or not this event can be vetoed. | |
939 | */ | |
940 | void SetCanVeto(bool can_veto); | |
941 | ||
942 | /** | |
943 | @todo What is this? | |
944 | */ | |
945 | void SetDC(wxDC* pdc); | |
946 | ||
947 | /** | |
948 | Sets the wxAuiManager this event is associated with. | |
949 | */ | |
950 | void SetManager(wxAuiManager* manager); | |
951 | ||
952 | /** | |
953 | Sets the pane this event is associated with. | |
954 | */ | |
955 | void SetPane(wxAuiPaneInfo* pane); | |
956 | ||
957 | /** | |
958 | Cancels the action indicated by this event if CanVeto() is @true. | |
959 | */ | |
960 | void Veto(bool veto = true); | |
961 | }; | |
962 |