From dbd2f79065a860f784057e8390bd77e40740fa67 Mon Sep 17 00:00:00 2001 From: Benjamin Williams Date: Fri, 27 Oct 2006 07:21:27 +0000 Subject: [PATCH] made the multi-notebook the default view in the aui sample; added welcome screen to the notebook git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/aui/auidemo.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/samples/aui/auidemo.cpp b/samples/aui/auidemo.cpp index b631de5728..64bd808941 100644 --- a/samples/aui/auidemo.cpp +++ b/samples/aui/auidemo.cpp @@ -106,7 +106,7 @@ private: wxTreeCtrl* CreateTreeCtrl(); wxSizeReportCtrl* CreateSizeReportCtrl(int width = 80, int height = 80); wxPoint GetStartPosition(); - wxHtmlWindow* CreateHTMLCtrl(); + wxHtmlWindow* CreateHTMLCtrl(wxWindow* parent = NULL); wxAuiMultiNotebook* CreateNotebook(); wxString GetIntroText(); @@ -862,7 +862,7 @@ MyFrame::MyFrame(wxWindow* parent, m_mgr.GetPane(wxT("tb6")).Hide(); m_mgr.GetPane(wxT("test8")).Show().Left().Layer(0).Row(0).Position(0); m_mgr.GetPane(wxT("test10")).Show().Bottom().Layer(0).Row(0).Position(0); - m_mgr.GetPane(wxT("html_content")).Show(); + m_mgr.GetPane(wxT("notebook_content")).Show(); wxString perspective_default = m_mgr.SavePerspective(); m_perspectives.Add(perspective_default); @@ -1219,9 +1219,12 @@ wxSizeReportCtrl* MyFrame::CreateSizeReportCtrl(int width, int height) return ctrl; } -wxHtmlWindow* MyFrame::CreateHTMLCtrl() +wxHtmlWindow* MyFrame::CreateHTMLCtrl(wxWindow* parent) { - wxHtmlWindow* ctrl = new wxHtmlWindow(this, wxID_ANY, + if (!parent) + parent = this; + + wxHtmlWindow* ctrl = new wxHtmlWindow(parent, wxID_ANY, wxDefaultPosition, wxSize(400,300)); ctrl->SetPage(GetIntroText()); @@ -1233,6 +1236,8 @@ wxAuiMultiNotebook* MyFrame::CreateNotebook() wxAuiMultiNotebook* ctrl = new wxAuiMultiNotebook( this, wxID_ANY, wxDefaultPosition, wxSize(400,300), wxNO_BORDER ); + ctrl->AddPage(CreateHTMLCtrl(ctrl), wxT("Welcome")); + wxPanel *panel = new wxPanel( ctrl, wxID_ANY ); wxFlexGridSizer *flex = new wxFlexGridSizer( 2 ); flex->AddGrowableRow( 0 );