]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/tbar95.cpp
Corrected accidental pointer arithmetic in ClientToScreen and vice versa
[wxWidgets.git] / src / msw / tbar95.cpp
index 8777634b70cb8feb5e266af94240c5b1d317d1bd..5716e1a76fc83356ab09e64ed6e06187d2328cbd 100644 (file)
@@ -472,6 +472,15 @@ bool wxToolBar::Realize()
 
     const bool isVertical = HasFlag(wxTB_VERTICAL);
 
 
     const bool isVertical = HasFlag(wxTB_VERTICAL);
 
+    // delete all old buttons, if any
+    for ( size_t pos = 0; pos < m_nButtons; pos++ )
+    {
+        if ( !::SendMessage(GetHwnd(), TB_DELETEBUTTON, 0, 0) )
+        {
+            wxLogDebug(wxT("TB_DELETEBUTTON failed"));
+        }
+    }
+
     // First, add the bitmap: we use one bitmap for all toolbar buttons
     // ----------------------------------------------------------------
 
     // First, add the bitmap: we use one bitmap for all toolbar buttons
     // ----------------------------------------------------------------
 
@@ -612,15 +621,6 @@ bool wxToolBar::Realize()
 
                 bitmapId = m_nButtons;
             }
 
                 bitmapId = m_nButtons;
             }
-
-            // Now delete all the buttons
-            for ( size_t pos = 0; pos < m_nButtons; pos++ )
-            {
-                if ( !::SendMessage(GetHwnd(), TB_DELETEBUTTON, 0, 0) )
-                {
-                    wxLogDebug(wxT("TB_DELETEBUTTON failed"));
-                }
-            }
         }
 
         if ( addBitmap ) // no old bitmap or we can't replace it
         }
 
         if ( addBitmap ) // no old bitmap or we can't replace it
@@ -1197,7 +1197,7 @@ bool wxToolBar::HandleSize(WXWPARAM wParam, WXLPARAM lParam)
                 // FIXME: 6 is hardcoded separator line height...
                 //h += 6;
                 if (HasFlag(wxTB_NODIVIDER))
                 // FIXME: 6 is hardcoded separator line height...
                 //h += 6;
                 if (HasFlag(wxTB_NODIVIDER))
-                    h += 3;
+                    h += 4;
                 else
                     h += 6;
                 h *= m_maxRows;
                 else
                     h += 6;
                 h *= m_maxRows;