]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/toolbar/toolbar.cpp
fixed refresh problem after adding some items and calling Ensurevisible()
[wxWidgets.git] / samples / toolbar / toolbar.cpp
index 96be6becfb9dbcc518d9418b988e68d84a31cd63..c839ceee559e4bbc4e63433ff162321a00d9a0c0 100644 (file)
@@ -152,6 +152,8 @@ private:
 
 const int ID_TOOLBAR = 500;
 
+static const long TOOLBAR_STYLE = wxNO_BORDER | wxTB_FLAT | wxTB_DOCKABLE;
+
 enum
 {
     IDM_TOOLBAR_TOGGLETOOLBARSIZE = 200,
@@ -240,7 +242,7 @@ void MyFrame::RecreateToolbar()
 
     SetToolBar(NULL);
 
-    long style = wxNO_BORDER | wxTB_FLAT | wxTB_DOCKABLE;
+    long style = TOOLBAR_STYLE;
     style |= m_horzToolbar ? wxTB_HORIZONTAL : wxTB_VERTICAL;
 
     toolBar = CreateToolBar(style, ID_TOOLBAR);
@@ -465,7 +467,7 @@ void MyFrame::OnToggleAnotherToolbar(wxCommandEvent& WXUNUSED(event))
     {
         m_tbar = new wxToolBar(this, -1,
                                wxDefaultPosition, wxDefaultSize,
-                               wxTB_VERTICAL);
+                               TOOLBAR_STYLE | wxTB_VERTICAL);
         m_tbar->AddTool(wxID_HELP, wxBITMAP(help),
                         wxNullBitmap, FALSE,
                         NULL,