本文整理汇总了C++中MgCommand::touchBegan方法的典型用法代码示例。如果您正苦于以下问题:C++ MgCommand::touchBegan方法的具体用法?C++ MgCommand::touchBegan怎么用?C++ MgCommand::touchBegan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MgCommand
的用法示例。
在下文中一共展示了MgCommand::touchBegan方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMouseMove
void CDrawShapeView::OnMouseMove(UINT nFlags, CPoint point)
{
CBaseView::OnMouseMove(nFlags, point);
MgCommand* cmd = mgGetCommandManager()->getCommand();
m_proxy->motion.dragging = (!m_delayUp && (nFlags & MK_LBUTTON)
&& (m_downFlags & MK_LBUTTON));
if (m_proxy->motion.dragging)
{
m_proxy->motion.point = Point2d((float)point.x, (float)point.y);
m_proxy->motion.pointM = m_proxy->motion.point * m_graph->xf.displayToModel();
if (!m_moved && mgHypot(m_proxy->motion.point.x - m_proxy->motion.startPoint.x,
m_proxy->motion.point.y - m_proxy->motion.startPoint.y) > 5)
{
m_moved = TRUE;
if (cmd) cmd->touchBegan(&m_proxy->motion);
}
else if (m_moved)
{
if (cmd) cmd->touchMoved(&m_proxy->motion);
}
m_proxy->motion.lastPoint = m_proxy->motion.point;
m_proxy->motion.lastPointM = m_proxy->motion.pointM;
}
else if (cmd && !(nFlags & MK_LBUTTON))
{
cmd->mouseHover(&m_proxy->motion);
}
}
示例2: touchBegan
bool TransformCmd::touchBegan(const MgMotion* sender)
{
for (_ptIndex = 2; _ptIndex >= 0; _ptIndex--) {
if (sender->view->xform()->displayToModel(5, true)
> sender->pointM.distanceTo(getPointM(_ptIndex, sender))) {
break;
}
}
return _ptIndex >= 0 || (_lastCmd && _lastCmd->touchBegan(sender));
}
示例3: gestureToCommand
bool GiCoreViewImpl::gestureToCommand(const MgMotion& motion)
{
MgDynShapeLock locker(true, motion.view);
MgCommand* cmd = _cmds->getCommand();
bool ret = false;
if (motion.gestureState == kMgGestureCancel || !cmd) {
return cmd && cmd->cancel(&motion);
}
if (motion.gestureState == kMgGesturePossible
&& motion.gestureType != kGiTwoFingersMove) {
return true;
}
switch (motion.gestureType)
{
case kGiTwoFingersMove:
ret = cmd->twoFingersMove(&motion);
break;
case kGiGesturePan:
switch (motion.gestureState)
{
case kMgGestureBegan:
ret = cmd->touchBegan(&motion);
break;
case kMgGestureMoved:
ret = cmd->touchMoved(&motion);
break;
case kMgGestureEnded:
default:
ret = cmd->touchEnded(&motion);
break;
}
break;
case kGiGestureTap:
ret = cmd->click(&motion);
break;
case kGiGestureDblTap:
ret = cmd->doubleClick(&motion);
break;
case kGiGesturePress:
ret = cmd->longPress(&motion);
break;
}
if (!ret) {
LOGD("The current command (%s) don't support #%d gesture (state=%d)",
cmd->getName(), motion.gestureType, motion.gestureState);
}
return ret;
}