当前位置: 首页>>代码示例>>C++>>正文


C++ CAViewController::getSuperViewRect方法代码示例

本文整理汇总了C++中CAViewController::getSuperViewRect方法的典型用法代码示例。如果您正苦于以下问题:C++ CAViewController::getSuperViewRect方法的具体用法?C++ CAViewController::getSuperViewRect怎么用?C++ CAViewController::getSuperViewRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CAViewController的用法示例。


在下文中一共展示了CAViewController::getSuperViewRect方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: update

void CANavigationController::update(float dt)
{
    CCRect rect = m_pContainer->getFrame();

    switch (m_eNavigationBarVerticalAlignment)
    {
    case CABarVerticalAlignmentTop:
    {
        rect.origin.y = m_pNavigationBar->getFrame().origin.y + m_pNavigationBar->getFrame().size.height;
        rect.size.height = this->getView()->getBounds().size.height - rect.origin.y;
    }
    break;
    case CABarVerticalAlignmentBottom:
    {
        rect.size.height = m_pNavigationBar->getFrame().origin.y;
    }
    break;
    default:
        break;
    }

    m_pContainer->setFrame(rect);

    for (unsigned int i=0; i<m_pViewControllers.size(); i++)
    {
        CAViewController* viewController = m_pViewControllers.at(i);
        rect.origin.x = viewController->getView()->getFrameOrigin().x;
        rect.origin.y = 0;
        viewController->getSuperViewRect(rect);
    }
}
开发者ID:Rogerlin2013,项目名称:CrossApp,代码行数:31,代码来源:CAViewController.cpp

示例2: update

void CATabBarController::update(float dt)
{
    DRect rect = this->getView()->getFrame();
    
    DPoint point = this->getTabBarNowPoint();
    
    switch (m_eTabBarVerticalAlignment)
    {
        case CABarVerticalAlignmentTop:
        {
            rect.origin.y = point.y + m_pTabBar->getFrame().size.height;
            rect.size.height = rect.size.height - rect.origin.y;
        }
            break;
        case CABarVerticalAlignmentBottom:
        {
            rect.size.height = point.y;
        }
            break;
        default:
            break;
    }
    
    m_pTabBar->setFrameOrigin(point);
    m_pContainer->setFrame(rect);
    
    for (size_t i=0; i<m_pViewControllers.size(); i++)
    {
        DRect r = m_pContainer->getSubViewAtIndex((int)i)->getFrame();
        r.size = rect.size;
        m_pContainer->getSubViewAtIndex((int)i)->setFrame(r);
        CAViewController* viewController = m_pViewControllers.at(i);
        viewController->getSuperViewRect(m_pContainer->getBounds());
    }
}
开发者ID:wjm0729,项目名称:CrossApp,代码行数:35,代码来源:CAViewController.cpp

示例3: update

void CANavigationController::update(float dt)
{
    CCRect rect = this->getView()->getBounds();
    
    CCPoint point = this->getNavigationBarNowPoint();

    switch (m_eNavigationBarVerticalAlignment)
    {
        case CABarVerticalAlignmentTop:
        {
            rect.origin.y = point.y + m_tNavigationBarSize.height;
            rect.size.height = rect.size.height - rect.origin.y;
        }
            break;
        case CABarVerticalAlignmentBottom:
        {
            rect.size.height = point.y;
        }
            break;
        default:
            break;
    }
    m_pNavigationBars.back()->setFrameOrigin(point);
    
    CAView* secondContainer = m_pSecondContainers.back();
    CAViewController* viewController = m_pViewControllers.back();
    secondContainer->setFrame(rect);
    viewController->getSuperViewRect(secondContainer->getBounds());
}
开发者ID:Brian1900,项目名称:CrossApp,代码行数:29,代码来源:CAViewController.cpp

示例4: update

