| 71 | } |
| 72 | |
| 73 | void CAWindow::presentModalViewController(CAViewController* controller, bool animated) |
| 74 | { |
| 75 | CC_RETURN_IF(controller == NULL); |
| 76 | CC_RETURN_IF(m_pModalViewController); |
| 77 | CC_SAFE_RETAIN(controller); |
| 78 | m_pModalViewController = controller; |
| 79 | |
| 80 | m_pModalViewController->addViewFromSuperview(this); |
| 81 | m_pModalViewController->getView()->setZOrder(CAWindowZOderCenter); |
| 82 | m_pModalViewController->viewDidAppear(); |
| 83 | |
| 84 | CAApplication::getApplication()->getTouchDispatcher()->setDispatchEventsFalse(); |
| 85 | if (animated) |
| 86 | { |
| 87 | CAView* view = m_pModalViewController->getView(); |
| 88 | DLayout layout = view->getLayout(); |
| 89 | float y = m_obContentSize.height; |
| 90 | layout.vertical = DVerticalLayout_T_B(y, -y); |
| 91 | view->setLayout(layout); |
| 92 | |
| 93 | CAViewAnimation::beginAnimations("", NULL); |
| 94 | CAViewAnimation::setAnimationDuration(0.25f); |
| 95 | CAViewAnimation::setAnimationDelay(0.1f); |
| 96 | CAViewAnimation::setAnimationCurve(CAViewAnimationCurveLinear); |
| 97 | CAViewAnimation::setAnimationDidStopSelector(this, CAViewAnimation0_selector(CAWindow::presentEnd)); |
| 98 | view->setLayout(DLayoutFill); |
| 99 | CAViewAnimation::commitAnimations(); |
| 100 | } |
| 101 | else |
| 102 | { |
| 103 | this->presentEnd(); |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | void CAWindow::presentEnd() |
| 108 | { |
no test coverage detected