// 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
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
node;
node = node->GetNext() )
{
- wxControl *control = node->GetData()->GetControl();
-
- if (control)
+ const wxToolBarToolBase * const tool = node->GetData();
+ if ( tool->IsControl() )
{
- if (control->GetId() == id)
+ wxControl * const control = tool->GetControl();
+
+ if ( !control )
+ {
+ wxFAIL_MSG( _T("NULL control in toolbar?") );
+ }
+ else if ( control->GetId() == id )
+ {
+ // found
return control;
+ }
}
}