本文整理汇总了C++中LIB_COMPONENT::Draw方法的典型用法代码示例。如果您正苦于以下问题:C++ LIB_COMPONENT::Draw方法的具体用法?C++ LIB_COMPONENT::Draw怎么用?C++ LIB_COMPONENT::Draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LIB_COMPONENT
的用法示例。
在下文中一共展示了LIB_COMPONENT::Draw方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RedrawActiveWindow
/**
* 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 );
}