本文整理汇总了C++中CAViewController::getView方法的典型用法代码示例。如果您正苦于以下问题:C++ CAViewController::getView方法的具体用法?C++ CAViewController::getView怎么用?C++ CAViewController::getView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAViewController
的用法示例。
在下文中一共展示了CAViewController::getView方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pushViewControllerFinish
void CANavigationController::pushViewControllerFinish()
{
CAViewController* viewController = m_pViewControllers.back();
if (viewController->getNavigationBarItem() == NULL && viewController->getTitle().compare("") != 0)
{
viewController->setNavigationBarItem(CANavigationBarItem::create(viewController->getTitle()));
}
m_pNavigationBar->pushItem(viewController->getNavigationBarItem());
viewController->getView()->setFrameOrigin(CCPointZero);
CAViewController* lastViewController = m_pViewControllers.at(m_pViewControllers.size() - 2);
lastViewController->getView()->setFrameOrigin(CCPointZero);
lastViewController->getView()->setVisible(false);
lastViewController->viewDidDisappear();
}
示例2: 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);
}
}
示例3: pushViewControllerFinish
void CANavigationController::pushViewControllerFinish()
{
m_pContainer->setFrame(CCRect(0, m_pContainer->getFrame().origin.y, 0, 0));
CAViewController* lastViewController = m_pViewControllers.at(m_pViewControllers.size() - 2);
lastViewController->getView()->removeFromSuperview();
}
示例4: replaceViewController
void CANavigationController::replaceViewController(CrossApp::CAViewController *viewController, bool animated)
{
if (this->getView()->getSuperview() == NULL)
{
return;
}
if (m_pContainer->getActionByTag(0))
{
return;
}
float x = m_pContainer->getFrame().size.width;
CAViewController* lastViewController = m_pViewControllers.back();
viewController->m_pNavigationController = this;
m_pViewControllers.insert(m_pViewControllers.size()-1, viewController);
viewController->addViewFromSuperview(m_pContainer);
viewController->viewDidDisappear();
viewController->getView()->setFrameOrigin(CCPoint(x, 0));
if (animated)
{
CCSequence* actionsLast =
CCSequence::create(
CCDelayTime::create(0.03f),
CCEaseSineOut::create(CCFrameOrginTo::create(0.25f, CCPoint(-x/2.0f, 0))),
NULL);
lastViewController->getView()->runAction(actionsLast);
CCSequence* actions =
CCSequence::create(
CCCallFunc::create(CAApplication::getApplication()->getTouchDispatcher(), callfunc_selector(CATouchDispatcher::setDispatchEventsFalse)),
CCDelayTime::create(0.02f),
CCEaseSineOut::create(CCFrameOrginTo::create(0.25f, CCPointZero)),
CCCallFunc::create(this, callfunc_selector(CANavigationController::replaceViewControllerFinish)),
CCCallFunc::create(CAApplication::getApplication()->getTouchDispatcher(),callfunc_selector(CATouchDispatcher::setDispatchEventsTrue)),
NULL);
viewController->getView()->runAction(actions);
}
else
{
this->replaceViewControllerFinish();
}
}
示例5: popViewControllerAnimated
CAViewController* CANavigationController::popViewControllerAnimated(bool animated)
{
if (m_pViewControllers.size() == 1)
{
return NULL;
}
if (m_pContainer->getActionByTag(0))
{
return NULL;
}
unsigned int index = m_pViewControllers.size() - 2;
CAViewController* showViewController = m_pViewControllers.at(index);
showViewController->getView()->setFrame(CCRectZero);
m_pContainer->addSubview(showViewController->getView());
CAViewController* backViewController = m_pViewControllers.back();
float x = m_pContainer->getFrame().size.width;
backViewController->getView()->setFrame(CCRect(x, 0, 0, 0));
if (animated)
{
m_pContainer->stopAllActions();
m_pContainer->setFrameOrigin(CCPoint(-x, m_pContainer->getFrameOrigin().y));
CCDelayTime* delayTime = CCDelayTime::create(0.2f);
CCFrameOrginTo* moveTo = CCFrameOrginTo::create(0.4f, CCPoint(0, m_pContainer->getFrameOrigin().y));
CCEaseSineOut* easeBack = CCEaseSineOut::create(moveTo);
CCCallFunc* finish = CCCallFunc::create(this, callfunc_selector(CANavigationController::popViewControllerFinish));
CCSequence* actions = CCSequence::create(delayTime, easeBack, finish, NULL);
m_pContainer->runAction(actions);
actions->setTag(0);
}
else
{
this->popViewControllerFinish();
}
return backViewController;
}
示例6: popViewControllerFinish
void CANavigationController::popViewControllerFinish()
{
CAViewController* lastViewController = m_pViewControllers.back();
lastViewController->viewDidDisappear();
lastViewController->m_pNavigationController = NULL;
lastViewController->removeViewFromSuperview();
lastViewController->retain()->autorelease();
m_pViewControllers.popBack();
m_pNavigationBar->popItem();
CAViewController* showViewController = m_pViewControllers.back();
showViewController->getView()->setFrameOrigin(CCPointZero);
}
示例7: pushViewControllerFinish
void CANavigationController::pushViewControllerFinish()
{
m_pContainer->setFrame(CCRect(0, m_pContainer->getFrame().origin.y, 0, 0));
CAViewController* viewController = m_pViewControllers.back();
if (viewController->getNavigationBarItem() == NULL && viewController->getTitle().compare("") != 0)
{
viewController->setNavigationBarItem(CANavigationBarItem::create(viewController->getTitle()));
}
m_pNavigationBar->pushItem(viewController->getNavigationBarItem());
CAViewController* lastViewController = m_pViewControllers.at(m_pViewControllers.size() - 2);
lastViewController->getView()->removeFromSuperview();
}
示例8: replaceViewControllerFinish
void CANavigationController::replaceViewControllerFinish()
{
CAViewController* lastViewController = m_pViewControllers.back();
lastViewController->retain()->autorelease();
m_pViewControllers.popBack();
m_pNavigationBar->popItem();
lastViewController->viewDidDisappear();
lastViewController->removeViewFromSuperview();
CAViewController* viewController = m_pViewControllers.back();
viewController->getView()->setFrameOrigin(CCPointZero);
if (viewController->getNavigationBarItem() == NULL && viewController->getTitle().compare("") != 0)
{
viewController->setNavigationBarItem(CANavigationBarItem::create(viewController->getTitle()));
}
m_pNavigationBar->pushItem(viewController->getNavigationBarItem());
}
示例9: pushViewController
void CANavigationController::pushViewController(CAViewController* viewController, bool animated)
{
if (this->getView()->getSuperview() == NULL)
{
return;
}
if (m_pContainer->getActionByTag(0))
{
return;
}
float x = m_pContainer->getFrame().size.width;
CAViewController* lastViewController = m_pViewControllers.back();
lastViewController->getView()->setFrame(CCRect(-x, 0, 0, 0));
viewController->retain();
viewController->m_pNavigationController = this;
m_pViewControllers.push_back(viewController);
if (viewController->getNavigationBarItem() == NULL && viewController->getTitle().compare("") != 0)
{
viewController->setNavigationBarItem(CANavigationBarItem::create(viewController->getTitle()));
}
m_pNavigationBar->pushItem(viewController->getNavigationBarItem());
viewController->addViewFromSuperview(m_pContainer);
if (animated)
{
m_pContainer->stopAllActions();
m_pContainer->setFrame(CCRect(x, m_pContainer->getFrame().origin.y, 0, 0));
CCDelayTime* delayTime = CCDelayTime::create(0.1f);
CCMoveBy* moveBy = CCMoveBy::create(0.3f, CCPoint(-x, 0));
CCEaseSineOut* easeBack = CCEaseSineOut::create(moveBy);
CCCallFunc* finish = CCCallFunc::create(this, callfunc_selector(CANavigationController::pushViewControllerFinish));
CCSequence* actions = CCSequence::create(delayTime, easeBack, finish, NULL);
m_pContainer->runAction(actions);
actions->setTag(0);
}
else
{
this->pushViewControllerFinish();
}
}
示例10: replaceViewController
void CANavigationController::replaceViewController(CrossApp::CAViewController *viewController, bool animated)
{
if (this->getView()->getSuperview() == NULL)
{
return;
}
if (m_pContainer->getActionByTag(0))
{
return;
}
float x = m_pContainer->getFrame().size.width;
CAViewController* lastViewController = m_pViewControllers.back();
lastViewController->getView()->setFrame(CCRect(-x, 0, 0, 0));
viewController->retain();
viewController->m_pNavigationController = this;
m_pViewControllers.insert(m_pViewControllers.end()-1, viewController);
viewController->addViewFromSuperview(m_pContainer);
if (animated)
{
m_pContainer->stopAllActions();
m_pContainer->setFrameOrigin(CCPoint(x, m_pContainer->getFrameOrigin().y));
CCDelayTime* delayTime = CCDelayTime::create(0.5f);
CCFrameOrginTo* moveTo = CCFrameOrginTo::create(0.4f, CCPoint(0, m_pContainer->getFrameOrigin().y));
CCEaseSineOut* easeBack = CCEaseSineOut::create(moveTo);
CCCallFunc* finish = CCCallFunc::create(this, callfunc_selector(CANavigationController::replaceViewControllerFinish));
CCSequence* actions = CCSequence::create(delayTime, easeBack, finish, NULL);
m_pContainer->runAction(actions);
actions->setTag(0);
}
else
{
this->replaceViewControllerFinish();
}
}
示例11: 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;
}