]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/toolbar/toolbar.cpp
Further corrections to wxFileName docs
[wxWidgets.git] / samples / toolbar / toolbar.cpp
index c13a43b87d48238deab310c2355ab311ecaee2c7..c1c95e469b6283c13370cc22bf83eaf05aeb2380 100644 (file)
@@ -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
         }
     }