]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/tbarbase.cpp
Remove check for other wxPaintDCs. It should be done in wxWindow instead.
[wxWidgets.git] / src / common / tbarbase.cpp
index 020171d8f4bc1d5b21d23cbeb56792f1c5ae7196..9b03daccee3159dd2aaede9448ae8605ae5d14fe 100644 (file)
@@ -47,7 +47,6 @@
 IMPLEMENT_CLASS(wxToolBarBase, wxControl)
 
 BEGIN_EVENT_TABLE(wxToolBarBase, wxControl)
-    EVT_IDLE(wxToolBarBase::OnIdle)
 END_EVENT_TABLE()
 
 #include "wx/listimpl.cpp"
@@ -581,31 +580,12 @@ void wxToolBarBase::OnMouseEnter(int id)
 // UI updates
 // ----------------------------------------------------------------------------
 
-void wxToolBarBase::OnIdle(wxIdleEvent& event)
+// Do the toolbar button updates (check for EVT_UPDATE_UI handlers)
+void wxToolBarBase::UpdateWindowUI(long flags)
 {
-    DoToolbarUpdates();
-
-    event.Skip();
-}
+    wxWindowBase::UpdateWindowUI(flags);
 
-// Do the toolbar button updates (check for EVT_UPDATE_UI handlers)
-void wxToolBarBase::DoToolbarUpdates()
-{
-    wxWindow* parent = this;
-    while (parent->GetParent())
-        parent = parent->GetParent();
-
-// This kind of #ifdef is a good way to annoy people. It breaks
-// apps, but only on one platform and due to a hack in officially
-// platform independent code. It took me hours to fix this. RR.
-//
-// #ifdef __WXMSW__
-//    wxWindow* focusWin = wxFindFocusDescendant(parent);
-// #else
-    wxWindow* focusWin = (wxWindow*) NULL;
-// #endif
-
-    wxEvtHandler* evtHandler = focusWin ? focusWin->GetEventHandler() : GetEventHandler() ;
+    wxEvtHandler* evtHandler = GetEventHandler() ;
 
     for ( wxToolBarToolsList::Node* node = m_tools.GetFirst();
           node;