X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a4f03d8798648492bbe7ddb2f0531e7ed7929f84..357d2b88cb15fa0ad97b1676fdbc88c2abc85451:/samples/toolbar/toolbar.cpp diff --git a/samples/toolbar/toolbar.cpp b/samples/toolbar/toolbar.cpp index c13a43b87d..c1c95e469b 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); @@ -401,7 +408,7 @@ void MyFrame::PopulateToolbar(wxToolBarBase* toolBar) INIT_TOOL_BMP(paste); INIT_TOOL_BMP(print); INIT_TOOL_BMP(help); - + int w = toolBarBitmaps[Tool_new].GetWidth(), h = toolBarBitmaps[Tool_new].GetHeight(); @@ -412,22 +419,8 @@ void MyFrame::PopulateToolbar(wxToolBarBase* toolBar) for ( size_t n = Tool_new; n < WXSIZEOF(toolBarBitmaps); n++ ) { -#if 0 - wxBitmap source = toolBarBitmaps[n]; - wxBitmap target( w, h ); - wxMemoryDC dc( target ); - dc.SetPen( wxPen( wxColour(100,100,100), 1, wxSOLID ) ); - dc.SetBrush( *wxTRANSPARENT_BRUSH ); - dc.DrawRectangle( 0, 0, w, h ); - wxRect inner(1,1,w-2,h-2); - dc.GradientFillLinear( inner, wxColour(240,240,240), wxColour(150,150,150), wxSOUTH ); - - dc.DrawBitmap( source, w/4, h/4, true ); - toolBarBitmaps[n] = target; -#else toolBarBitmaps[n] = wxBitmap(toolBarBitmaps[n].ConvertToImage().Scale(w, h)); -#endif } }