- m_textWindow = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxPoint(0, 0), wxDefaultSize, wxTE_MULTILINE);
+ m_panel = new wxPanel(this, wxID_ANY);
+#if USE_UNMANAGED_TOOLBAR
+ m_extraToolBar = new wxToolBar(m_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_TEXT|wxTB_FLAT|wxTB_TOP);
+ PopulateToolbar(m_extraToolBar);
+#endif
+
+ m_textWindow = new wxTextCtrl(m_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
+
+ wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
+ m_panel->SetSizer(sizer);
+#if USE_UNMANAGED_TOOLBAR
+ if (m_extraToolBar)
+ sizer->Add(m_extraToolBar, 0, wxEXPAND, 0);
+#endif
+ sizer->Add(m_textWindow, 1, wxEXPAND, 0);
+}
+
+MyFrame::~MyFrame()
+{
+ if ( m_searchTool && !m_searchTool->GetToolBar() )
+ {
+ // we currently can't delete a toolbar tool ourselves, so we have to
+ // attach it to the toolbar just for it to be deleted, this is pretty
+ // ugly and will need to be changed
+ GetToolBar()->AddTool(m_searchTool);
+ }