本文整理汇总了C++中PICKED_ITEMS_LIST::SetPickedItem方法的典型用法代码示例。如果您正苦于以下问题:C++ PICKED_ITEMS_LIST::SetPickedItem方法的具体用法?C++ PICKED_ITEMS_LIST::SetPickedItem怎么用?C++ PICKED_ITEMS_LIST::SetPickedItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PICKED_ITEMS_LIST
的用法示例。
在下文中一共展示了PICKED_ITEMS_LIST::SetPickedItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DuplicateItemsInList
void DuplicateItemsInList( SCH_SCREEN* screen, PICKED_ITEMS_LIST& aItemsList,
const wxPoint& aMoveVector )
{
SCH_ITEM* newitem;
if( aItemsList.GetCount() == 0 )
return;
for( unsigned ii = 0; ii < aItemsList.GetCount(); ii++ )
{
newitem = DuplicateStruct( (SCH_ITEM*) aItemsList.GetPickedItem( ii ) );
aItemsList.SetPickedItem( newitem, ii );
aItemsList.SetPickedItemStatus( UR_NEW, ii );
{
switch( newitem->Type() )
{
case SCH_JUNCTION_T:
case SCH_LINE_T:
case SCH_BUS_BUS_ENTRY_T:
case SCH_BUS_WIRE_ENTRY_T:
case SCH_TEXT_T:
case SCH_LABEL_T:
case SCH_GLOBAL_LABEL_T:
case SCH_HIERARCHICAL_LABEL_T:
case SCH_SHEET_PIN_T:
case SCH_MARKER_T:
case SCH_NO_CONNECT_T:
default:
break;
case SCH_SHEET_T:
{
SCH_SHEET* sheet = (SCH_SHEET*) newitem;
sheet->SetTimeStamp( GetNewTimeStamp() );
break;
}
case SCH_COMPONENT_T:
( (SCH_COMPONENT*) newitem )->SetTimeStamp( GetNewTimeStamp() );
( (SCH_COMPONENT*) newitem )->ClearAnnotation( NULL );
break;
}
SetSchItemParent( newitem, screen );
screen->Append( newitem );
}
}
MoveItemsInList( aItemsList, aMoveVector );
}
示例2: SaveCopyInUndoList
void PCB_EDIT_FRAME::SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList,
UNDO_REDO_T aTypeCommand,
const wxPoint& aTransformPoint )
{
PICKED_ITEMS_LIST* commandToUndo = new PICKED_ITEMS_LIST();
commandToUndo->m_TransformPoint = aTransformPoint;
// Copy picker list:
commandToUndo->CopyList( aItemsList );
// Verify list, and creates data if needed
for( unsigned ii = 0; ii < commandToUndo->GetCount(); ii++ )
{
BOARD_ITEM* item = (BOARD_ITEM*) commandToUndo->GetPickedItem( ii );
// For texts belonging to modules, we need to save state of the parent module
if( item->Type() == PCB_MODULE_TEXT_T )
{
item = item->GetParent();
wxASSERT( item->Type() == PCB_MODULE_T );
if( item == NULL )
continue;
commandToUndo->SetPickedItem( item, ii );
commandToUndo->SetPickedItemStatus( UR_CHANGED, ii );
}
UNDO_REDO_T command = commandToUndo->GetPickedItemStatus( ii );
if( command == UR_UNSPECIFIED )
{
command = aTypeCommand;
commandToUndo->SetPickedItemStatus( command, ii );
}
wxASSERT( item );
switch( command )
{
case UR_CHANGED:
/* If needed, create a copy of item, and put in undo list
* in the picker, as link
* If this link is not null, the copy is already done
*/
if( commandToUndo->GetPickedItemLink( ii ) == NULL )
commandToUndo->SetPickedItemLink( item->Clone(), ii );
break;
case UR_MOVED:
case UR_ROTATED:
case UR_ROTATED_CLOCKWISE:
case UR_FLIPPED:
case UR_NEW:
case UR_DELETED:
break;
default:
{
wxString msg;
msg.Printf( wxT( "SaveCopyInUndoList() error (unknown code %X)" ), command );
wxMessageBox( msg );
}
break;
}
}
if( commandToUndo->GetCount() )
{
/* Save the copy in undo list */
GetScreen()->PushCommandToUndoList( commandToUndo );
/* Clear redo list, because after a new command one cannot redo a command */
GetScreen()->ClearUndoORRedoList( GetScreen()->m_RedoList );
}
else // Should not occur
{
delete commandToUndo;
}
}