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