266
266
if( entry == NULL )
269
wxCHECK_RET( entry->isAlias(),
270
wxT( "Entry \"" ) + entry->GetName() + wxT( "\" found in library <" ) +
271
lib->GetName() + wxT( "> is not a LIB_ALIAS object." ) );
273
LIB_ALIAS* alias = (LIB_ALIAS*) entry;
274
component = alias->GetComponent();
269
276
DrawPanel->DrawBackGround( DC );
271
if( entry->isAlias() )
278
if( !alias->IsRoot() )
273
LIB_ALIAS* alias = (LIB_ALIAS*) entry;
274
component = alias->GetComponent();
276
280
if( component == NULL ) // Should not occur
278
wxASSERT( component != NULL );
281
if( ! component->isComponent() )
283
wxASSERT( component->isComponent() );
283
// Temporarily change the name field text to reflect the alias name.
287
284
msg = alias->GetName();
289
/* Temporarily change the name field text to reflect the alias name. */
290
285
tmp = component->GetName();
291
component->SetName( alias->GetName() );
286
component->SetName( msg );
294
290
if( m_convert < 1 )
296
component->SetName( tmp );
300
component = (LIB_COMPONENT*) entry;
301
295
msg = _( "None" );
304
component->Draw( DrawPanel, DC, wxPoint( 0, 0 ), m_unit, m_convert,
305
GR_DEFAULT_DRAWMODE );
298
component->Draw( DrawPanel, DC, wxPoint( 0, 0 ), m_unit, m_convert, GR_DEFAULT_DRAWMODE );
307
300
/* Redraw the cursor */
308
301
DrawPanel->DrawCursor( DC );