END_EVENT_TABLE()
#endif
+IMPLEMENT_CLASS(wxToolBarBase, wxControl)
+
#include "wx/listimpl.cpp"
WX_DEFINE_LIST(wxToolBarToolsList);
return tool ? tool->GetClientData() : (wxObject *)NULL;
}
+void wxToolBarBase::SetToolClientData(int id, wxObject *clientData)
+{
+ wxToolBarToolBase *tool = FindById(id);
+
+ wxCHECK_RET( tool, _T("no such tool in wxToolBar::SetToolClientData") );
+
+ tool->SetClientData(clientData);
+}
+
bool wxToolBarBase::GetToolState(int id) const
{
wxToolBarToolBase *tool = FindById(id);
// 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;