auidemo.cpp 67 KB

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