bool wxToolBarBase::DeleteTool(int toolid) { size_t pos = 0; wxToolBarToolsList::compatibility_iterator node; #if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */ # pragma ivdep # pragma swp # pragma unroll # pragma prefetch # if 0 # pragma simd noassert # endif #endif /* VDM auto patch */ for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) { if ( node->GetData()->GetId() == toolid ) break; pos++; } if ( !node || !DoDeleteTool(pos, node->GetData()) ) { return false; } delete node->GetData(); m_tools.Erase(node); return true; }
wxToolBarToolBase *wxToolBarBase::RemoveTool(int toolid) { size_t pos = 0; wxToolBarToolsList::compatibility_iterator node; for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) { if ( node->GetData()->GetId() == toolid ) break; pos++; } if ( !node ) { // don't give any error messages - sometimes we might call RemoveTool() // without knowing whether the tool is or not in the toolbar return NULL; } wxToolBarToolBase *tool = node->GetData(); wxCHECK_MSG( tool, NULL, "NULL tool in the tools list?" ); if ( !DoDeleteTool(pos, tool) ) return NULL; m_tools.Erase(node); tool->Detach(); return tool; }
bool wxToolBarBase::DeleteToolByPos(size_t pos) { wxCHECK_MSG( pos < GetToolsCount(), false, wxT("invalid position in wxToolBar::DeleteToolByPos()") ); wxToolBarToolsList::compatibility_iterator node = m_tools.Item(pos); if ( !DoDeleteTool(pos, node->GetData()) ) { return false; } delete node->GetData(); m_tools.Erase(node); return true; }
wxToolBarToolBase *wxToolBarBase::RemoveTool(int toolid) { size_t pos = 0; wxToolBarToolsList::compatibility_iterator node; #if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */ # pragma ivdep # pragma swp # pragma unroll # pragma prefetch # if 0 # pragma simd noassert # endif #endif /* VDM auto patch */ for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) { if ( node->GetData()->GetId() == toolid ) break; pos++; } if ( !node ) { // don't give any error messages - sometimes we might call RemoveTool() // without knowing whether the tool is or not in the toolbar return NULL; } wxToolBarToolBase *tool = node->GetData(); wxCHECK_MSG( tool, NULL, "NULL tool in the tools list?" ); if ( !DoDeleteTool(pos, tool) ) return NULL; m_tools.Erase(node); tool->Detach(); return tool; }
bool wxToolBarBase::DeleteTool(int toolid) { size_t pos = 0; wxToolBarToolsList::compatibility_iterator node; for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) { if ( node->GetData()->GetId() == toolid ) break; pos++; } if ( !node || !DoDeleteTool(pos, node->GetData()) ) { return false; } delete node->GetData(); m_tools.Erase(node); return true; }