本文整理汇总了C++中BASE_SCREEN::SetCurItem方法的典型用法代码示例。如果您正苦于以下问题:C++ BASE_SCREEN::SetCurItem方法的具体用法?C++ BASE_SCREEN::SetCurItem怎么用?C++ BASE_SCREEN::SetCurItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BASE_SCREEN
的用法示例。
在下文中一共展示了BASE_SCREEN::SetCurItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AbortMoveTextModule
/**
* Abort text move in progress.
*
* If a text is selected, its initial coordinates are regenerated.
*/
static void AbortMoveTextModule( EDA_DRAW_PANEL* Panel, wxDC* DC )
{
BASE_SCREEN* screen = Panel->GetScreen();
TEXTE_MODULE* Text = static_cast<TEXTE_MODULE*>( screen->GetCurItem() );
MODULE* Module;
Panel->SetMouseCapture( NULL, NULL );
if( Text == NULL )
return;
Module = static_cast<MODULE*>( Text->GetParent() );
Text->DrawUmbilical( Panel, DC, GR_XOR, -MoveVector );
Text->Draw( Panel, DC, GR_XOR, MoveVector );
// If the text was moved (the move does not change internal data)
// it could be rotated while moving. So set old value for orientation
if( Text->IsMoving() )
Text->SetTextAngle( TextInitialOrientation );
// Redraw the text
Panel->RefreshDrawingRect( Text->GetBoundingBox() );
// leave it at (0,0) so we can use it Rotate when not moving.
MoveVector.x = MoveVector.y = 0;
Text->ClearFlags();
Module->ClearFlags();
screen->SetCurItem( NULL );
}
示例2: AbortBlockCurrentCommand
void AbortBlockCurrentCommand( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
{
BASE_SCREEN* screen = aPanel->GetScreen();
if( aPanel->IsMouseCaptured() ) // Erase current drawing on screen
{
// Clear block outline.
aPanel->CallMouseCapture( aDC, wxDefaultPosition, false );
aPanel->SetMouseCapture( NULL, NULL );
screen->SetCurItem( NULL );
// Delete the picked wrapper if this is a picked list.
if( screen->m_BlockLocate.GetCommand() != BLOCK_PASTE )
screen->m_BlockLocate.ClearItemsList();
}
screen->m_BlockLocate.SetState( STATE_NO_BLOCK );
screen->m_BlockLocate.SetCommand( BLOCK_ABORT );
aPanel->GetParent()->HandleBlockEnd( aDC );
screen->m_BlockLocate.SetCommand( BLOCK_IDLE );
aPanel->GetParent()->DisplayToolMsg( wxEmptyString );
aPanel->SetCursor( (wxStockCursor) aPanel->GetCurrentCursor() );
}