]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/tbarbase.cpp
Some Unicode compilation fixes. This Unicode stuff in file functions is
[wxWidgets.git] / src / common / tbarbase.cpp
index f66ce0f3b1a52e5fdd67d221565076797934bbc3..d904ff91949b1412732f40df617a08c293fc47f7 100644 (file)
@@ -53,6 +53,8 @@
     END_EVENT_TABLE()
 #endif
 
+IMPLEMENT_CLASS(wxToolBarBase, wxControl)
+
 #include "wx/listimpl.cpp"
 
 WX_DEFINE_LIST(wxToolBarToolsList);
@@ -526,7 +528,17 @@ void wxToolBarBase::OnIdle(wxIdleEvent& event)
 // Do the toolbar button updates (check for EVT_UPDATE_UI handlers)
 void wxToolBarBase::DoToolbarUpdates()
 {
-    wxEvtHandler* evtHandler = GetEventHandler();
+    wxWindow* parent = this;
+    while (parent->GetParent())
+        parent = parent->GetParent();
+
+#ifdef __WXMSW__
+    wxWindow* focusWin = wxFindFocusDescendant(parent);
+#else
+    wxWindow* focusWin = (wxWindow*) NULL;
+#endif
+
+    wxEvtHandler* evtHandler = focusWin ? focusWin->GetEventHandler() : GetEventHandler() ;
 
     for ( wxToolBarToolsList::Node* node = m_tools.GetFirst();
           node;