本文整理汇总了C++中FV_View::cmdScroll方法的典型用法代码示例。如果您正苦于以下问题:C++ FV_View::cmdScroll方法的具体用法?C++ FV_View::cmdScroll怎么用?C++ FV_View::cmdScroll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FV_View
的用法示例。
在下文中一共展示了FV_View::cmdScroll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _actuallyScroll
void FV_VisualDragText::_actuallyScroll(UT_Worker * pWorker)
{
UT_return_if_fail(pWorker);
// this is a static callback method and does not have a 'this' pointer.
FV_VisualDragText * pVis = static_cast<FV_VisualDragText *>(pWorker->getInstanceData());
UT_return_if_fail(pVis);
FV_View * pView = pVis->m_pView;
pVis->getGraphics()->setClipRect(&pVis->m_recCurFrame);
pView->updateScreen(false);
pView->getGraphics()->setClipRect(NULL);
bool bScrollDown = false;
bool bScrollUp = false;
bool bScrollLeft = false;
bool bScrollRight = false;
UT_sint32 y = pVis->m_yLastMouse;
UT_sint32 x = pVis->m_xLastMouse;
if(y<=0)
{
bScrollUp = true;
}
else if(y >= pView->getWindowHeight())
{
bScrollDown = true;
}
if(x <= 0)
{
bScrollLeft = true;
}
else if(x >= pView->getWindowWidth())
{
bScrollRight = true;
}
if(bScrollDown || bScrollUp || bScrollLeft || bScrollRight)
{
UT_sint32 minScroll = pView->getGraphics()->tlu(20);
if(bScrollUp)
{
UT_sint32 yscroll = abs(y);
if(yscroll < minScroll)
yscroll = minScroll;
pView->cmdScroll(AV_SCROLLCMD_LINEUP, static_cast<UT_uint32>( yscroll) + iExtra);
}
else if(bScrollDown)
{
UT_sint32 yscroll = y - pView->getWindowHeight();
if(yscroll < minScroll)
yscroll = minScroll;
pView->cmdScroll(AV_SCROLLCMD_LINEDOWN, static_cast<UT_uint32>(yscroll) + iExtra);
}
if(bScrollLeft)
{
pView->cmdScroll(AV_SCROLLCMD_LINELEFT, static_cast<UT_uint32>(-x));
}
else if(bScrollRight)
{
pView->cmdScroll(AV_SCROLLCMD_LINERIGHT, static_cast<UT_uint32>(x -pView->getWindowWidth()));
}
pVis->drawImage();
#if 0
PT_DocPosition posAtXY = pVis->getPosFromXY(x,y);
pView->_setPoint(posAtXY);
pVis->drawCursor(posAtXY);
#endif
iExtra = 0;
return;
}
else
{
if(pVis->m_pAutoScrollTimer)
pVis->m_pAutoScrollTimer->stop();
DELETEP(pVis->m_pAutoScrollTimer);
}
s_pScroll->stop();
delete s_pScroll;
s_pScroll = NULL;
bScrollRunning = false;
iExtra = 0;
}