2019-06-07 05:38 AM
Hi,
I want to make a screen transition by hardware button,
i tried to make a screen transition by TouchGFX Designer Interactions and that works fine.
But i have no idea how to make the same transition, using hardware button.
I found an example like this:
in FrontendApplication.cpp
void FrontendApplication::gotoScreen1Custom()
{
customTransitionCallback = touchgfx::Callback< FrontendApplication >(this, &FrontendApplication::gotoScreen1CustomImpl);
pendingScreenTransitionCallback = &customTransitionCallback;
}
void FrontendApplication::gotoScreen1CustomImpl()
{
makeTransition<Screen1View, Screen1Presenter, touchgfx::SlideTransition<EAST>, Model >(¤tScreen, ¤tPresenter, frontendHeap, ¤tTransition, &model);
}
and in Screen2View.cpp need to call
application().gotoScreen1Custom();
Update1:
The problem is that i can not call
application().gotoScreen1Custom();
in my function,
BUT, if i call it in virtual function
void MainScreenView::handleTickEvent(){}
it works.
I guess the problem is in my knowledge of C++ classes,
could you help me to run the function from my own function
Thank you
Anton
2019-06-11 12:28 AM
Hi,
If you're trying to transition from e.g. a presenter/view, try executing the following instead:
static_cast<FrontendApplication*>(Application::getInstance())->gotoMyScreen();
/Martin