本文整理汇总了C++中LIB_COMPONENT::RemoveAlias方法的典型用法代码示例。如果您正苦于以下问题:C++ LIB_COMPONENT::RemoveAlias方法的具体用法?C++ LIB_COMPONENT::RemoveAlias怎么用?C++ LIB_COMPONENT::RemoveAlias使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LIB_COMPONENT
的用法示例。
在下文中一共展示了LIB_COMPONENT::RemoveAlias方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DeleteAliasOfPart
void DIALOG_EDIT_COMPONENT_IN_LIBRARY::DeleteAliasOfPart( wxCommandEvent& event )
{
wxString aliasname = m_PartAliasListCtrl->GetStringSelection();
if( aliasname.IsEmpty() )
return;
if( aliasname.CmpNoCase( m_Parent->GetAliasName() ) == 0 )
{
wxString msg;
msg.Printf( _( "Alias <%s> cannot be removed while it is being edited!" ),
GetChars( aliasname ) );
DisplayError( this, msg );
return;
}
m_PartAliasListCtrl->Delete( m_PartAliasListCtrl->GetSelection() );
LIB_COMPONENT* component = m_Parent->GetComponent();
if( component )
component->RemoveAlias( aliasname );
if( m_PartAliasListCtrl->IsEmpty() )
{
m_ButtonDeleteAllAlias->Enable( false );
m_ButtonDeleteOneAlias->Enable( false );
}
}
示例2:
CMP_LIBRARY::~CMP_LIBRARY()
{
for( LIB_ALIAS_MAP::iterator it=aliases.begin(); it!=aliases.end(); it++ )
{
LIB_ALIAS* alias = (*it).second;
LIB_COMPONENT* component = alias->GetComponent();
alias = component->RemoveAlias( alias );
if( alias == NULL )
delete component;
}
}
示例3: RemoveEntry
LIB_ALIAS* CMP_LIBRARY::RemoveEntry( LIB_ALIAS* aEntry )
{
wxCHECK_MSG( aEntry != NULL, NULL, wxT( "NULL pointer cannot be removed from library." ) );
LIB_ALIAS_MAP::iterator it = aliases.find( aEntry->GetName() );
if( it == aliases.end() )
return NULL;
// If the entry pointer doesn't match the name it is mapped to in the library, we
// have done something terribly wrong.
wxCHECK_MSG( (*it).second == aEntry, NULL,
wxT( "Pointer mismatch while attempting to remove entry <" ) +
aEntry->GetName() + wxT( "> from library <" ) + GetName() + wxT( ">." ) );
LIB_ALIAS* alias = (LIB_ALIAS*) aEntry;
LIB_COMPONENT* component = alias->GetComponent();
alias = component->RemoveAlias( alias );
if( alias == NULL )
{
delete component;
if( aliases.size() > 1 )
{
LIB_ALIAS_MAP::iterator next = it;
next++;
if( next == aliases.end() )
next = aliases.begin();
alias = (*next).second;
}
}
aliases.erase( it );
isModified = true;
return alias;
}