Creating screen transition in FrontendApplication.cpp
Hello, I am having some difficulty implementing a screen transition. I have followed along this thread, but it seems there are some underlying issues with MVPApplication that are not allowing a template arguments to deduced/substituted.
Versions:
TouchGFX 4.13.0
STM32CubeIDE 1.2.0
I have a screen transition that I created from within TouchGFX Designer that works perfectly fine, but it requires me to have a button that I don't actually need on the screen. I would like to create my own screen transition that I can use from code. So I used the TouchGFX Desginer generated code as a template, and then deleted the interaction in TouchGFX Designer once I had copied the code.
What I have so far...
If my FrontendApplication.cpp file I have added this code:
#include <mvp/MVPApplication.hpp>
#include <gui/datetime_screen/DateTimeView.hpp>
#include <gui/datetime_screen/DateTimePresenter.hpp>
void FrontendApplication::gotoDateTimeScreenSlideTransitionEast()
{
transitionCallbackTwo = touchgfx::Callback<FrontendApplication>(this, &FrontendApplication::gotoDateTimeScreenSlideTransitionEastImpl);
pendingScreenTransitionCallback = &transitionCallbackTwo;
}
void FrontendApplication::gotoDateTimeScreenSlideTransitionEastImpl()
{
touchgfx::makeTransition<DateTimeView, DateTimePresenter, touchgfx::SlideTransition<EAST>, Model >(¤tScreen, ¤tPresenter, frontendHeap, ¤tTransition, &model);
}Now when I compile the code I get the following errors:
In file included from ../TouchGFX/generated/gui_generated/include/gui_generated/common/FrontendApplicationBase.hpp:7:0,
from ../TouchGFX/gui/include/gui/common/FrontendApplication.hpp:4,
from ../TouchGFX/gui/src/common/FrontendApplication.cpp:1:
../Middlewares/ST/touchgfx/framework/include/mvp/MVPApplication.hpp:192:16: note: candidate: template<class ScreenType, class PresenterType, class TransType, class ModelType> PresenterType* touchgfx::makeTransition(touchgfx::Screen**, touchgfx::Presenter**, touchgfx::MVPHeap&, touchgfx::Transition**, ModelType*)
PresenterType* makeTransition(Screen** currentScreen, Presenter** currentPresenter, MVPHeap& heap, Transition** currentTrans, ModelType* model)
^~~~~~~~~~~~~~
../Middlewares/ST/touchgfx/framework/include/mvp/MVPApplication.hpp:192:16: note: template argument deduction/substitution failed:
../TouchGFX/gui/src/common/FrontendApplication.cpp:121:139: note: cannot convert '((FrontendApplication*)this)->FrontendApplication::<anonymous>.FrontendApplicationBase::frontendHeap' (type 'FrontendHeap') to type 'touchgfx::MVPHeap&'
touchgfx::makeTransition<DateTimeView, DateTimePresenter, touchgfx::SlideTransition<EAST>, Model >(¤tScreen, ¤tPresenter, frontendHeap, ¤tTransition, &model);
^~~~~~~~~~~~
make[1]: *** [TouchGFX/gui/src/common/subdir.mk:18: TouchGFX/gui/src/common/FrontendApplication.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [makefile:105: all] Error 2
"make -j all" terminated with exit code 2. Build might be incomplete.