本文整理汇总了C++中PART_LIB::GetAliasNames方法的典型用法代码示例。如果您正苦于以下问题:C++ PART_LIB::GetAliasNames方法的具体用法?C++ PART_LIB::GetAliasNames怎么用?C++ PART_LIB::GetAliasNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PART_LIB
的用法示例。
在下文中一共展示了PART_LIB::GetAliasNames方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddLibrary
void COMPONENT_TREE_SEARCH_CONTAINER::AddLibrary( PART_LIB& aLib )
{
wxArrayString all_aliases;
if( m_filter == CMP_FILTER_POWER )
aLib.GetEntryTypePowerNames( all_aliases );
else
aLib.GetAliasNames( all_aliases );
AddAliasList( aLib.GetName(), all_aliases, &aLib );
++m_libraries_added;
}
示例2: DeleteOnePart
void LIB_EDIT_FRAME::DeleteOnePart( wxCommandEvent& event )
{
wxString cmp_name;
LIB_ALIAS* libEntry;
wxArrayString nameList;
wxString msg;
m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );
m_lastDrawItem = NULL;
m_drawItem = NULL;
PART_LIB* lib = GetCurLib();
if( !lib )
{
SelectActiveLibrary();
lib = GetCurLib();
if( !lib )
{
DisplayError( this, _( "Please select a component library." ) );
return;
}
}
lib->GetAliasNames( nameList );
if( nameList.IsEmpty() )
{
msg.Printf( _( "Part library '%s' is empty." ), GetChars( lib->GetName() ) );
wxMessageBox( msg, _( "Delete Entry Error" ), wxID_OK | wxICON_EXCLAMATION, this );
return;
}
msg.Printf( _( "Select one of %d components to delete\nfrom library '%s'." ),
int( nameList.GetCount() ),
GetChars( lib->GetName() ) );
wxSingleChoiceDialog dlg( this, msg, _( "Delete Part" ), nameList );
if( dlg.ShowModal() == wxID_CANCEL || dlg.GetStringSelection().IsEmpty() )
return;
libEntry = lib->FindAlias( dlg.GetStringSelection() );
if( !libEntry )
{
msg.Printf( _( "Entry '%s' not found in library '%s'." ),
GetChars( dlg.GetStringSelection() ),
GetChars( lib->GetName() ) );
DisplayError( this, msg );
return;
}
msg.Printf( _( "Delete component '%s' from library '%s' ?" ),
GetChars( libEntry->GetName() ),
GetChars( lib->GetName() ) );
if( !IsOK( this, msg ) )
return;
LIB_PART* part = GetCurPart();
if( !part || !part->HasAlias( libEntry->GetName() ) )
{
lib->RemoveAlias( libEntry );
return;
}
// If deleting the current entry or removing one of the aliases for
// the current entry, sync the changes in the current entry as well.
if( GetScreen()->IsModify() && !IsOK( this, _(
"The component being deleted has been modified."
" All changes will be lost. Discard changes?" ) ) )
{
return;
}
LIB_ALIAS* nextEntry = lib->RemoveAlias( libEntry );
if( nextEntry != NULL )
{
if( LoadOneLibraryPartAux( nextEntry, lib ) )
Zoom_Automatique( false );
}
else
{
SetCurPart( NULL ); // delete CurPart
m_aliasName.Empty();
}
m_canvas->Refresh();
}