本文整理汇总了C++中LIB_ITEM::SetFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ LIB_ITEM::SetFlags方法的具体用法?C++ LIB_ITEM::SetFlags怎么用?C++ LIB_ITEM::SetFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LIB_ITEM
的用法示例。
在下文中一共展示了LIB_ITEM::SetFlags方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: copySelectedItems
void LIB_EDIT_FRAME::copySelectedItems()
{
LIB_PART* part = GetCurPart();
if( !part )
return;
m_clipboard.ClearListAndDeleteItems(); // delete previous saved list, if exists
m_clipboard.SetLastCursorPosition( GetScreen()->m_BlockLocate.GetEnd() ); // store the reference point
for( LIB_ITEM& item : part->GetDrawItems() )
{
// We *do not* copy fields because they are unique for the whole component
// so skip them (do not duplicate) if they are flagged selected.
if( item.Type() == LIB_FIELD_T )
item.ClearFlags( SELECTED );
if( !item.IsSelected() )
continue;
// Do not clear the 'selected' flag. It is required to have items drawn when they are pasted.
LIB_ITEM* copy = (LIB_ITEM*) item.Clone();
copy->SetFlags( copy->GetFlags() | UR_TRANSIENT );
ITEM_PICKER picker( copy, UR_NEW );
m_clipboard.PushItem( picker );
}
}
示例2: DrawMovingBlockOutlines
/*
* Traces the outline of the search block structures
* The entire block follows the cursor
*/
void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
bool aErase )
{
SCH_DRAW_PANEL* panel =static_cast<SCH_DRAW_PANEL*>( aPanel );
LIB_EDIT_FRAME* frame = (LIB_EDIT_FRAME*) aPanel->GetParent();
KIGFX::SCH_VIEW* view = panel->GetView();
KIGFX::VIEW_GROUP* preview = view->GetPreview();
BASE_SCREEN* screen = aPanel->GetScreen();
BLOCK_SELECTOR* block = &screen->m_BlockLocate;
LIB_PART* component = frame->GetCurPart();
if( component == NULL )
return;
block->SetMoveVector( frame->GetCrossHairPosition( true ) - block->GetLastCursorPosition() );
preview->Clear();
view->SetVisible( preview, true );
for( unsigned ii = 0; ii < block->GetCount(); ii++ )
{
LIB_ITEM* libItem = (LIB_ITEM*) block->GetItem( ii );
LIB_ITEM* copy = static_cast<LIB_ITEM*>( libItem->Clone() );
copy->Move( copy->GetPosition() + block->GetMoveVector() );
copy->SetFlags( IS_MOVED );
preview->Add( copy );
view->Hide( libItem );
}
view->Update( preview );
}
示例3: BlockCopySelectedItems
void LIB_EDIT_FRAME::BlockCopySelectedItems( const wxPoint& aOffset, LIB_PART* aPart, BLOCK_SELECTOR* aBlock )
{
PICKED_ITEMS_LIST& aItemsList = aBlock->GetItems();
LIB_ITEM* oldItem;
LIB_ITEM* newItem;
for( unsigned ii = 0; ii < aItemsList.GetCount(); ii++ )
{
oldItem = static_cast<LIB_ITEM*>( aItemsList.GetPickedItem( ii ) );
// We *do not* copy fields because they are unique for the whole component
// so skip them (do not duplicate) if they are flagged selected.
if( oldItem->Type() == LIB_FIELD_T )
oldItem->ClearFlags( SELECTED );
if( !oldItem->IsSelected() )
continue;
newItem = (LIB_ITEM*) oldItem->Clone();
newItem->SetFlags( SELECTED );
oldItem->ClearFlags( SELECTED );
newItem->SetOffset( aBlock->GetMoveVector() );
aItemsList.SetPickedItem( newItem, ii );
aItemsList.SetPickedItemStatus( UR_NEW, ii );
aPart->GetDrawItems().push_back( newItem );
}
}