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


C++ Frame::GetFrameAnimator方法代码示例

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


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

示例1: OnFormBackRequested

void ItemForm::OnFormBackRequested(Osp::Ui::Controls::Form & source) {
	AppLog("OnFormBackRequested()");
	Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();

	MainForm * pForm = static_cast<MainForm*> (pFrame->GetControl(kMainFormNameString));
/*
    pFrame->SetCurrentForm(*pForm);
    pForm->Draw();
    pForm->Show();
*/

	FrameAnimator * pAnimator = pFrame->GetFrameAnimator();
	pAnimator->SetFormTransitionAnimation(FRAME_ANIMATOR_FORM_TRANSITION_ANIMATION_TRANSLATE_RIGHT,
			                              800,
			                              ANIMATION_INTERPOLATOR_EASE_IN_OUT);

	pAnimator->SetCurrentForm(*pForm);

}
开发者ID:drstrangecode,项目名称:Bada_RssReader_DrStrangecode,代码行数:19,代码来源:ItemForm.cpp

示例2: OnUserEventReceivedN

void FormNavigationManager::OnUserEventReceivedN(RequestId requestId,
		IList* pArgs) {

	switch (requestId) {
	case SET_ROOT_FORM: {
		AppLog("FormNavigationManager: setting root form");

		AppAssertf(NumberOfFormsInCurrentStack() == 0, "This navigation stack has already a root form");

		Frame * pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();

		StackBasedNavigationForm * nextForm = static_cast<StackBasedNavigationForm *> (pArgs->GetAt(0));

		// Add new form in the stack
		_currentFormsStack.Add(*nextForm);
		// Add new form on display, the form is automatically set as the current form
		pFrame->AddControl(*nextForm);
		// Call FormWillAppear() on the root form
		nextForm->FormWillAppear();
		// Show new form
		nextForm->Draw();
		nextForm->Show();

		delete pArgs;
	}
		break;

	case PUSH_FORM: {
		AppLog("FormNavigationManager: pushing form");

		AppAssertf(NumberOfFormsInCurrentStack() > 0, "This navigation stack has no root form, please set a root form with SetRootForm()");

		StackBasedNavigationForm * nextForm = static_cast<StackBasedNavigationForm *> (pArgs->GetAt(0));
		StackBasedNavigationForm * currentForm = static_cast<StackBasedNavigationForm *> (_currentFormsStack.GetAt(_currentFormsStack.GetCount() - 1));

		Frame * pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();

		// Call FormWillDisappear() on the old form
		currentForm->FormWillDisappear();
		// Add new form in the stack
		_currentFormsStack.Add(*nextForm);
		// Add new form on display, nextForm becomes the current form
		pFrame->AddControl(*nextForm);
		// Re-set currentForm as the current form so we can perform a nice animation
		pFrame->SetCurrentForm(*currentForm);
		// Call FormWillAppear() on the new form
		nextForm->FormWillAppear();

		// Perform the transition with a nice slide-in animation
		FrameAnimator * pAnimator = pFrame->GetFrameAnimator();
		pAnimator->SetFormTransitionAnimation(
				FRAME_ANIMATOR_FORM_TRANSITION_ANIMATION_TRANSLATE_LEFT, 600,
				ANIMATION_INTERPOLATOR_EASE_IN_OUT);

		pAnimator->SetCurrentForm(*nextForm);

		delete pArgs;
	}
		break;

	case POP_FORM: {
		AppLog("FormNavigationManager: popping form");

		AppAssertf(NumberOfFormsInCurrentStack() > 0, "This navigation stack has no root form, please set a root form with SetRootForm()");

		Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();

		AppAssertf(_currentFormsStack.GetCount() > 1, "Illegal: Trying to pop the root form");

		StackBasedNavigationForm * previousForm = static_cast<StackBasedNavigationForm *> (_currentFormsStack.GetAt(_currentFormsStack.GetCount() - 2));
		StackBasedNavigationForm * currentForm = static_cast<StackBasedNavigationForm *> (_currentFormsStack.GetAt(_currentFormsStack.GetCount() - 1));

		// Call FormWillDisappear() on the current form
		currentForm->FormWillDisappear();
		// Call FormWillAppear() on the previous form
		previousForm->FormWillAppear();

		// Perform the transition with a nice slide-out animation
		FrameAnimator * pAnimator = pFrame->GetFrameAnimator();
		pAnimator->SetFormTransitionAnimation(
				FRAME_ANIMATOR_FORM_TRANSITION_ANIMATION_TRANSLATE_RIGHT, 600,
				ANIMATION_INTERPOLATOR_EASE_IN_OUT);

		pAnimator->SetCurrentForm(*previousForm);

		pFrame->RemoveControl(*currentForm);
		_currentFormsStack.RemoveAt(_currentFormsStack.GetCount() - 1, false);

	}
		break;
	}
}
开发者ID:drstrangecode,项目名称:Bada_Utility_Library,代码行数:92,代码来源:FormNavigationManager.cpp


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