本文整理汇总了C++中DocView::GetClickWorkCoord方法的典型用法代码示例。如果您正苦于以下问题:C++ DocView::GetClickWorkCoord方法的具体用法?C++ DocView::GetClickWorkCoord怎么用?C++ DocView::GetClickWorkCoord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocView
的用法示例。
在下文中一共展示了DocView::GetClickWorkCoord方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DragPointerMove
void OpPush::DragPointerMove( DocCoord PointerPos, ClickModifiers ClickMods, Spread *, BOOL bSolidDrag)
{
DocView* pDocView = DocView::GetSelected();
ENSURE( pDocView != NULL, "OpPush::DragPointerMove - DocView was NULL" );
if (pDocView==NULL)
return;
// Declare a few WorkCoords we will need
WorkCoord ScrollOffsets;
WorkCoord Change;
WorkCoord MoveClick = pDocView->GetClickWorkCoord();
// How Much has it changed
Change.x = AnchorPoint.x - MoveClick.x;
Change.y = AnchorPoint.y - MoveClick.y;
// Find the Scroll Offsets and change them
ScrollOffsets = pDocView->GetScrollOffsets();
ScrollOffsets.x += Change.x;
ScrollOffsets.y += Change.y;
// Make sure the ScrollOffsets are valid and then set them
if ( ScrollOffsets.x < 0 ) ScrollOffsets.x = 0;
if ( ScrollOffsets.y > 0 ) ScrollOffsets.y = 0;
pDocView->SetScrollOffsets( ScrollOffsets, TRUE );
}