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