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