本文整理汇总了C++中kigfx::VIEW_CONTROLS::WarpCursor方法的典型用法代码示例。如果您正苦于以下问题:C++ VIEW_CONTROLS::WarpCursor方法的具体用法?C++ VIEW_CONTROLS::WarpCursor怎么用?C++ VIEW_CONTROLS::WarpCursor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kigfx::VIEW_CONTROLS
的用法示例。
在下文中一共展示了VIEW_CONTROLS::WarpCursor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Main
//.........这里部分代码省略.........
if( selection.Empty() )
break;
// deal with locked items (override lock or abort the operation)
SELECTION_LOCK_FLAGS lockFlags = m_selectionTool->CheckLock();
if( lockFlags == SELECTION_LOCKED )
break;
else if( lockFlags == SELECTION_LOCK_OVERRIDE )
lockOverride = true;
// Save items, so changes can be undone
if( !isUndoInhibited() )
{
editFrame->OnModify();
editFrame->SaveCopyInUndoList( selection.items, UR_CHANGED );
}
m_cursor = controls->GetCursorPosition();
if( selection.Size() == 1 )
{
// Set the current cursor position to the first dragged item origin, so the
// movement vector could be computed later
m_cursor = grid.BestDragOrigin( originalCursorPos, item );
grid.SetAuxAxes( true, m_cursor );
}
else
{
m_cursor = grid.Align( m_cursor );
}
controls->ForceCursorPosition( true, m_cursor );
controls->WarpCursor( m_cursor, true );
VECTOR2I o = VECTOR2I( item->GetPosition() );
m_offset.x = o.x - m_cursor.x;
m_offset.y = o.y - m_cursor.y;
controls->SetAutoPan( true );
m_dragging = true;
incUndoInhibit();
}
}
selection.group->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
m_toolMgr->RunAction( COMMON_ACTIONS::pointEditorUpdate, true );
}
// Dispatch TOOL_ACTIONs
else if( evt->Category() == TC_COMMAND )
{
if( evt->IsAction( &COMMON_ACTIONS::rotate ) )
{
Rotate( aEvent );
}
else if( evt->IsAction( &COMMON_ACTIONS::flip ) )
{
Flip( aEvent );
// Flip causes change of layers
enableUpdateFlag( KIGFX::VIEW_ITEM::LAYERS );
}
else if( evt->IsAction( &COMMON_ACTIONS::remove ) )
{
Remove( aEvent );