X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b3514fd6175a8d8a5ec37d49b161c6f4981d6d71..48889bca6f8b2504f78c0f47b32f5e95c64d915d:/samples/toolbar/toolbar.cpp diff --git a/samples/toolbar/toolbar.cpp b/samples/toolbar/toolbar.cpp index 181d7188f1..06f3ddd559 100644 --- a/samples/toolbar/toolbar.cpp +++ b/samples/toolbar/toolbar.cpp @@ -332,6 +332,13 @@ void MyFrame::RecreateToolbar() wxToolBarBase *toolBar = GetToolBar(); long style = toolBar ? toolBar->GetWindowStyle() : TOOLBAR_STYLE; + if (toolBar && m_searchTool && m_searchTool->GetToolBar() == NULL) + { + // see ~MyFrame() + toolBar->AddTool(m_searchTool); + } + m_searchTool = NULL; + delete toolBar; SetToolBar(NULL); @@ -417,6 +424,8 @@ void MyFrame::PopulateToolbar(wxToolBarBase* toolBar) } } + // this call is actually unnecessary as the toolbar will adjust its tools + // size to fit the biggest icon used anyhow but it doesn't hurt neither toolBar->SetToolBitmapSize(wxSize(w, h)); toolBar->AddTool(wxID_NEW, _T("New"), @@ -949,7 +958,7 @@ void MyFrame::OnToolbarBgCol(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnToolbarCustomBitmap(wxCommandEvent& WXUNUSED(event)) { - m_pathBmp = wxFileSelector(_T("Custom bitmap path")); + m_pathBmp = wxLoadFileSelector("custom bitmap", ""); RecreateToolbar(); }