/** * Function RedrawActiveWindow * Display the current selected component. * If the component is an alias, the ROOT component is displayed */ void LIB_VIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) { LIB_COMPONENT* component; LIB_ALIAS* entry; CMP_LIBRARY* lib; wxString msg; wxString tmp; lib = CMP_LIBRARY::FindLibrary( m_libraryName ); if( lib == NULL ) return; entry = lib->FindEntry( m_entryName ); if( entry == NULL ) return; component = entry->GetComponent(); m_canvas->DrawBackGround( DC ); if( !entry->IsRoot() ) { if( component == NULL ) // Should not occur return; // Temporarily change the name field text to reflect the alias name. msg = entry->GetName(); tmp = component->GetName(); component->SetName( msg ); if( m_unit < 1 ) m_unit = 1; if( m_convert < 1 ) m_convert = 1; } else { msg = _( "None" ); } component->Draw( m_canvas, DC, wxPoint( 0, 0 ), m_unit, m_convert, GR_DEFAULT_DRAWMODE ); /* Redraw the cursor */ m_canvas->DrawCrossHair( DC ); if( !tmp.IsEmpty() ) component->SetName( tmp ); ClearMsgPanel(); AppendMsgPanel( _( "Part" ), component->GetName(), BLUE, 6 ); AppendMsgPanel( _( "Alias" ), msg, RED, 6 ); AppendMsgPanel( _( "Description" ), entry->GetDescription(), CYAN, 6 ); AppendMsgPanel( _( "Key words" ), entry->GetKeyWords(), DARKDARKGRAY ); }
/* * Traces the outline of the search block structures * The entire block follows the cursor */ void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition, bool aErase ) { BLOCK_SELECTOR* PtBlock; BASE_SCREEN* screen = aPanel->GetScreen(); wxPoint move_offset; PtBlock = &screen->m_BlockLocate; LIB_EDIT_FRAME* parent = ( LIB_EDIT_FRAME* ) aPanel->GetParent(); wxASSERT( parent != NULL ); LIB_COMPONENT* component = parent->GetComponent(); if( component == NULL ) return; int unit = parent->GetUnit(); int convert = parent->GetConvert(); if( aErase ) { PtBlock->Draw( aPanel, aDC, PtBlock->m_MoveVector, g_XorMode, PtBlock->m_Color ); component->Draw( aPanel, aDC, PtBlock->m_MoveVector, unit, convert, g_XorMode, -1, DefaultTransform, true, true, true ); } /* Repaint new view */ PtBlock->m_MoveVector = screen->GetCrossHairPosition() - PtBlock->m_BlockLastCursorPosition; GRSetDrawMode( aDC, g_XorMode ); PtBlock->Draw( aPanel, aDC, PtBlock->m_MoveVector, g_XorMode, PtBlock->m_Color ); component->Draw( aPanel, aDC, PtBlock->m_MoveVector, unit, convert, g_XorMode, -1, DefaultTransform, true, true, true ); }