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