void CANavigationController::update(float dt)
{
    CCRect rect = m_pContainer->getFrame();
    
    switch (m_eNavigationBarVerticalAlignment)
    {
        case CABarVerticalAlignmentTop:
        {
            rect.origin.y = m_pNavigationBar->getFrame().origin.y + m_pNavigationBar->getFrame().size.height;
            rect.size.height = this->getView()->getBounds().size.height - rect.origin.y;
        }
            break;
        case CABarVerticalAlignmentBottom:
        {
            rect.size.height = m_pNavigationBar->getFrame().origin.y;
        }
            break;
        default:
            break;
    }
    
    m_pContainer->setFrame(rect);
    
    CAViewController* viewController = m_pViewControllers.back();
    rect.origin = CCPointZero;
    viewController->getSuperViewRect(rect);
}
开发者ID:dlpc,项目名称:CrossApp,代码行数:27,代码来源:CAViewController.cpp

示例5: popToRootViewControllerAnimated

// [email protected]: 2015-03-08
void CANavigationController::popToRootViewControllerAnimated(bool animated)
{
    if (m_pViewControllers.size() == 1)
    {
        return ;
    }
    
    float x = this->getView()->getBounds().size.width;
    
    CAView* backContainer = m_pContainers.back();
    backContainer->setFrameOrigin(DPointZero);
    
    size_t index = 0;
    CAViewController* showViewController = m_pViewControllers.at(index);
    showViewController->viewDidAppear();
    
    CAView* showContainer = m_pContainers.at(index);
    showContainer->setVisible(true);
    showContainer->setFrameOrigin(DPoint(-x/2.0f, 0));
    
    {
        DPoint point = this->getNavigationBarNowPoint(showViewController);
        
        DRect rect = this->getView()->getBounds();
        rect.origin.y = point.y + m_tNavigationBarSize.height;
        rect.size.height = rect.size.height - rect.origin.y;
        m_pNavigationBars.at(index)->setFrameOrigin(point);
        
        CAView* secondContainer = m_pSecondContainers.at(index);
        secondContainer->setFrame(rect);
        
        showViewController->getSuperViewRect(secondContainer->getBounds());
    }
    
    CAApplication::getApplication()->getTouchDispatcher()->setDispatchEventsFalse();
    
    if (animated)
    {
        CAViewAnimation::beginAnimations("", NULL);
        CAViewAnimation::setAnimationDuration(0.25f);
        CAViewAnimation::setAnimationDelay(0.02f);
        CAViewAnimation::setAnimationCurve(CAViewAnimationCurveEaseOut);
        showContainer->setFrameOrigin(DPointZero);
        CAViewAnimation::commitAnimations();
        
        CAViewAnimation::beginAnimations("", NULL);
        CAViewAnimation::setAnimationDuration(0.25f);
        CAViewAnimation::setAnimationDelay(0.03f);
        CAViewAnimation::setAnimationCurve(CAViewAnimationCurveEaseOut);
        CAViewAnimation::setAnimationDidStopSelector(this, CAViewAnimation0_selector(CANavigationController::popToRootViewControllerFinish));
        backContainer->setFrameOrigin(DPoint(x, 0));
        CAViewAnimation::commitAnimations();
    }
    else
    {
        this->popToRootViewControllerFinish();
    }
}
开发者ID:wjm0729,项目名称:CrossApp,代码行数:59,代码来源:CAViewController.cpp

示例6: popViewControllerAnimated

