aui sample can now create extra notebooks
[wxWidgets.git] / samples / aui / auidemo.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: auidemo.cpp
3 // Purpose: wxaui: wx advanced user interface - sample/test program
4 // Author: Benjamin I. Williams
5 // Modified by:
6 // Created: 2005-10-03
7 // RCS-ID: $Id$
8 // Copyright: (C) Copyright 2005, Kirix Corporation, All Rights Reserved.
9 // Licence: wxWindows Library Licence, Version 3.1
10 ///////////////////////////////////////////////////////////////////////////////
11
12 // For compilers that support precompilation, includes "wx/wx.h".
13 #include "wx/wxprec.h"
14
15 #ifdef __BORLANDC__
16 #pragma hdrstop
17 #endif
18
19 #include "wx/app.h"
20 #include "wx/grid.h"
21 #include "wx/treectrl.h"
22 #include "wx/spinctrl.h"
23 #include "wx/artprov.h"
24 #include "wx/clipbrd.h"
25 #include "wx/image.h"
26 #include "wx/colordlg.h"
27 #include "wx/wxhtml.h"
28 #include "wx/imaglist.h"
29 #include "wx/dataobj.h"
30 #include "wx/dcclient.h"
31 #include "wx/bmpbuttn.h"
32 #include "wx/menu.h"
33 #include "wx/toolbar.h"
34 #include "wx/statusbr.h"
35 #include "wx/msgdlg.h"
36 #include "wx/textdlg.h"
37
38 #include "wx/aui/aui.h"
39 #include "../sample.xpm"
40
41 // -- application --
42
43 class MyApp : public wxApp
44 {
45 public:
46 bool OnInit();
47 };
48
49 DECLARE_APP(MyApp)
50 IMPLEMENT_APP(MyApp)
51
52
53 class wxSizeReportCtrl;
54
55 // -- frame --
56
57 class MyFrame : public wxFrame
58 {
59 enum
60 {
61 ID_CreateTree = wxID_HIGHEST+1,
62 ID_CreateGrid,
63 ID_CreateText,
64 ID_CreateHTML,
65 ID_CreateNotebook,
66 ID_CreateSizeReport,
67 ID_GridContent,
68 ID_TextContent,
69 ID_TreeContent,
70 ID_HTMLContent,
71 ID_NotebookContent,
72 ID_SizeReportContent,
73 ID_CreatePerspective,
74 ID_CopyPerspectiveCode,
75 ID_AllowFloating,
76 ID_AllowActivePane,
77 ID_TransparentHint,
78 ID_VenetianBlindsHint,
79 ID_RectangleHint,
80 ID_NoHint,
81 ID_HintFade,
82 ID_NoVenetianFade,
83 ID_TransparentDrag,
84 ID_NoGradient,
85 ID_VerticalGradient,
86 ID_HorizontalGradient,
87 ID_Settings,
88 ID_NotebookNoCloseButton,
89 ID_NotebookCloseButton,
90 ID_NotebookCloseButtonAll,
91 ID_NotebookCloseButtonActive,
92 ID_NotebookAllowTabMove,
93 ID_NotebookAllowTabSplit,
94 ID_NotebookWindowList,
95 ID_NotebookScrollButtons,
96 ID_FirstPerspective = ID_CreatePerspective+1000
97 };
98
99 public:
100 MyFrame(wxWindow* parent,
101 wxWindowID id,
102 const wxString& title,
103 const wxPoint& pos = wxDefaultPosition,
104 const wxSize& size = wxDefaultSize,
105 long style = wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER);
106
107 ~MyFrame();
108
109 wxAuiDockArt* GetDockArt();
110 void DoUpdate();
111
112 private:
113 wxTextCtrl* CreateTextCtrl(const wxString& text = wxEmptyString);
114 wxGrid* CreateGrid();
115 wxTreeCtrl* CreateTreeCtrl();
116 wxSizeReportCtrl* CreateSizeReportCtrl(int width = 80, int height = 80);
117 wxPoint GetStartPosition();
118 wxHtmlWindow* CreateHTMLCtrl(wxWindow* parent = NULL);
119 wxAuiNotebook* CreateNotebook();
120
121 wxString GetIntroText();
122
123 private:
124
125 void OnEraseBackground(wxEraseEvent& evt);
126 void OnSize(wxSizeEvent& evt);
127
128 void OnCreateTree(wxCommandEvent& evt);
129 void OnCreateGrid(wxCommandEvent& evt);
130 void OnCreateHTML(wxCommandEvent& evt);
131 void OnCreateNotebook(wxCommandEvent& evt);
132 void OnCreateText(wxCommandEvent& evt);
133 void OnCreateSizeReport(wxCommandEvent& evt);
134 void OnChangeContentPane(wxCommandEvent& evt);
135 void OnCreatePerspective(wxCommandEvent& evt);
136 void OnCopyPerspectiveCode(wxCommandEvent& evt);
137 void OnRestorePerspective(wxCommandEvent& evt);
138 void OnSettings(wxCommandEvent& evt);
139 void OnExit(wxCommandEvent& evt);
140 void OnAbout(wxCommandEvent& evt);
141
142 void OnGradient(wxCommandEvent& evt);
143 void OnManagerFlag(wxCommandEvent& evt);
144 void OnNotebookFlag(wxCommandEvent& evt);
145 void OnUpdateUI(wxUpdateUIEvent& evt);
146
147 void OnPaneClose(wxAuiManagerEvent& evt);
148
149 private:
150
151 wxAuiManager m_mgr;
152 wxArrayString m_perspectives;
153 wxMenu* m_perspectives_menu;
154 long m_notebook_style;
155
156 DECLARE_EVENT_TABLE()
157 };
158
159
160 // -- wxSizeReportCtrl --
161 // (a utility control that always reports it's client size)
162
163 class wxSizeReportCtrl : public wxControl
164 {
165 public:
166
167 wxSizeReportCtrl(wxWindow* parent, wxWindowID id = wxID_ANY,
168 const wxPoint& pos = wxDefaultPosition,
169 const wxSize& size = wxDefaultSize,
170 wxAuiManager* mgr = NULL)
171 : wxControl(parent, id, pos, size, wxNO_BORDER)
172 {
173 m_mgr = mgr;
174 }
175
176 private:
177
178 void OnPaint(wxPaintEvent& WXUNUSED(evt))
179 {
180 wxPaintDC dc(this);
181 wxSize size = GetClientSize();
182 wxString s;
183 int h, w, height;
184
185 s.Printf(wxT("Size: %d x %d"), size.x, size.y);
186
187 dc.SetFont(*wxNORMAL_FONT);
188 dc.GetTextExtent(s, &w, &height);
189 height += 3;
190 dc.SetBrush(*wxWHITE_BRUSH);
191 dc.SetPen(*wxWHITE_PEN);
192 dc.DrawRectangle(0, 0, size.x, size.y);
193 dc.SetPen(*wxLIGHT_GREY_PEN);
194 dc.DrawLine(0, 0, size.x, size.y);
195 dc.DrawLine(0, size.y, size.x, 0);
196 dc.DrawText(s, (size.x-w)/2, ((size.y-(height*5))/2));
197
198 if (m_mgr)
199 {
200 wxAuiPaneInfo pi = m_mgr->GetPane(this);
201
202 s.Printf(wxT("Layer: %d"), pi.dock_layer);
203 dc.GetTextExtent(s, &w, &h);
204 dc.DrawText(s, (size.x-w)/2, ((size.y-(height*5))/2)+(height*1));
205
206 s.Printf(wxT("Dock: %d Row: %d"), pi.dock_direction, pi.dock_row);
207 dc.GetTextExtent(s, &w, &h);
208 dc.DrawText(s, (size.x-w)/2, ((size.y-(height*5))/2)+(height*2));
209
210 s.Printf(wxT("Position: %d"), pi.dock_pos);
211 dc.GetTextExtent(s, &w, &h);
212 dc.DrawText(s, (size.x-w)/2, ((size.y-(height*5))/2)+(height*3));
213
214 s.Printf(wxT("Proportion: %d"), pi.dock_proportion);
215 dc.GetTextExtent(s, &w, &h);
216 dc.DrawText(s, (size.x-w)/2, ((size.y-(height*5))/2)+(height*4));
217 }
218 }
219
220 void OnEraseBackground(wxEraseEvent& WXUNUSED(evt))
221 {
222 // intentionally empty
223 }
224
225 void OnSize(wxSizeEvent& WXUNUSED(evt))
226 {
227 Refresh();
228 }
229 private:
230
231 wxAuiManager* m_mgr;
232
233 DECLARE_EVENT_TABLE()
234 };
235
236 BEGIN_EVENT_TABLE(wxSizeReportCtrl, wxControl)
237 EVT_PAINT(wxSizeReportCtrl::OnPaint)
238 EVT_SIZE(wxSizeReportCtrl::OnSize)
239 EVT_ERASE_BACKGROUND(wxSizeReportCtrl::OnEraseBackground)
240 END_EVENT_TABLE()
241
242
243 class SettingsPanel : public wxPanel
244 {
245 enum
246 {
247 ID_PaneBorderSize = wxID_HIGHEST+1,
248 ID_SashSize,
249 ID_CaptionSize,
250 ID_BackgroundColor,
251 ID_SashColor,
252 ID_InactiveCaptionColor,
253 ID_InactiveCaptionGradientColor,
254 ID_InactiveCaptionTextColor,
255 ID_ActiveCaptionColor,
256 ID_ActiveCaptionGradientColor,
257 ID_ActiveCaptionTextColor,
258 ID_BorderColor,
259 ID_GripperColor
260 };
261
262 public:
263
264 SettingsPanel(wxWindow* parent, MyFrame* frame)
265 : wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize)
266 {
267 //wxBoxSizer* vert = new wxBoxSizer(wxVERTICAL);
268
269 //vert->Add(1, 1, 1, wxEXPAND);
270
271 wxBoxSizer* s1 = new wxBoxSizer(wxHORIZONTAL);
272 m_border_size = new wxSpinCtrl(this, ID_PaneBorderSize, wxEmptyString, wxDefaultPosition, wxSize(50,20));
273 s1->Add(1, 1, 1, wxEXPAND);
274 s1->Add(new wxStaticText(this, wxID_ANY, wxT("Pane Border Size:")));
275 s1->Add(m_border_size);
276 s1->Add(1, 1, 1, wxEXPAND);
277 s1->SetItemMinSize((size_t)1, 180, 20);
278 //vert->Add(s1, 0, wxEXPAND | wxLEFT | wxBOTTOM, 5);
279
280 wxBoxSizer* s2 = new wxBoxSizer(wxHORIZONTAL);
281 m_sash_size = new wxSpinCtrl(this, ID_SashSize, wxEmptyString, wxDefaultPosition, wxSize(50,20));
282 s2->Add(1, 1, 1, wxEXPAND);
283 s2->Add(new wxStaticText(this, wxID_ANY, wxT("Sash Size:")));
284 s2->Add(m_sash_size);
285 s2->Add(1, 1, 1, wxEXPAND);
286 s2->SetItemMinSize((size_t)1, 180, 20);
287 //vert->Add(s2, 0, wxEXPAND | wxLEFT | wxBOTTOM, 5);
288
289 wxBoxSizer* s3 = new wxBoxSizer(wxHORIZONTAL);
290 m_caption_size = new wxSpinCtrl(this, ID_CaptionSize, wxEmptyString, wxDefaultPosition, wxSize(50,20));
291 s3->Add(1, 1, 1, wxEXPAND);
292 s3->Add(new wxStaticText(this, wxID_ANY, wxT("Caption Size:")));
293 s3->Add(m_caption_size);
294 s3->Add(1, 1, 1, wxEXPAND);
295 s3->SetItemMinSize((size_t)1, 180, 20);
296 //vert->Add(s3, 0, wxEXPAND | wxLEFT | wxBOTTOM, 5);
297
298 //vert->Add(1, 1, 1, wxEXPAND);
299
300
301 wxBitmap b = CreateColorBitmap(*wxBLACK);
302
303 wxBoxSizer* s4 = new wxBoxSizer(wxHORIZONTAL);
304 m_background_color = new wxBitmapButton(this, ID_BackgroundColor, b, wxDefaultPosition, wxSize(50,25));
305 s4->Add(1, 1, 1, wxEXPAND);
306 s4->Add(new wxStaticText(this, wxID_ANY, wxT("Background Color:")));
307 s4->Add(m_background_color);
308 s4->Add(1, 1, 1, wxEXPAND);
309 s4->SetItemMinSize((size_t)1, 180, 20);
310
311 wxBoxSizer* s5 = new wxBoxSizer(wxHORIZONTAL);
312 m_sash_color = new wxBitmapButton(this, ID_SashColor, b, wxDefaultPosition, wxSize(50,25));
313 s5->Add(1, 1, 1, wxEXPAND);
314 s5->Add(new wxStaticText(this, wxID_ANY, wxT("Sash Color:")));
315 s5->Add(m_sash_color);
316 s5->Add(1, 1, 1, wxEXPAND);
317 s5->SetItemMinSize((size_t)1, 180, 20);
318
319 wxBoxSizer* s6 = new wxBoxSizer(wxHORIZONTAL);
320 m_inactive_caption_color = new wxBitmapButton(this, ID_InactiveCaptionColor, b, wxDefaultPosition, wxSize(50,25));
321 s6->Add(1, 1, 1, wxEXPAND);
322 s6->Add(new wxStaticText(this, wxID_ANY, wxT("Normal Caption:")));
323 s6->Add(m_inactive_caption_color);
324 s6->Add(1, 1, 1, wxEXPAND);
325 s6->SetItemMinSize((size_t)1, 180, 20);
326
327 wxBoxSizer* s7 = new wxBoxSizer(wxHORIZONTAL);
328 m_inactive_caption_gradient_color = new wxBitmapButton(this, ID_InactiveCaptionGradientColor, b, wxDefaultPosition, wxSize(50,25));
329 s7->Add(1, 1, 1, wxEXPAND);
330 s7->Add(new wxStaticText(this, wxID_ANY, wxT("Normal Caption Gradient:")));
331 s7->Add(m_inactive_caption_gradient_color);
332 s7->Add(1, 1, 1, wxEXPAND);
333 s7->SetItemMinSize((size_t)1, 180, 20);
334
335 wxBoxSizer* s8 = new wxBoxSizer(wxHORIZONTAL);
336 m_inactive_caption_text_color = new wxBitmapButton(this, ID_InactiveCaptionTextColor, b, wxDefaultPosition, wxSize(50,25));
337 s8->Add(1, 1, 1, wxEXPAND);
338 s8->Add(new wxStaticText(this, wxID_ANY, wxT("Normal Caption Text:")));
339 s8->Add(m_inactive_caption_text_color);
340 s8->Add(1, 1, 1, wxEXPAND);
341 s8->SetItemMinSize((size_t)1, 180, 20);
342
343 wxBoxSizer* s9 = new wxBoxSizer(wxHORIZONTAL);
344 m_active_caption_color = new wxBitmapButton(this, ID_ActiveCaptionColor, b, wxDefaultPosition, wxSize(50,25));
345 s9->Add(1, 1, 1, wxEXPAND);
346 s9->Add(new wxStaticText(this, wxID_ANY, wxT("Active Caption:")));
347 s9->Add(m_active_caption_color);
348 s9->Add(1, 1, 1, wxEXPAND);
349 s9->SetItemMinSize((size_t)1, 180, 20);
350
351 wxBoxSizer* s10 = new wxBoxSizer(wxHORIZONTAL);
352 m_active_caption_gradient_color = new wxBitmapButton(this, ID_ActiveCaptionGradientColor, b, wxDefaultPosition, wxSize(50,25));
353 s10->Add(1, 1, 1, wxEXPAND);
354 s10->Add(new wxStaticText(this, wxID_ANY, wxT("Active Caption Gradient:")));
355 s10->Add(m_active_caption_gradient_color);
356 s10->Add(1, 1, 1, wxEXPAND);
357 s10->SetItemMinSize((size_t)1, 180, 20);
358
359 wxBoxSizer* s11 = new wxBoxSizer(wxHORIZONTAL);
360 m_active_caption_text_color = new wxBitmapButton(this, ID_ActiveCaptionTextColor, b, wxDefaultPosition, wxSize(50,25));
361 s11->Add(1, 1, 1, wxEXPAND);
362 s11->Add(new wxStaticText(this, wxID_ANY, wxT("Active Caption Text:")));
363 s11->Add(m_active_caption_text_color);
364 s11->Add(1, 1, 1, wxEXPAND);
365 s11->SetItemMinSize((size_t)1, 180, 20);
366
367 wxBoxSizer* s12 = new wxBoxSizer(wxHORIZONTAL);
368 m_border_color = new wxBitmapButton(this, ID_BorderColor, b, wxDefaultPosition, wxSize(50,25));
369 s12->Add(1, 1, 1, wxEXPAND);
370 s12->Add(new wxStaticText(this, wxID_ANY, wxT("Border Color:")));
371 s12->Add(m_border_color);
372 s12->Add(1, 1, 1, wxEXPAND);
373 s12->SetItemMinSize((size_t)1, 180, 20);
374
375 wxBoxSizer* s13 = new wxBoxSizer(wxHORIZONTAL);
376 m_gripper_color = new wxBitmapButton(this, ID_GripperColor, b, wxDefaultPosition, wxSize(50,25));
377 s13->Add(1, 1, 1, wxEXPAND);
378 s13->Add(new wxStaticText(this, wxID_ANY, wxT("Gripper Color:")));
379 s13->Add(m_gripper_color);
380 s13->Add(1, 1, 1, wxEXPAND);
381 s13->SetItemMinSize((size_t)1, 180, 20);
382
383 wxGridSizer* grid_sizer = new wxGridSizer(2);
384 grid_sizer->SetHGap(5);
385 grid_sizer->Add(s1); grid_sizer->Add(s4);
386 grid_sizer->Add(s2); grid_sizer->Add(s5);
387 grid_sizer->Add(s3); grid_sizer->Add(s13);
388 grid_sizer->Add(1,1); grid_sizer->Add(s12);
389 grid_sizer->Add(s6); grid_sizer->Add(s9);
390 grid_sizer->Add(s7); grid_sizer->Add(s10);
391 grid_sizer->Add(s8); grid_sizer->Add(s11);
392
393 wxBoxSizer* cont_sizer = new wxBoxSizer(wxVERTICAL);
394 cont_sizer->Add(grid_sizer, 1, wxEXPAND | wxALL, 5);
395 SetSizer(cont_sizer);
396 GetSizer()->SetSizeHints(this);
397
398 m_frame = frame;
399 m_border_size->SetValue(frame->GetDockArt()->GetMetric(wxAUI_ART_PANE_BORDER_SIZE));
400 m_sash_size->SetValue(frame->GetDockArt()->GetMetric(wxAUI_ART_SASH_SIZE));
401 m_caption_size->SetValue(frame->GetDockArt()->GetMetric(wxAUI_ART_CAPTION_SIZE));
402
403 UpdateColors();
404 }
405
406 private:
407
408 wxBitmap CreateColorBitmap(const wxColour& c)
409 {
410 wxImage image;
411 image.Create(25,14);
412 for (int x = 0; x < 25; ++x)
413 for (int y = 0; y < 14; ++y)
414 {
415 wxColour pixcol = c;
416 if (x == 0 || x == 24 || y == 0 || y == 13)
417 pixcol = *wxBLACK;
418 image.SetRGB(x, y, pixcol.Red(), pixcol.Green(), pixcol.Blue());
419 }
420 return wxBitmap(image);
421 }
422
423 void UpdateColors()
424 {
425 wxColour bk = m_frame->GetDockArt()->GetColor(wxAUI_ART_BACKGROUND_COLOUR);
426 m_background_color->SetBitmapLabel(CreateColorBitmap(bk));
427
428 wxColour cap = m_frame->GetDockArt()->GetColor(wxAUI_ART_INACTIVE_CAPTION_COLOUR);
429 m_inactive_caption_color->SetBitmapLabel(CreateColorBitmap(cap));
430
431 wxColour capgrad = m_frame->GetDockArt()->GetColor(wxAUI_ART_INACTIVE_CAPTION_GRADIENT_COLOUR);
432 m_inactive_caption_gradient_color->SetBitmapLabel(CreateColorBitmap(capgrad));
433
434 wxColour captxt = m_frame->GetDockArt()->GetColor(wxAUI_ART_INACTIVE_CAPTION_TEXT_COLOUR);
435 m_inactive_caption_text_color->SetBitmapLabel(CreateColorBitmap(captxt));
436
437 wxColour acap = m_frame->GetDockArt()->GetColor(wxAUI_ART_ACTIVE_CAPTION_COLOUR);
438 m_active_caption_color->SetBitmapLabel(CreateColorBitmap(acap));
439
440 wxColour acapgrad = m_frame->GetDockArt()->GetColor(wxAUI_ART_ACTIVE_CAPTION_GRADIENT_COLOUR);
441 m_active_caption_gradient_color->SetBitmapLabel(CreateColorBitmap(acapgrad));
442
443 wxColour acaptxt = m_frame->GetDockArt()->GetColor(wxAUI_ART_ACTIVE_CAPTION_TEXT_COLOUR);
444 m_active_caption_text_color->SetBitmapLabel(CreateColorBitmap(acaptxt));
445
446 wxColour sash = m_frame->GetDockArt()->GetColor(wxAUI_ART_SASH_COLOUR);
447 m_sash_color->SetBitmapLabel(CreateColorBitmap(sash));
448
449 wxColour border = m_frame->GetDockArt()->GetColor(wxAUI_ART_BORDER_COLOUR);
450 m_border_color->SetBitmapLabel(CreateColorBitmap(border));
451
452 wxColour gripper = m_frame->GetDockArt()->GetColor(wxAUI_ART_GRIPPER_COLOUR);
453 m_gripper_color->SetBitmapLabel(CreateColorBitmap(gripper));
454 }
455
456 void OnPaneBorderSize(wxSpinEvent& event)
457 {
458 m_frame->GetDockArt()->SetMetric(wxAUI_ART_PANE_BORDER_SIZE,
459 event.GetPosition());
460 m_frame->DoUpdate();
461 }
462
463 void OnSashSize(wxSpinEvent& event)
464 {
465 m_frame->GetDockArt()->SetMetric(wxAUI_ART_SASH_SIZE,
466 event.GetPosition());
467 m_frame->DoUpdate();
468 }
469
470 void OnCaptionSize(wxSpinEvent& event)
471 {
472 m_frame->GetDockArt()->SetMetric(wxAUI_ART_CAPTION_SIZE,
473 event.GetPosition());
474 m_frame->DoUpdate();
475 }
476
477 void OnSetColor(wxCommandEvent& event)
478 {
479 wxColourDialog dlg(m_frame);
480 dlg.SetTitle(_("Color Picker"));
481 if (dlg.ShowModal() != wxID_OK)
482 return;
483
484 int var = 0;
485 switch (event.GetId())
486 {
487 case ID_BackgroundColor: var = wxAUI_ART_BACKGROUND_COLOUR; break;
488 case ID_SashColor: var = wxAUI_ART_SASH_COLOUR; break;
489 case ID_InactiveCaptionColor: var = wxAUI_ART_INACTIVE_CAPTION_COLOUR; break;
490 case ID_InactiveCaptionGradientColor: var = wxAUI_ART_INACTIVE_CAPTION_GRADIENT_COLOUR; break;
491 case ID_InactiveCaptionTextColor: var = wxAUI_ART_INACTIVE_CAPTION_TEXT_COLOUR; break;
492 case ID_ActiveCaptionColor: var = wxAUI_ART_ACTIVE_CAPTION_COLOUR; break;
493 case ID_ActiveCaptionGradientColor: var = wxAUI_ART_ACTIVE_CAPTION_GRADIENT_COLOUR; break;
494 case ID_ActiveCaptionTextColor: var = wxAUI_ART_ACTIVE_CAPTION_TEXT_COLOUR; break;
495 case ID_BorderColor: var = wxAUI_ART_BORDER_COLOUR; break;
496 case ID_GripperColor: var = wxAUI_ART_GRIPPER_COLOUR; break;
497 default: return;
498 }
499
500 m_frame->GetDockArt()->SetColor(var, dlg.GetColourData().GetColour());
501 m_frame->DoUpdate();
502 UpdateColors();
503 }
504
505 private:
506
507 MyFrame* m_frame;
508 wxSpinCtrl* m_border_size;
509 wxSpinCtrl* m_sash_size;
510 wxSpinCtrl* m_caption_size;
511 wxBitmapButton* m_inactive_caption_text_color;
512 wxBitmapButton* m_inactive_caption_gradient_color;
513 wxBitmapButton* m_inactive_caption_color;
514 wxBitmapButton* m_active_caption_text_color;
515 wxBitmapButton* m_active_caption_gradient_color;
516 wxBitmapButton* m_active_caption_color;
517 wxBitmapButton* m_sash_color;
518 wxBitmapButton* m_background_color;
519 wxBitmapButton* m_border_color;
520 wxBitmapButton* m_gripper_color;
521
522 DECLARE_EVENT_TABLE()
523 };
524
525 BEGIN_EVENT_TABLE(SettingsPanel, wxPanel)
526 EVT_SPINCTRL(ID_PaneBorderSize, SettingsPanel::OnPaneBorderSize)
527 EVT_SPINCTRL(ID_SashSize, SettingsPanel::OnSashSize)
528 EVT_SPINCTRL(ID_CaptionSize, SettingsPanel::OnCaptionSize)
529 EVT_BUTTON(ID_BackgroundColor, SettingsPanel::OnSetColor)
530 EVT_BUTTON(ID_SashColor, SettingsPanel::OnSetColor)
531 EVT_BUTTON(ID_InactiveCaptionColor, SettingsPanel::OnSetColor)
532 EVT_BUTTON(ID_InactiveCaptionGradientColor, SettingsPanel::OnSetColor)
533 EVT_BUTTON(ID_InactiveCaptionTextColor, SettingsPanel::OnSetColor)
534 EVT_BUTTON(ID_ActiveCaptionColor, SettingsPanel::OnSetColor)
535 EVT_BUTTON(ID_ActiveCaptionGradientColor, SettingsPanel::OnSetColor)
536 EVT_BUTTON(ID_ActiveCaptionTextColor, SettingsPanel::OnSetColor)
537 EVT_BUTTON(ID_BorderColor, SettingsPanel::OnSetColor)
538 EVT_BUTTON(ID_GripperColor, SettingsPanel::OnSetColor)
539 END_EVENT_TABLE()
540
541
542 bool MyApp::OnInit()
543 {
544 wxFrame* frame = new MyFrame(NULL,
545 wxID_ANY,
546 wxT("wxAUI Sample Application"),
547 wxDefaultPosition,
548 wxSize(800, 600));
549 SetTopWindow(frame);
550 frame->Show();
551
552 return true;
553 }
554
555 BEGIN_EVENT_TABLE(MyFrame, wxFrame)
556 EVT_ERASE_BACKGROUND(MyFrame::OnEraseBackground)
557 EVT_SIZE(MyFrame::OnSize)
558 EVT_MENU(MyFrame::ID_CreateTree, MyFrame::OnCreateTree)
559 EVT_MENU(MyFrame::ID_CreateGrid, MyFrame::OnCreateGrid)
560 EVT_MENU(MyFrame::ID_CreateText, MyFrame::OnCreateText)
561 EVT_MENU(MyFrame::ID_CreateHTML, MyFrame::OnCreateHTML)
562 EVT_MENU(MyFrame::ID_CreateSizeReport, MyFrame::OnCreateSizeReport)
563 EVT_MENU(MyFrame::ID_CreateNotebook, MyFrame::OnCreateNotebook)
564 EVT_MENU(MyFrame::ID_CreatePerspective, MyFrame::OnCreatePerspective)
565 EVT_MENU(MyFrame::ID_CopyPerspectiveCode, MyFrame::OnCopyPerspectiveCode)
566 EVT_MENU(ID_AllowFloating, MyFrame::OnManagerFlag)
567 EVT_MENU(ID_TransparentHint, MyFrame::OnManagerFlag)
568 EVT_MENU(ID_VenetianBlindsHint, MyFrame::OnManagerFlag)
569 EVT_MENU(ID_RectangleHint, MyFrame::OnManagerFlag)
570 EVT_MENU(ID_NoHint, MyFrame::OnManagerFlag)
571 EVT_MENU(ID_HintFade, MyFrame::OnManagerFlag)
572 EVT_MENU(ID_NoVenetianFade, MyFrame::OnManagerFlag)
573 EVT_MENU(ID_TransparentDrag, MyFrame::OnManagerFlag)
574 EVT_MENU(ID_AllowActivePane, MyFrame::OnManagerFlag)
575 EVT_MENU(ID_NotebookNoCloseButton, MyFrame::OnNotebookFlag)
576 EVT_MENU(ID_NotebookCloseButton, MyFrame::OnNotebookFlag)
577 EVT_MENU(ID_NotebookCloseButtonAll, MyFrame::OnNotebookFlag)
578 EVT_MENU(ID_NotebookCloseButtonActive, MyFrame::OnNotebookFlag)
579 EVT_MENU(ID_NotebookAllowTabMove, MyFrame::OnNotebookFlag)
580 EVT_MENU(ID_NotebookAllowTabSplit, MyFrame::OnNotebookFlag)
581 EVT_MENU(ID_NotebookScrollButtons, MyFrame::OnNotebookFlag)
582 EVT_MENU(ID_NotebookWindowList, MyFrame::OnNotebookFlag)
583 EVT_MENU(ID_NoGradient, MyFrame::OnGradient)
584 EVT_MENU(ID_VerticalGradient, MyFrame::OnGradient)
585 EVT_MENU(ID_HorizontalGradient, MyFrame::OnGradient)
586 EVT_MENU(ID_Settings, MyFrame::OnSettings)
587 EVT_MENU(ID_GridContent, MyFrame::OnChangeContentPane)
588 EVT_MENU(ID_TreeContent, MyFrame::OnChangeContentPane)
589 EVT_MENU(ID_TextContent, MyFrame::OnChangeContentPane)
590 EVT_MENU(ID_SizeReportContent, MyFrame::OnChangeContentPane)
591 EVT_MENU(ID_HTMLContent, MyFrame::OnChangeContentPane)
592 EVT_MENU(ID_NotebookContent, MyFrame::OnChangeContentPane)
593 EVT_MENU(wxID_EXIT, MyFrame::OnExit)
594 EVT_MENU(wxID_ABOUT, MyFrame::OnAbout)
595 EVT_UPDATE_UI(ID_NotebookNoCloseButton, MyFrame::OnUpdateUI)
596 EVT_UPDATE_UI(ID_NotebookCloseButton, MyFrame::OnUpdateUI)
597 EVT_UPDATE_UI(ID_NotebookCloseButtonAll, MyFrame::OnUpdateUI)
598 EVT_UPDATE_UI(ID_NotebookCloseButtonActive, MyFrame::OnUpdateUI)
599 EVT_UPDATE_UI(ID_NotebookAllowTabMove, MyFrame::OnUpdateUI)
600 EVT_UPDATE_UI(ID_NotebookAllowTabSplit, MyFrame::OnUpdateUI)
601 EVT_UPDATE_UI(ID_NotebookScrollButtons, MyFrame::OnUpdateUI)
602 EVT_UPDATE_UI(ID_NotebookWindowList, MyFrame::OnUpdateUI)
603 EVT_UPDATE_UI(ID_AllowFloating, MyFrame::OnUpdateUI)
604 EVT_UPDATE_UI(ID_TransparentHint, MyFrame::OnUpdateUI)
605 EVT_UPDATE_UI(ID_VenetianBlindsHint, MyFrame::OnUpdateUI)
606 EVT_UPDATE_UI(ID_RectangleHint, MyFrame::OnUpdateUI)
607 EVT_UPDATE_UI(ID_NoHint, MyFrame::OnUpdateUI)
608 EVT_UPDATE_UI(ID_HintFade, MyFrame::OnUpdateUI)
609 EVT_UPDATE_UI(ID_NoVenetianFade, MyFrame::OnUpdateUI)
610 EVT_UPDATE_UI(ID_TransparentDrag, MyFrame::OnUpdateUI)
611 EVT_UPDATE_UI(ID_NoGradient, MyFrame::OnUpdateUI)
612 EVT_UPDATE_UI(ID_VerticalGradient, MyFrame::OnUpdateUI)
613 EVT_UPDATE_UI(ID_HorizontalGradient, MyFrame::OnUpdateUI)
614 EVT_MENU_RANGE(MyFrame::ID_FirstPerspective, MyFrame::ID_FirstPerspective+1000,
615 MyFrame::OnRestorePerspective)
616 EVT_AUI_PANECLOSE(MyFrame::OnPaneClose)
617 END_EVENT_TABLE()
618
619
620 MyFrame::MyFrame(wxWindow* parent,
621 wxWindowID id,
622 const wxString& title,
623 const wxPoint& pos,
624 const wxSize& size,
625 long style)
626 : wxFrame(parent, id, title, pos, size, style)
627 {
628 // tell wxAuiManager to manage this frame
629 m_mgr.SetManagedWindow(this);
630
631 // set frame icon
632 SetIcon(wxIcon(sample_xpm));
633
634 // set up default notebook style
635 m_notebook_style = wxAUI_NB_DEFAULT_STYLE | wxNO_BORDER;
636
637 // create menu
638 wxMenuBar* mb = new wxMenuBar;
639
640 wxMenu* file_menu = new wxMenu;
641 file_menu->Append(wxID_EXIT, _("Exit"));
642
643 wxMenu* view_menu = new wxMenu;
644 view_menu->Append(ID_CreateText, _("Create Text Control"));
645 view_menu->Append(ID_CreateHTML, _("Create HTML Control"));
646 view_menu->Append(ID_CreateTree, _("Create Tree"));
647 view_menu->Append(ID_CreateGrid, _("Create Grid"));
648 view_menu->Append(ID_CreateNotebook, _("Create Notebook"));
649 view_menu->Append(ID_CreateSizeReport, _("Create Size Reporter"));
650 view_menu->AppendSeparator();
651 view_menu->Append(ID_GridContent, _("Use a Grid for the Content Pane"));
652 view_menu->Append(ID_TextContent, _("Use a Text Control for the Content Pane"));
653 view_menu->Append(ID_HTMLContent, _("Use an HTML Control for the Content Pane"));
654 view_menu->Append(ID_TreeContent, _("Use a Tree Control for the Content Pane"));
655 view_menu->Append(ID_NotebookContent, _("Use a AUI wxMultiNotebook control for the Content Pane"));
656 view_menu->Append(ID_SizeReportContent, _("Use a Size Reporter for the Content Pane"));
657
658 wxMenu* options_menu = new wxMenu;
659 options_menu->AppendRadioItem(ID_TransparentHint, _("Transparent Hint"));
660 options_menu->AppendRadioItem(ID_VenetianBlindsHint, _("Venetian Blinds Hint"));
661 options_menu->AppendRadioItem(ID_RectangleHint, _("Rectangle Hint"));
662 options_menu->AppendRadioItem(ID_NoHint, _("No Hint"));
663 options_menu->AppendSeparator();
664 options_menu->AppendCheckItem(ID_HintFade, _("Hint Fade-in"));
665 options_menu->AppendCheckItem(ID_AllowFloating, _("Allow Floating"));
666 options_menu->AppendCheckItem(ID_NoVenetianFade, _("Disable Venetian Blinds Hint Fade-in"));
667 options_menu->AppendCheckItem(ID_TransparentDrag, _("Transparent Drag"));
668 options_menu->AppendCheckItem(ID_AllowActivePane, _("Allow Active Pane"));
669 options_menu->AppendSeparator();
670 options_menu->AppendRadioItem(ID_NoGradient, _("No Caption Gradient"));
671 options_menu->AppendRadioItem(ID_VerticalGradient, _("Vertical Caption Gradient"));
672 options_menu->AppendRadioItem(ID_HorizontalGradient, _("Horizontal Caption Gradient"));
673 options_menu->AppendSeparator();
674 options_menu->Append(ID_Settings, _("Settings Pane"));
675
676 wxMenu* notebook_menu = new wxMenu;
677 notebook_menu->AppendRadioItem(ID_NotebookNoCloseButton, _("No Close Button"));
678 notebook_menu->AppendRadioItem(ID_NotebookCloseButton, _("Close Button at Right"));
679 notebook_menu->AppendRadioItem(ID_NotebookCloseButtonAll, _("Close Button on All Tabs"));
680 notebook_menu->AppendRadioItem(ID_NotebookCloseButtonActive, _("Close Button on Active Tab"));
681 notebook_menu->AppendSeparator();
682 notebook_menu->AppendCheckItem(ID_NotebookAllowTabMove, _("Allow Tab Move"));
683 notebook_menu->AppendCheckItem(ID_NotebookAllowTabSplit, _("Allow Notebook Split"));
684 notebook_menu->AppendCheckItem(ID_NotebookScrollButtons, _("Scroll Buttons Visible"));
685 notebook_menu->AppendCheckItem(ID_NotebookWindowList, _("Window List Button Visible"));
686
687 m_perspectives_menu = new wxMenu;
688 m_perspectives_menu->Append(ID_CreatePerspective, _("Create Perspective"));
689 m_perspectives_menu->Append(ID_CopyPerspectiveCode, _("Copy Perspective Data To Clipboard"));
690 m_perspectives_menu->AppendSeparator();
691 m_perspectives_menu->Append(ID_FirstPerspective+0, _("Default Startup"));
692 m_perspectives_menu->Append(ID_FirstPerspective+1, _("All Panes"));
693
694 wxMenu* help_menu = new wxMenu;
695 help_menu->Append(wxID_ABOUT, _("About..."));
696
697 mb->Append(file_menu, _("File"));
698 mb->Append(view_menu, _("View"));
699 mb->Append(m_perspectives_menu, _("Perspectives"));
700 mb->Append(options_menu, _("Options"));
701 mb->Append(notebook_menu, _("Notebook"));
702 mb->Append(help_menu, _("Help"));
703
704 SetMenuBar(mb);
705
706 CreateStatusBar();
707 GetStatusBar()->SetStatusText(_("Ready"));
708
709
710 // min size for the frame itself isn't completely done.
711 // see the end up wxAuiManager::Update() for the test
712 // code. For now, just hard code a frame minimum size
713 SetMinSize(wxSize(400,300));
714
715 // create some toolbars
716 wxToolBar* tb1 = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
717 wxTB_FLAT | wxTB_NODIVIDER);
718 tb1->SetToolBitmapSize(wxSize(48,48));
719 tb1->AddTool(101, wxT("Test"), wxArtProvider::GetBitmap(wxART_ERROR));
720 tb1->AddSeparator();
721 tb1->AddTool(102, wxT("Test"), wxArtProvider::GetBitmap(wxART_QUESTION));
722 tb1->AddTool(103, wxT("Test"), wxArtProvider::GetBitmap(wxART_INFORMATION));
723 tb1->AddTool(103, wxT("Test"), wxArtProvider::GetBitmap(wxART_WARNING));
724 tb1->AddTool(103, wxT("Test"), wxArtProvider::GetBitmap(wxART_MISSING_IMAGE));
725 tb1->Realize();
726
727
728 wxToolBar* tb2 = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
729 wxTB_FLAT | wxTB_NODIVIDER);
730 tb2->SetToolBitmapSize(wxSize(16,16));
731
732 wxBitmap tb2_bmp1 = wxArtProvider::GetBitmap(wxART_QUESTION, wxART_OTHER, wxSize(16,16));
733 tb2->AddTool(101, wxT("Test"), tb2_bmp1);
734 tb2->AddTool(101, wxT("Test"), tb2_bmp1);
735 tb2->AddTool(101, wxT("Test"), tb2_bmp1);
736 tb2->AddTool(101, wxT("Test"), tb2_bmp1);
737 tb2->AddSeparator();
738 tb2->AddTool(101, wxT("Test"), tb2_bmp1);
739 tb2->AddTool(101, wxT("Test"), tb2_bmp1);
740 tb2->AddSeparator();
741 tb2->AddTool(101, wxT("Test"), tb2_bmp1);
742 tb2->AddTool(101, wxT("Test"), tb2_bmp1);
743 tb2->AddTool(101, wxT("Test"), tb2_bmp1);
744 tb2->AddTool(101, wxT("Test"), tb2_bmp1);
745 tb2->Realize();
746
747
748 wxToolBar* tb3 = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
749 wxTB_FLAT | wxTB_NODIVIDER);
750 tb3->SetToolBitmapSize(wxSize(16,16));
751 wxBitmap tb3_bmp1 = wxArtProvider::GetBitmap(wxART_FOLDER, wxART_OTHER, wxSize(16,16));
752 tb3->AddTool(101, wxT("Test"), tb3_bmp1);
753 tb3->AddTool(101, wxT("Test"), tb3_bmp1);
754 tb3->AddTool(101, wxT("Test"), tb3_bmp1);
755 tb3->AddTool(101, wxT("Test"), tb3_bmp1);
756 tb3->AddSeparator();
757 tb3->AddTool(101, wxT("Test"), tb3_bmp1);
758 tb3->AddTool(101, wxT("Test"), tb3_bmp1);
759 tb3->Realize();
760
761
762 wxToolBar* tb4 = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
763 wxTB_FLAT | wxTB_NODIVIDER | wxTB_HORZ_TEXT);
764 tb4->SetToolBitmapSize(wxSize(16,16));
765 wxBitmap tb4_bmp1 = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16));
766 tb4->AddTool(101, wxT("Item 1"), tb4_bmp1);
767 tb4->AddTool(101, wxT("Item 2"), tb4_bmp1);
768 tb4->AddTool(101, wxT("Item 3"), tb4_bmp1);
769 tb4->AddTool(101, wxT("Item 4"), tb4_bmp1);
770 tb4->AddSeparator();
771 tb4->AddTool(101, wxT("Item 5"), tb4_bmp1);
772 tb4->AddTool(101, wxT("Item 6"), tb4_bmp1);
773 tb4->AddTool(101, wxT("Item 7"), tb4_bmp1);
774 tb4->AddTool(101, wxT("Item 8"), tb4_bmp1);
775 tb4->Realize();
776
777 // create some toolbars
778 wxToolBar* tb5 = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
779 wxTB_FLAT | wxTB_NODIVIDER | wxTB_VERTICAL);
780 tb5->SetToolBitmapSize(wxSize(48,48));
781 tb5->AddTool(101, wxT("Test"), wxArtProvider::GetBitmap(wxART_ERROR));
782 tb5->AddSeparator();
783 tb5->AddTool(102, wxT("Test"), wxArtProvider::GetBitmap(wxART_QUESTION));
784 tb5->AddTool(103, wxT("Test"), wxArtProvider::GetBitmap(wxART_INFORMATION));
785 tb5->AddTool(103, wxT("Test"), wxArtProvider::GetBitmap(wxART_WARNING));
786 tb5->AddTool(103, wxT("Test"), wxArtProvider::GetBitmap(wxART_MISSING_IMAGE));
787 tb5->Realize();
788
789 // add a bunch of panes
790 m_mgr.AddPane(CreateSizeReportCtrl(), wxAuiPaneInfo().
791 Name(wxT("test1")).Caption(wxT("Pane Caption")).
792 Top());
793
794 m_mgr.AddPane(CreateSizeReportCtrl(), wxAuiPaneInfo().
795 Name(wxT("test2")).Caption(wxT("Client Size Reporter")).
796 Bottom().Position(1).
797 PinButton(true).CloseButton(true).MaximizeButton(true));
798
799 m_mgr.AddPane(CreateSizeReportCtrl(), wxAuiPaneInfo().
800 Name(wxT("test3")).Caption(wxT("Client Size Reporter")).
801 Bottom().
802 PinButton(true).CloseButton(true).MaximizeButton(true));
803
804 m_mgr.AddPane(CreateSizeReportCtrl(), wxAuiPaneInfo().
805 Name(wxT("test4")).Caption(wxT("Pane Caption")).
806 Left());
807
808 m_mgr.AddPane(CreateSizeReportCtrl(), wxAuiPaneInfo().
809 Name(wxT("test5")).Caption(wxT("No Close Button")).
810 Right().CloseButton(false));
811
812 m_mgr.AddPane(CreateSizeReportCtrl(), wxAuiPaneInfo().
813 Name(wxT("test6")).Caption(wxT("Client Size Reporter")).
814 Right().Row(1).
815 PinButton(true).CloseButton(true).MaximizeButton(true));
816
817 m_mgr.AddPane(CreateSizeReportCtrl(), wxAuiPaneInfo().
818 Name(wxT("test7")).Caption(wxT("Client Size Reporter")).
819 Left().Layer(1).
820 PinButton(true).CloseButton(true).MaximizeButton(true));
821
822 m_mgr.AddPane(CreateTreeCtrl(), wxAuiPaneInfo().
823 Name(wxT("test8")).Caption(wxT("Tree Pane")).
824 Left().Layer(1).Position(1).
825 CloseButton(true).MaximizeButton(true));
826
827 m_mgr.AddPane(CreateSizeReportCtrl(), wxAuiPaneInfo().
828 Name(wxT("test9")).Caption(wxT("Min Size 200x100")).
829 BestSize(wxSize(200,100)).MinSize(wxSize(200,100)).
830 Bottom().Layer(1).
831 CloseButton(true).MaximizeButton(true));
832
833 wxWindow* wnd10 = CreateTextCtrl(wxT("This pane will prompt the user before hiding."));
834 m_mgr.AddPane(wnd10, wxAuiPaneInfo().
835 Name(wxT("test10")).Caption(wxT("Text Pane with Hide Prompt")).
836 Bottom().Layer(1).Position(1));
837
838 m_mgr.AddPane(CreateSizeReportCtrl(), wxAuiPaneInfo().
839 Name(wxT("test11")).Caption(wxT("Fixed Pane")).
840 Bottom().Layer(1).Position(2).Fixed());
841
842
843 m_mgr.AddPane(new SettingsPanel(this,this), wxAuiPaneInfo().
844 Name(wxT("settings")).Caption(wxT("Dock Manager Settings")).
845 Dockable(false).Float().Hide());
846
847 // create some center panes
848
849 m_mgr.AddPane(CreateGrid(), wxAuiPaneInfo().Name(wxT("grid_content")).
850 CenterPane().Hide());
851
852 m_mgr.AddPane(CreateTreeCtrl(), wxAuiPaneInfo().Name(wxT("tree_content")).
853 CenterPane().Hide());
854
855 m_mgr.AddPane(CreateSizeReportCtrl(), wxAuiPaneInfo().Name(wxT("sizereport_content")).
856 CenterPane().Hide());
857
858 m_mgr.AddPane(CreateTextCtrl(), wxAuiPaneInfo().Name(wxT("text_content")).
859 CenterPane().Hide());
860
861 m_mgr.AddPane(CreateHTMLCtrl(), wxAuiPaneInfo().Name(wxT("html_content")).
862 CenterPane());
863
864 m_mgr.AddPane(CreateNotebook(), wxAuiPaneInfo().Name(wxT("notebook_content")).
865 CenterPane().PaneBorder(false));
866
867 // add the toolbars to the manager
868 m_mgr.AddPane(tb1, wxAuiPaneInfo().
869 Name(wxT("tb1")).Caption(wxT("Big Toolbar")).
870 ToolbarPane().Top().
871 LeftDockable(false).RightDockable(false));
872
873 m_mgr.AddPane(tb2, wxAuiPaneInfo().
874 Name(wxT("tb2")).Caption(wxT("Toolbar 2")).
875 ToolbarPane().Top().Row(1).
876 LeftDockable(false).RightDockable(false));
877
878 m_mgr.AddPane(tb3, wxAuiPaneInfo().
879 Name(wxT("tb3")).Caption(wxT("Toolbar 3")).
880 ToolbarPane().Top().Row(1).Position(1).
881 LeftDockable(false).RightDockable(false));
882
883 m_mgr.AddPane(tb4, wxAuiPaneInfo().
884 Name(wxT("tb4")).Caption(wxT("Sample Bookmark Toolbar")).
885 ToolbarPane().Top().Row(2).
886 LeftDockable(false).RightDockable(false));
887
888 m_mgr.AddPane(tb5, wxAuiPaneInfo().
889 Name(wxT("tb5")).Caption(wxT("Sample Vertical Toolbar")).
890 ToolbarPane().Left().
891 GripperTop().
892 TopDockable(false).BottomDockable(false));
893
894 m_mgr.AddPane(new wxButton(this, wxID_ANY, _("Test Button")),
895 wxAuiPaneInfo().Name(wxT("tb6")).
896 ToolbarPane().Top().Row(2).Position(1).
897 LeftDockable(false).RightDockable(false));
898
899 // make some default perspectives
900
901 wxString perspective_all = m_mgr.SavePerspective();
902
903 int i, count;
904 wxAuiPaneInfoArray& all_panes = m_mgr.GetAllPanes();
905 for (i = 0, count = all_panes.GetCount(); i < count; ++i)
906 if (!all_panes.Item(i).IsToolbar())
907 all_panes.Item(i).Hide();
908 m_mgr.GetPane(wxT("tb1")).Hide();
909 m_mgr.GetPane(wxT("tb6")).Hide();
910 m_mgr.GetPane(wxT("test8")).Show().Left().Layer(0).Row(0).Position(0);
911 m_mgr.GetPane(wxT("test10")).Show().Bottom().Layer(0).Row(0).Position(0);
912 m_mgr.GetPane(wxT("notebook_content")).Show();
913 wxString perspective_default = m_mgr.SavePerspective();
914
915 m_perspectives.Add(perspective_default);
916 m_perspectives.Add(perspective_all);
917
918 // "commit" all changes made to wxAuiManager
919 m_mgr.Update();
920 }
921
922 MyFrame::~MyFrame()
923 {
924 m_mgr.UnInit();
925 }
926
927 wxAuiDockArt* MyFrame::GetDockArt()
928 {
929 return m_mgr.GetArtProvider();
930 }
931
932 void MyFrame::DoUpdate()
933 {
934 m_mgr.Update();
935 }
936
937 void MyFrame::OnEraseBackground(wxEraseEvent& event)
938 {
939 event.Skip();
940 }
941
942 void MyFrame::OnSize(wxSizeEvent& event)
943 {
944 event.Skip();
945 }
946
947 void MyFrame::OnSettings(wxCommandEvent& WXUNUSED(event))
948 {
949 // show the settings pane, and float it
950 wxAuiPaneInfo& floating_pane = m_mgr.GetPane(wxT("settings")).Float().Show();
951
952 if (floating_pane.floating_pos == wxDefaultPosition)
953 floating_pane.FloatingPosition(GetStartPosition());
954
955 m_mgr.Update();
956 }
957
958 void MyFrame::OnGradient(wxCommandEvent& event)
959 {
960 int gradient = 0;
961
962 switch (event.GetId())
963 {
964 case ID_NoGradient: gradient = wxAUI_GRADIENT_NONE; break;
965 case ID_VerticalGradient: gradient = wxAUI_GRADIENT_VERTICAL; break;
966 case ID_HorizontalGradient: gradient = wxAUI_GRADIENT_HORIZONTAL; break;
967 }
968
969 m_mgr.GetArtProvider()->SetMetric(wxAUI_ART_GRADIENT_TYPE, gradient);
970 m_mgr.Update();
971 }
972
973 void MyFrame::OnManagerFlag(wxCommandEvent& event)
974 {
975 unsigned int flag = 0;
976
977 #if !defined(__WXMSW__) && !defined(__WXMAC__) && !defined(__WXGTK__)
978 if (event.GetId() == ID_TransparentDrag ||
979 event.GetId() == ID_TransparentHint ||
980 event.GetId() == ID_HintFade)
981 {
982 wxMessageBox(wxT("This option is presently only available on wxGTK, wxMSW and wxMac"));
983 return;
984 }
985 #endif
986
987 int id = event.GetId();
988
989 if (id == ID_TransparentHint ||
990 id == ID_VenetianBlindsHint ||
991 id == ID_RectangleHint ||
992 id == ID_NoHint)
993 {
994 unsigned int flags = m_mgr.GetFlags();
995 flags &= ~wxAUI_MGR_TRANSPARENT_HINT;
996 flags &= ~wxAUI_MGR_VENETIAN_BLINDS_HINT;
997 flags &= ~wxAUI_MGR_RECTANGLE_HINT;
998 m_mgr.SetFlags(flags);
999 }
1000
1001 switch (id)
1002 {
1003 case ID_AllowFloating: flag = wxAUI_MGR_ALLOW_FLOATING; break;
1004 case ID_TransparentDrag: flag = wxAUI_MGR_TRANSPARENT_DRAG; break;
1005 case ID_HintFade: flag = wxAUI_MGR_HINT_FADE; break;
1006 case ID_NoVenetianFade: flag = wxAUI_MGR_NO_VENETIAN_BLINDS_FADE; break;
1007 case ID_AllowActivePane: flag = wxAUI_MGR_ALLOW_ACTIVE_PANE; break;
1008 case ID_TransparentHint: flag = wxAUI_MGR_TRANSPARENT_HINT; break;
1009 case ID_VenetianBlindsHint: flag = wxAUI_MGR_VENETIAN_BLINDS_HINT; break;
1010 case ID_RectangleHint: flag = wxAUI_MGR_RECTANGLE_HINT; break;
1011 }
1012
1013 if (flag)
1014 {
1015 m_mgr.SetFlags(m_mgr.GetFlags() ^ flag);
1016 }
1017
1018 m_mgr.Update();
1019 }
1020
1021
1022 void MyFrame::OnNotebookFlag(wxCommandEvent& event)
1023 {
1024 int id = event.GetId();
1025
1026 if (id == ID_NotebookNoCloseButton ||
1027 id == ID_NotebookCloseButton ||
1028 id == ID_NotebookCloseButtonAll ||
1029 id == ID_NotebookCloseButtonActive)
1030 {
1031 m_notebook_style &= ~(wxAUI_NB_CLOSE_BUTTON |
1032 wxAUI_NB_CLOSE_ON_ACTIVE_TAB |
1033 wxAUI_NB_CLOSE_ON_ALL_TABS);
1034
1035 switch (id)
1036 {
1037 case ID_NotebookNoCloseButton: break;
1038 case ID_NotebookCloseButton: m_notebook_style |= wxAUI_NB_CLOSE_BUTTON; break;
1039 case ID_NotebookCloseButtonAll: m_notebook_style |= wxAUI_NB_CLOSE_ON_ALL_TABS; break;
1040 case ID_NotebookCloseButtonActive: m_notebook_style |= wxAUI_NB_CLOSE_ON_ACTIVE_TAB; break;
1041 }
1042 }
1043
1044 if (id == ID_NotebookAllowTabMove)
1045 {
1046 m_notebook_style ^= wxAUI_NB_TAB_MOVE;
1047 }
1048 else if (id == ID_NotebookAllowTabSplit)
1049 {
1050 m_notebook_style ^= wxAUI_NB_TAB_SPLIT;
1051 }
1052 else if (id == ID_NotebookWindowList)
1053 {
1054 m_notebook_style ^= wxAUI_NB_WINDOWLIST_BUTTON;
1055 }
1056 else if (id == ID_NotebookScrollButtons)
1057 {
1058 m_notebook_style ^= wxAUI_NB_SCROLL_BUTTONS;
1059 }
1060
1061
1062
1063 size_t i, count;
1064 wxAuiPaneInfoArray& all_panes = m_mgr.GetAllPanes();
1065 for (i = 0, count = all_panes.GetCount(); i < count; ++i)
1066 {
1067 wxAuiPaneInfo& pane = all_panes.Item(i);
1068
1069 if (pane.window->IsKindOf(CLASSINFO(wxAuiNotebook)))
1070 {
1071 pane.window->SetWindowStyleFlag(m_notebook_style);
1072 pane.window->Refresh();
1073 }
1074 }
1075
1076
1077 }
1078
1079
1080 void MyFrame::OnUpdateUI(wxUpdateUIEvent& event)
1081 {
1082 unsigned int flags = m_mgr.GetFlags();
1083
1084 switch (event.GetId())
1085 {
1086 case ID_NoGradient:
1087 event.Check(m_mgr.GetArtProvider()->GetMetric(wxAUI_ART_GRADIENT_TYPE) == wxAUI_GRADIENT_NONE);
1088 break;
1089 case ID_VerticalGradient:
1090 event.Check(m_mgr.GetArtProvider()->GetMetric(wxAUI_ART_GRADIENT_TYPE) == wxAUI_GRADIENT_VERTICAL);
1091 break;
1092 case ID_HorizontalGradient:
1093 event.Check(m_mgr.GetArtProvider()->GetMetric(wxAUI_ART_GRADIENT_TYPE) == wxAUI_GRADIENT_HORIZONTAL);
1094 break;
1095 case ID_AllowFloating:
1096 event.Check((flags & wxAUI_MGR_ALLOW_FLOATING) != 0);
1097 break;
1098 case ID_TransparentDrag:
1099 event.Check((flags & wxAUI_MGR_TRANSPARENT_DRAG) != 0);
1100 break;
1101 case ID_TransparentHint:
1102 event.Check((flags & wxAUI_MGR_TRANSPARENT_HINT) != 0);
1103 break;
1104 case ID_VenetianBlindsHint:
1105 event.Check((flags & wxAUI_MGR_VENETIAN_BLINDS_HINT) != 0);
1106 break;
1107 case ID_RectangleHint:
1108 event.Check((flags & wxAUI_MGR_RECTANGLE_HINT) != 0);
1109 break;
1110 case ID_NoHint:
1111 event.Check(((wxAUI_MGR_TRANSPARENT_HINT |
1112 wxAUI_MGR_VENETIAN_BLINDS_HINT |
1113 wxAUI_MGR_RECTANGLE_HINT) & flags) == 0);
1114 break;
1115 case ID_HintFade:
1116 event.Check((flags & wxAUI_MGR_HINT_FADE) != 0);
1117 break;
1118 case ID_NoVenetianFade:
1119 event.Check((flags & wxAUI_MGR_NO_VENETIAN_BLINDS_FADE) != 0);
1120 break;
1121
1122 case ID_NotebookNoCloseButton:
1123 event.Check((m_notebook_style & (wxAUI_NB_CLOSE_BUTTON|wxAUI_NB_CLOSE_ON_ALL_TABS|wxAUI_NB_CLOSE_ON_ACTIVE_TAB)) != 0);
1124 break;
1125 case ID_NotebookCloseButton:
1126 event.Check((m_notebook_style & wxAUI_NB_CLOSE_BUTTON) != 0);
1127 break;
1128 case ID_NotebookCloseButtonAll:
1129 event.Check((m_notebook_style & wxAUI_NB_CLOSE_ON_ALL_TABS) != 0);
1130 break;
1131 case ID_NotebookCloseButtonActive:
1132 event.Check((m_notebook_style & wxAUI_NB_CLOSE_ON_ACTIVE_TAB) != 0);
1133 break;
1134 case ID_NotebookAllowTabSplit:
1135 event.Check((m_notebook_style & wxAUI_NB_TAB_SPLIT) != 0);
1136 break;
1137 case ID_NotebookAllowTabMove:
1138 event.Check((m_notebook_style & wxAUI_NB_TAB_MOVE) != 0);
1139 break;
1140 case ID_NotebookScrollButtons:
1141 event.Check((m_notebook_style & wxAUI_NB_SCROLL_BUTTONS) != 0);
1142 break;
1143 case ID_NotebookWindowList:
1144 event.Check((m_notebook_style & wxAUI_NB_WINDOWLIST_BUTTON) != 0);
1145 break;
1146 }
1147 }
1148
1149 void MyFrame::OnPaneClose(wxAuiManagerEvent& evt)
1150 {
1151 if (evt.pane->name == wxT("test10"))
1152 {
1153 int res = wxMessageBox(wxT("Are you sure you want to close/hide this pane?"),
1154 wxT("wxAUI"),
1155 wxYES_NO,
1156 this);
1157 if (res != wxYES)
1158 evt.Veto();
1159 }
1160 }
1161
1162 void MyFrame::OnCreatePerspective(wxCommandEvent& WXUNUSED(event))
1163 {
1164 wxTextEntryDialog dlg(this, wxT("Enter a name for the new perspective:"),
1165 wxT("wxAUI Test"));
1166
1167 dlg.SetValue(wxString::Format(wxT("Perspective %u"), unsigned(m_perspectives.GetCount() + 1)));
1168 if (dlg.ShowModal() != wxID_OK)
1169 return;
1170
1171 if (m_perspectives.GetCount() == 0)
1172 {
1173 m_perspectives_menu->AppendSeparator();
1174 }
1175
1176 m_perspectives_menu->Append(ID_FirstPerspective + m_perspectives.GetCount(), dlg.GetValue());
1177 m_perspectives.Add(m_mgr.SavePerspective());
1178 }
1179
1180 void MyFrame::OnCopyPerspectiveCode(wxCommandEvent& WXUNUSED(event))
1181 {
1182 wxString s = m_mgr.SavePerspective();
1183
1184 #if wxUSE_CLIPBOARD
1185 if (wxTheClipboard->Open())
1186 {
1187 wxTheClipboard->SetData(new wxTextDataObject(s));
1188 wxTheClipboard->Close();
1189 }
1190 #endif
1191 }
1192
1193 void MyFrame::OnRestorePerspective(wxCommandEvent& event)
1194 {
1195 m_mgr.LoadPerspective(m_perspectives.Item(event.GetId() - ID_FirstPerspective));
1196 }
1197
1198
1199 wxPoint MyFrame::GetStartPosition()
1200 {
1201 static int x = 0;
1202 x += 20;
1203 wxPoint pt = ClientToScreen(wxPoint(0,0));
1204 return wxPoint(pt.x + x, pt.y + x);
1205 }
1206
1207 void MyFrame::OnCreateTree(wxCommandEvent& WXUNUSED(event))
1208 {
1209 m_mgr.AddPane(CreateTreeCtrl(), wxAuiPaneInfo().
1210 Name(wxT("Test")).Caption(wxT("Tree Control")).
1211 Float().FloatingPosition(GetStartPosition()).
1212 FloatingSize(wxSize(150,300)));
1213 m_mgr.Update();
1214 }
1215
1216 void MyFrame::OnCreateGrid(wxCommandEvent& WXUNUSED(event))
1217 {
1218 m_mgr.AddPane(CreateGrid(), wxAuiPaneInfo().
1219 Name(wxT("Test")).Caption(wxT("Grid")).
1220 Float().FloatingPosition(GetStartPosition()).
1221 FloatingSize(wxSize(300,200)));
1222 m_mgr.Update();
1223 }
1224
1225 void MyFrame::OnCreateHTML(wxCommandEvent& WXUNUSED(event))
1226 {
1227 m_mgr.AddPane(CreateHTMLCtrl(), wxAuiPaneInfo().
1228 Name(wxT("Test")).Caption(wxT("HTML Control")).
1229 Float().FloatingPosition(GetStartPosition()).
1230 FloatingSize(wxSize(300,200)));
1231 m_mgr.Update();
1232 }
1233
1234 void MyFrame::OnCreateNotebook(wxCommandEvent& WXUNUSED(event))
1235 {
1236 m_mgr.AddPane(CreateNotebook(), wxAuiPaneInfo().
1237 Name(wxT("Test")).Caption(wxT("Notebook")).
1238 Float().FloatingPosition(GetStartPosition()).
1239 //FloatingSize(300,200).
1240 CloseButton(true).MaximizeButton(true));
1241 m_mgr.Update();
1242 }
1243
1244 void MyFrame::OnCreateText(wxCommandEvent& WXUNUSED(event))
1245 {
1246 m_mgr.AddPane(CreateTextCtrl(), wxAuiPaneInfo().
1247 Name(wxT("Test")).Caption(wxT("Text Control")).
1248 Float().FloatingPosition(GetStartPosition()));
1249 m_mgr.Update();
1250 }
1251
1252 void MyFrame::OnCreateSizeReport(wxCommandEvent& WXUNUSED(event))
1253 {
1254 m_mgr.AddPane(CreateSizeReportCtrl(), wxAuiPaneInfo().
1255 Name(wxT("Test")).Caption(wxT("Client Size Reporter")).
1256 Float().FloatingPosition(GetStartPosition()).
1257 PinButton(true).CloseButton(true).MaximizeButton(true));
1258 m_mgr.Update();
1259 }
1260
1261 void MyFrame::OnChangeContentPane(wxCommandEvent& event)
1262 {
1263 m_mgr.GetPane(wxT("grid_content")).Show(event.GetId() == ID_GridContent);
1264 m_mgr.GetPane(wxT("text_content")).Show(event.GetId() == ID_TextContent);
1265 m_mgr.GetPane(wxT("tree_content")).Show(event.GetId() == ID_TreeContent);
1266 m_mgr.GetPane(wxT("sizereport_content")).Show(event.GetId() == ID_SizeReportContent);
1267 m_mgr.GetPane(wxT("html_content")).Show(event.GetId() == ID_HTMLContent);
1268 m_mgr.GetPane(wxT("notebook_content")).Show(event.GetId() == ID_NotebookContent);
1269 m_mgr.Update();
1270 }
1271
1272 void MyFrame::OnExit(wxCommandEvent& WXUNUSED(event))
1273 {
1274 Close(true);
1275 }
1276
1277 void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
1278 {
1279 wxMessageBox(_("wxAUI Demo\nAn advanced window management library for wxWidgets\n(c) Copyright 2005-2006, Kirix Corporation"), _("About wxAUI Demo"), wxOK, this);
1280 }
1281
1282 wxTextCtrl* MyFrame::CreateTextCtrl(const wxString& ctrl_text)
1283 {
1284 static int n = 0;
1285
1286 wxString text;
1287 if (ctrl_text.Length() > 0)
1288 text = ctrl_text;
1289 else
1290 text.Printf(wxT("This is text box %d"), ++n);
1291
1292 return new wxTextCtrl(this,wxID_ANY, text,
1293 wxPoint(0,0), wxSize(150,90),
1294 wxNO_BORDER | wxTE_MULTILINE);
1295 }
1296
1297
1298 wxGrid* MyFrame::CreateGrid()
1299 {
1300 wxGrid* grid = new wxGrid(this, wxID_ANY,
1301 wxPoint(0,0),
1302 wxSize(150,250),
1303 wxNO_BORDER | wxWANTS_CHARS);
1304 grid->CreateGrid(50, 20);
1305 return grid;
1306 }
1307
1308 wxTreeCtrl* MyFrame::CreateTreeCtrl()
1309 {
1310 wxTreeCtrl* tree = new wxTreeCtrl(this, wxID_ANY,
1311 wxPoint(0,0), wxSize(160,250),
1312 wxTR_DEFAULT_STYLE | wxNO_BORDER);
1313
1314 wxTreeItemId root = tree->AddRoot(wxT("wxAUI Project"));
1315 wxArrayTreeItemIds items;
1316
1317
1318 wxImageList* imglist = new wxImageList(16, 16, true, 2);
1319 imglist->Add(wxArtProvider::GetBitmap(wxART_FOLDER, wxART_OTHER, wxSize(16,16)));
1320 imglist->Add(wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16)));
1321 tree->AssignImageList(imglist);
1322
1323 items.Add(tree->AppendItem(root, wxT("Item 1"), 0));
1324 items.Add(tree->AppendItem(root, wxT("Item 2"), 0));
1325 items.Add(tree->AppendItem(root, wxT("Item 3"), 0));
1326 items.Add(tree->AppendItem(root, wxT("Item 4"), 0));
1327 items.Add(tree->AppendItem(root, wxT("Item 5"), 0));
1328
1329
1330 int i, count;
1331 for (i = 0, count = items.Count(); i < count; ++i)
1332 {
1333 wxTreeItemId id = items.Item(i);
1334 tree->AppendItem(id, wxT("Subitem 1"), 1);
1335 tree->AppendItem(id, wxT("Subitem 2"), 1);
1336 tree->AppendItem(id, wxT("Subitem 3"), 1);
1337 tree->AppendItem(id, wxT("Subitem 4"), 1);
1338 tree->AppendItem(id, wxT("Subitem 5"), 1);
1339 }
1340
1341
1342 tree->Expand(root);
1343
1344 return tree;
1345 }
1346
1347 wxSizeReportCtrl* MyFrame::CreateSizeReportCtrl(int width, int height)
1348 {
1349 wxSizeReportCtrl* ctrl = new wxSizeReportCtrl(this, wxID_ANY,
1350 wxDefaultPosition,
1351 wxSize(width, height), &m_mgr);
1352 return ctrl;
1353 }
1354
1355 wxHtmlWindow* MyFrame::CreateHTMLCtrl(wxWindow* parent)
1356 {
1357 if (!parent)
1358 parent = this;
1359
1360 wxHtmlWindow* ctrl = new wxHtmlWindow(parent, wxID_ANY,
1361 wxDefaultPosition,
1362 wxSize(400,300));
1363 ctrl->SetPage(GetIntroText());
1364 return ctrl;
1365 }
1366
1367 wxAuiNotebook* MyFrame::CreateNotebook()
1368 {
1369 // create the notebook off-window to avoid flicker
1370 wxSize client_size = GetClientSize();
1371
1372 wxAuiNotebook* ctrl = new wxAuiNotebook(this, wxID_ANY,
1373 wxPoint(client_size.x, client_size.y),
1374 wxSize(430,200),
1375 m_notebook_style);
1376
1377 ctrl->AddPage(CreateHTMLCtrl(ctrl), wxT("Welcome"));
1378
1379 wxPanel *panel = new wxPanel( ctrl, wxID_ANY );
1380 wxFlexGridSizer *flex = new wxFlexGridSizer( 2 );
1381 flex->AddGrowableRow( 0 );
1382 flex->AddGrowableRow( 3 );
1383 flex->AddGrowableCol( 1 );
1384 flex->Add( 5,5 ); flex->Add( 5,5 );
1385 flex->Add( new wxStaticText( panel, -1, wxT("wxTextCtrl:") ), 0, wxALL|wxALIGN_CENTRE, 5 );
1386 flex->Add( new wxTextCtrl( panel, -1, wxT(""), wxDefaultPosition, wxSize(100,-1)),
1387 1, wxALL|wxALIGN_CENTRE, 5 );
1388 flex->Add( new wxStaticText( panel, -1, wxT("wxSpinCtrl:") ), 0, wxALL|wxALIGN_CENTRE, 5 );
1389 flex->Add( new wxSpinCtrl( panel, -1, wxT("5"), wxDefaultPosition, wxSize(100,-1),
1390 wxSP_ARROW_KEYS, 5, 50, 5 ), 0, wxALL|wxALIGN_CENTRE, 5 );
1391 flex->Add( 5,5 ); flex->Add( 5,5 );
1392 panel->SetSizer( flex );
1393 ctrl->AddPage( panel, wxT("wxPanel") );
1394
1395 ctrl->AddPage( new wxTextCtrl( ctrl, wxID_ANY, wxT("Some text"),
1396 wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxNO_BORDER) , wxT("wxTextCtrl 1") );
1397
1398 ctrl->AddPage( new wxTextCtrl( ctrl, wxID_ANY, wxT("Some more text"),
1399 wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxNO_BORDER) , wxT("wxTextCtrl 2") );
1400
1401 ctrl->AddPage( new wxTextCtrl( ctrl, wxID_ANY, wxT("Some more text"),
1402 wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxNO_BORDER) , wxT("wxTextCtrl 3") );
1403
1404 ctrl->AddPage( new wxTextCtrl( ctrl, wxID_ANY, wxT("Some more text"),
1405 wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxNO_BORDER) , wxT("wxTextCtrl 4") );
1406
1407 ctrl->AddPage( new wxTextCtrl( ctrl, wxID_ANY, wxT("Some more text"),
1408 wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxNO_BORDER) , wxT("wxTextCtrl 5") );
1409
1410 ctrl->AddPage( new wxTextCtrl( ctrl, wxID_ANY, wxT("Some more text"),
1411 wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxNO_BORDER) , wxT("wxTextCtrl 6") );
1412
1413 ctrl->AddPage( new wxTextCtrl( ctrl, wxID_ANY, wxT("Some more text"),
1414 wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxNO_BORDER) , wxT("wxTextCtrl 7") );
1415
1416 ctrl->AddPage( new wxTextCtrl( ctrl, wxID_ANY, wxT("Some more text"),
1417 wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxNO_BORDER) , wxT("wxTextCtrl 8") );
1418
1419 return ctrl;
1420 }
1421
1422 wxString MyFrame::GetIntroText()
1423 {
1424 const char* text =
1425 "<html><body>"
1426 "<h3>Welcome to wxAUI</h3>"
1427 "<br/><b>Overview</b><br/>"
1428 "<p>wxAUI is an Advanced User Interface library for the wxWidgets toolkit "
1429 "that allows developers to create high-quality, cross-platform user "
1430 "interfaces quickly and easily.</p>"
1431 "<p><b>Features</b></p>"
1432 "<p>With wxAUI, developers can create application frameworks with:</p>"
1433 "<ul>"
1434 "<li>Native, dockable floating frames</li>"
1435 "<li>Perspective saving and loading</li>"
1436 "<li>Native toolbars incorporating real-time, &quot;spring-loaded&quot; dragging</li>"
1437 "<li>Customizable floating/docking behavior</li>"
1438 "<li>Completely customizable look-and-feel</li>"
1439 "<li>Optional transparent window effects (while dragging or docking)</li>"
1440 "</ul>"
1441 "<p><b>What's new in 0.9.2?</b></p>"
1442 "<p>The following features/fixes have been added since the last version of wxAUI:</p>"
1443 "<ul>"
1444 "<li>Support for wxMac</li>"
1445 "<li>Updates for wxWidgets 2.6.3</li>"
1446 "<li>Fix to pass more unused events through</li>"
1447 "<li>Fix to allow floating windows to receive idle events</li>"
1448 "<li>Fix for minimizing/maximizing problem with transparent hint pane</li>"
1449 "<li>Fix to not paint empty hint rectangles</li>"
1450 "<li>Fix for 64-bit compilation</li>"
1451 "</ul>"
1452 "<p><b>What changed in 0.9.1?</b></p>"
1453 "<p>The following features/fixes were added in wxAUI 0.9.1:</p>"
1454 "<ul>"
1455 "<li>Support for MDI frames</li>"
1456 "<li>Gradient captions option</li>"
1457 "<li>Active/Inactive panes option</li>"
1458 "<li>Fix for screen artifacts/paint problems</li>"
1459 "<li>Fix for hiding/showing floated window problem</li>"
1460 "<li>Fix for floating pane sizing problem</li>"
1461 "<li>Fix for drop position problem when dragging around center pane margins</li>"
1462 "<li>LF-only text file formatting for source code</li>"
1463 "</ul>"
1464 "<p>See README.txt for more information.</p>"
1465 "</body></html>";
1466
1467 return wxString::FromAscii(text);
1468 }