Added wxToolBar::FindControl() to fish out
controls in a toolbar by its id. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15712 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -206,6 +206,24 @@ wxToolBarToolBase *wxToolBarBase::InsertControl(size_t pos, wxControl *control)
|
||||
return tool;
|
||||
}
|
||||
|
||||
wxControl *wxToolBarBase::FindControl( int id )
|
||||
{
|
||||
for ( wxToolBarToolsList::Node* node = m_tools.GetFirst();
|
||||
node;
|
||||
node = node->GetNext() )
|
||||
{
|
||||
wxControl *control = node->GetData()->GetControl();
|
||||
|
||||
if (control)
|
||||
{
|
||||
if (control->GetId() == id)
|
||||
return control;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxToolBarToolBase *wxToolBarBase::AddSeparator()
|
||||
{
|
||||
return InsertSeparator(GetToolsCount());
|
||||
|
||||
Reference in New Issue
Block a user