CAViewController* CANavigationController::popViewControllerAnimated(bool animated)
{
    if (m_pViewControllers.size() == 1)
    {
        return NULL;
    }
    
    if (m_pContainer->getActionByTag(0))
    {
        return NULL;
    }
    
    float x = m_pContainer->getFrame().size.width;
    
    unsigned int index = m_pViewControllers.size() - 2;
    CAViewController* showViewController = m_pViewControllers.at(index);
    if (!showViewController->getView()->getBounds().size.equals(m_pContainer->getBounds().size))
    {
        showViewController->getSuperViewRect(m_pContainer->getBounds());
    }
    showViewController->getView()->setFrameOrigin(CCPoint(-x/2.0f, 0));
    showViewController->getView()->setVisible(true);
    showViewController->viewDidAppear();
    
    CAViewController* backViewController = m_pViewControllers.back();
    
    if (animated)
    {
        CCSequence* actionsLast =
        CCSequence::create(
                           CCDelayTime::create(0.02f),
                           
                           CCEaseSineOut::create(CCFrameOrginTo::create(0.25f, CCPointZero)),
                           
                           NULL);
        
        showViewController->getView()->runAction(actionsLast);
        
        
        CCSequence* actions =
        CCSequence::create(
                           CCCallFunc::create(CAApplication::getApplication()->getTouchDispatcher(), callfunc_selector(CATouchDispatcher::setDispatchEventsFalse)),
                           
                           CCDelayTime::create(0.03f),
                           
                           CCEaseSineOut::create(CCFrameOrginTo::create(0.25f, CCPoint(x, 0))),
                           
                           CCCallFunc::create(this, callfunc_selector(CANavigationController::popViewControllerFinish)),
                           
                           CCCallFunc::create(CAApplication::getApplication()->getTouchDispatcher(),callfunc_selector(CATouchDispatcher::setDispatchEventsTrue)),
                           
                           NULL);
        
        backViewController->getView()->runAction(actions);
    }
    else
    {
        this->popViewControllerFinish();
    }
    return backViewController;
}
开发者ID:dlpc,项目名称:CrossApp,代码行数:61,代码来源:CAViewController.cpp

示例7: popViewControllerAnimated

CAViewController* CANavigationController::popViewControllerAnimated(bool animated)
{
    if (m_pViewControllers.size() == 1)
    {
        return NULL;
    }

    float x = this->getView()->getBounds().size.width;
    
    CAViewController* backViewController = m_pViewControllers.back();
    CAView* backContainer = m_pContainers.back();
    {
        backContainer->setFrameOrigin(CCPointZero);
    }
    
    size_t index = m_pViewControllers.size() - 2;
    CAViewController* showViewController = m_pViewControllers.at(index);
    showViewController->viewDidAppear();
    
    CAView* showContainer = m_pContainers.at(index);
    showContainer->setVisible(true);
    
    
    {
        CCRect rect = this->getView()->getBounds();
        
        CCPoint point = this->getNavigationBarNowPoint(showViewController);
        
        switch (m_eNavigationBarVerticalAlignment)
        {
            case CABarVerticalAlignmentTop:
            {
                rect.origin.y = point.y + m_tNavigationBarSize.height;
                rect.size.height = rect.size.height - rect.origin.y;
            }
                break;
            case CABarVerticalAlignmentBottom:
            {
                rect.size.height = point.y;
            }
                break;
            default:
                break;
        }
        m_pNavigationBars.at(index)->setFrameOrigin(point);
        
        CAView* secondContainer = m_pSecondContainers.at(index);
        secondContainer->setFrame(rect);
        
        showViewController->getSuperViewRect(secondContainer->getBounds());
    }
    
    CAApplication::getApplication()->getTouchDispatcher()->setDispatchEventsFalse();
    
    if (animated)
    {
        showContainer->setFrameOrigin(CCPoint(-x/2.0f, 0));
        
        CAViewAnimation::beginAnimations("", NULL);
        CAViewAnimation::setAnimationDuration(0.25f);
        CAViewAnimation::setAnimationDelay(1/30.0f);
        CAViewAnimation::setAnimationCurve(CAViewAnimationCurveEaseOut);
        showContainer->setFrameOrigin(CCPointZero);
        CAViewAnimation::commitAnimations();
        
        CAViewAnimation::beginAnimations("", NULL);
        CAViewAnimation::setAnimationDuration(0.25f);
        CAViewAnimation::setAnimationDelay(1/60.0f);
        CAViewAnimation::setAnimationCurve(CAViewAnimationCurveEaseOut);
        CAViewAnimation::setAnimationDidStopSelector(this, CAViewAnimation0_selector(CANavigationController::popViewControllerFinish));
        backContainer->setFrameOrigin(CCPoint(x, 0));
        CAViewAnimation::commitAnimations();
    }
    else
    {
        this->popViewControllerFinish();
    }
    return backViewController;
}
开发者ID:garyyyy,项目名称:CrossApp,代码行数:79,代码来源:CAViewController.cpp


注:本文中的CAViewController::getSuperViewRect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。