Ejemplo n.º 1
0
void CDrawShapeView::OnLButtonDblClk(UINT nFlags, CPoint point)
{
    CBaseView::OnLButtonDblClk(nFlags, point);

    m_delayUp = FALSE;
    m_downFlags = 0;

    MgCommand* cmd = mgGetCommandManager()->getCommand();
    if (cmd) cmd->doubleClick(&m_proxy->motion);
}
Ejemplo n.º 2
0
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;
}
Ejemplo n.º 3
0
bool TransformCmd::doubleClick(const MgMotion* sender)
{
    return _lastCmd && _lastCmd->doubleClick(sender);
}