本文整理汇总了C++中LIB_COMPONENT::IsNormal方法的典型用法代码示例。如果您正苦于以下问题:C++ LIB_COMPONENT::IsNormal方法的具体用法?C++ LIB_COMPONENT::IsNormal怎么用?C++ LIB_COMPONENT::IsNormal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LIB_COMPONENT
的用法示例。
在下文中一共展示了LIB_COMPONENT::IsNormal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddMenusForEditComponent
void AddMenusForEditComponent( wxMenu* PopMenu, SCH_COMPONENT* Component )
{
if( Component->Type() != SCH_COMPONENT_T )
{
wxASSERT( 0 );
return;
}
wxString msg;
LIB_ALIAS* libEntry;
LIB_COMPONENT* libComponent = NULL;
libEntry = CMP_LIBRARY::FindLibraryEntry( Component->GetLibName() );
if( libEntry )
libComponent = libEntry->GetComponent();
wxMenu* editmenu = new wxMenu;
msg = AddHotkeyName( _( "Edit" ), s_Schematic_Hokeys_Descr, HK_EDIT );
AddMenuItem( editmenu, ID_SCH_EDIT_ITEM, msg, KiBitmap( edit_component_xpm ) );
if( libComponent && libComponent->IsNormal() )
{
msg = AddHotkeyName( _( "Value" ), s_Schematic_Hokeys_Descr,
HK_EDIT_COMPONENT_VALUE );
AddMenuItem( editmenu, ID_SCH_EDIT_COMPONENT_VALUE, msg,
KiBitmap( edit_comp_value_xpm ) );
msg = AddHotkeyName( _( "Reference" ), s_Schematic_Hokeys_Descr,
HK_EDIT_COMPONENT_REFERENCE );
AddMenuItem( editmenu, ID_SCH_EDIT_COMPONENT_REFERENCE, msg,
KiBitmap( edit_comp_ref_xpm ) );
msg = AddHotkeyName( _( "Footprint" ), s_Schematic_Hokeys_Descr,
HK_EDIT_COMPONENT_FOOTPRINT );
AddMenuItem( editmenu, ID_SCH_EDIT_COMPONENT_FOOTPRINT, msg,
KiBitmap( edit_comp_footprint_xpm ) );
}
if( libComponent && libComponent->HasConversion() )
AddMenuItem( editmenu, ID_POPUP_SCH_EDIT_CONVERT_CMP, _( "Convert" ),
KiBitmap( component_select_alternate_shape_xpm ) );
if( libComponent && ( libComponent->GetPartCount() >= 2 ) )
{
wxMenu* sel_unit_menu = new wxMenu; int ii;
for( ii = 0; ii < libComponent->GetPartCount(); ii++ )
{
wxString num_unit;
int unit = Component->GetUnit();
num_unit.Printf( _( "Unit %d %c" ), ii + 1,
"?ABCDEFGHIJKLMNOPQRSTUVWXYZ"[ ii + 1 ] );
wxMenuItem * item = sel_unit_menu->Append( ID_POPUP_SCH_SELECT_UNIT1 + ii,
num_unit, wxEmptyString,
wxITEM_CHECK );
if( unit == ii + 1 )
item->Check(true);
}
AddMenuItem( editmenu, sel_unit_menu, ID_POPUP_SCH_SELECT_UNIT_CMP,
_( "Unit" ), KiBitmap( component_select_unit_xpm ) );
}
if( !Component->GetFlags() )
{
AddMenuItem( editmenu, ID_POPUP_SCH_CALL_LIBEDIT_AND_LOAD_CMP,
_( "Edit with Library Editor" ),
KiBitmap( libedit_xpm ) );
}
AddMenuItem( PopMenu, editmenu, ID_SCH_EDIT_ITEM,
_( "Edit Component" ), KiBitmap( edit_component_xpm ) );
}