本文整理汇总了C++中PICKED_ITEMS_LIST::PopItem方法的典型用法代码示例。如果您正苦于以下问题:C++ PICKED_ITEMS_LIST::PopItem方法的具体用法?C++ PICKED_ITEMS_LIST::PopItem怎么用?C++ PICKED_ITEMS_LIST::PopItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PICKED_ITEMS_LIST
的用法示例。
在下文中一共展示了PICKED_ITEMS_LIST::PopItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RestoreCopyFromUndoList
void FOOTPRINT_EDIT_FRAME::RestoreCopyFromUndoList( wxCommandEvent& aEvent )
{
if( UndoRedoBlocked() )
return;
if( GetScreen()->GetUndoCommandCount() <= 0 )
return;
// Inform tools that undo command was issued
TOOL_EVENT event( TC_MESSAGE, TA_UNDO_REDO, AS_GLOBAL );
m_toolManager->ProcessEvent( event );
if( UndoRedoBlocked() )
return;
// Save current module state in redo list
PICKED_ITEMS_LIST* lastcmd = new PICKED_ITEMS_LIST();
MODULE* module = GetBoard()->m_Modules.PopFront();
ITEM_PICKER wrapper( module, UR_MODEDIT );
KIGFX::VIEW* view = GetGalCanvas()->GetView();
lastcmd->PushItem( wrapper );
GetScreen()->PushCommandToRedoList( lastcmd );
view->Remove( module );
module->RunOnChildren( std::bind( &KIGFX::VIEW::Remove, view, _1 ) );
// Retrieve last module state from undo list
lastcmd = GetScreen()->PopCommandFromUndoList();
wrapper = lastcmd->PopItem();
module = (MODULE*) wrapper.GetItem();
delete lastcmd;
if( module )
{
GetBoard()->Add( module, ADD_APPEND );
view->Add( module );
module->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1 ) );
module->ViewUpdate();
}
SetCurItem( NULL );
OnModify();
m_canvas->Refresh();
}
示例2: GetComponentFromUndoList
void LIB_EDIT_FRAME::GetComponentFromUndoList( wxCommandEvent& event )
{
if( GetScreen()->GetUndoCommandCount() <= 0 )
return;
PICKED_ITEMS_LIST* lastcmd = new PICKED_ITEMS_LIST();
LIB_PART* part = GetCurPart();
ITEM_PICKER wrapper( part, UR_LIBEDIT );
lastcmd->PushItem( wrapper );
GetScreen()->PushCommandToRedoList( lastcmd );
lastcmd = GetScreen()->PopCommandFromUndoList();
wrapper = lastcmd->PopItem();
part = (LIB_PART* ) wrapper.GetItem();
// Do not delete the previous part by calling SetCurPart( part ),
// which calls delete <previous part>.
// <previous part> is now put in redo list and is owned by this list.
// Just set the current part to the part which come from the undo list
m_my_part = part;
if( !part )
return;
if( !m_aliasName.IsEmpty() && !part->HasAlias( m_aliasName ) )
m_aliasName = part->GetName();
m_drawItem = NULL;
UpdateAliasSelectList();
UpdatePartSelectList();
SetShowDeMorgan( part->HasConversion() );
DisplayLibInfos();
DisplayCmpDoc();
OnModify();
m_canvas->Refresh();
}