本文整理汇总了C++中BLOCK_SELECTOR::SetOrigin方法的典型用法代码示例。如果您正苦于以下问题:C++ BLOCK_SELECTOR::SetOrigin方法的具体用法?C++ BLOCK_SELECTOR::SetOrigin怎么用?C++ BLOCK_SELECTOR::SetOrigin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLOCK_SELECTOR
的用法示例。
在下文中一共展示了BLOCK_SELECTOR::SetOrigin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleBlockEnd
bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* aDC )
{
int ItemCount = 0;
bool nextCmd = false;
BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;
wxPoint pt;
auto panel =static_cast<SCH_DRAW_PANEL*>(m_canvas);
auto view = panel->GetView();
auto area = view->GetSelectionArea();
auto start = area->GetOrigin();
auto end = area->GetEnd();
block->SetOrigin( wxPoint( start.x, start.y ) );
block->SetEnd( wxPoint( end.x, end.y ) );
view->ShowSelectionArea( false );
view->ClearHiddenFlags();
if( block->GetCount() )
{
BLOCK_STATE_T state = block->GetState();
BLOCK_COMMAND_T command = block->GetCommand();
m_canvas->CallEndMouseCapture( aDC );
block->SetState( state );
block->SetCommand( command );
m_canvas->SetMouseCapture( DrawAndSizingBlockOutlines, AbortBlockCurrentCommand );
if( block->GetCommand() != BLOCK_ABORT
&& block->GetCommand() != BLOCK_DUPLICATE
&& block->GetCommand() != BLOCK_COPY
&& block->GetCommand() != BLOCK_CUT
&& block->GetCommand() != BLOCK_DELETE )
{
SetCrossHairPosition( block->GetEnd() );
m_canvas->MoveCursorToCrossHair();
}
}
if( m_canvas->IsMouseCaptured() )
{
switch( block->GetCommand() )
{
case BLOCK_IDLE:
DisplayError( this, wxT( "Error in HandleBlockPLace" ) );
break;
case BLOCK_DRAG: // Drag
case BLOCK_DRAG_ITEM:
case BLOCK_MOVE: // Move
case BLOCK_DUPLICATE: // Duplicate
if( GetCurPart() )
ItemCount = BlockSelectItems( GetCurPart(), block, m_unit, m_convert, m_syncPinEdit );
if( ItemCount )
{
nextCmd = true;
block->SetState( STATE_BLOCK_MOVE );
if( block->GetCommand() == BLOCK_DUPLICATE )
{
if( block->AppendUndo() )
; // UR_LIBEDIT saves entire state, so no need to append anything more
else
{
SaveCopyInUndoList( GetCurPart(), UR_LIBEDIT );
block->SetAppendUndo();
}
BlockCopySelectedItems( pt, GetCurPart(), block );
block->SetLastCursorPosition( GetCrossHairPosition( true ) );
}
m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines );
m_canvas->CallMouseCapture( aDC, wxDefaultPosition, false );
}
else
{
m_canvas->CallMouseCapture( aDC, wxDefaultPosition, false );
m_canvas->SetMouseCapture( NULL, NULL );
}
break;
case BLOCK_COPY: // Save a copy of items in the clipboard buffer
case BLOCK_CUT:
if( GetCurPart() )
ItemCount = BlockSelectItems( GetCurPart(), block, m_unit, m_convert, m_syncPinEdit );
if( ItemCount )
{
copySelectedItems();
auto cmd = block->GetCommand();
if( cmd == BLOCK_COPY )
{
BlockClearSelectedItems( GetCurPart(), block );
block->ClearItemsList();
//.........这里部分代码省略.........