X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/652ab15353e042c7dbaa7c5ab6ba5e28595e64ed..f9007c324c9b4f6288156dcf0b865090ee0c0c38:/src/common/tbarbase.cpp diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index e2a1ccd70f..020171d8f4 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -5,8 +5,8 @@ // Modified by: VZ at 11.12.99 (wxScrollableToolBar splitted off) // Created: 04/01/98 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows license +// Copyright: (c) Julian Smart +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -458,6 +458,22 @@ void wxToolBarBase::SetToolClientData(int id, wxObject *clientData) tool->SetClientData(clientData); } +int wxToolBarBase::GetToolPos(int id) const +{ + size_t pos = 0; + wxToolBarToolsList::Node *node; + + for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) + { + if ( node->GetData()->GetId() == id ) + return pos; + + pos++; + } + + return wxNOT_FOUND; +} + bool wxToolBarBase::GetToolState(int id) const { wxToolBarToolBase *tool = FindById(id);