]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/tbarbase.cpp
clarified the parameters of MB2WC and WC2MB a little in the docs/headers
[wxWidgets.git] / src / common / tbarbase.cpp
index 62ec150e49507b44c7c80d442ebe4738560e3279..a2045d0f0cb83100c94b0eb4df98921deeb40bf9 100644 (file)
@@ -41,7 +41,7 @@
 #include "wx/toolbar.h"
 
 // ----------------------------------------------------------------------------
-// wxWindows macros
+// wxWidgets macros
 // ----------------------------------------------------------------------------
 
 BEGIN_EVENT_TABLE(wxToolBarBase, wxControl)
@@ -59,6 +59,8 @@ WX_DEFINE_LIST(wxToolBarToolsList);
 // wxToolBarToolBase
 // ----------------------------------------------------------------------------
 
+IMPLEMENT_DYNAMIC_CLASS(wxToolBarToolBase, wxObject)   
+
 bool wxToolBarToolBase::Enable(bool enable)
 {
     if ( m_enabled == enable )
@@ -619,6 +621,12 @@ void wxToolBarBase::UpdateWindowUI(long flags)
 {
     wxWindowBase::UpdateWindowUI(flags);
 
+    // There is no sense in updating the toolbar UI
+    // if the parent window is about to get destroyed
+    wxWindow *tlw = wxGetTopLevelParent( this );
+    if (tlw && wxPendingDelete.Member( tlw ))
+        return;
+
     wxEvtHandler* evtHandler = GetEventHandler() ;
 
     for ( wxToolBarToolsList::compatibility_iterator node = m_tools.GetFirst();