Is there a simple way, without creating a custom Swipe container, to get the page of the Swipe Container?
Hi,
I've developed a UI with touchGFX where I'm using a swipe container and to finish my application I think I need a way to know the page I was in the Swipe container.
The steps I do are.:
1) in page x of the swipe container i press a button to go to another screen
2) when I'm in the other screen I press a button on a keyboard to come back to the previous screen and I need to come back exactly to the page of the Swipe container I was before.
I've read some discussion on the community about that but If I've understood well, the only way is to add manually a custom container. But I'm at the end of the UI so I would prefer to not follow this way. Is this the only way?
So far I've tried to add this function to SwipeContainer.cpp but I got errrors:
uint8_t SwipeContainer::getSelectedPage()
{
return currentPage;
}
and to SwipeContainer.hpp (in the public part)
uint8_t getSelectedPage();
In the screen where the swipe container is used:
uint8_t Screen01View::SaveCurrentPage()
{
currentPage=SwipeFunction.getSelectedPage();
return currentPage;
}
In the hpp file :
uint8_t SaveCurrentPage();
The error that appears is that one:
Compiling simulator/main.cpp
Linking build/bin/simulator.exe
build/MINGW32_NT-6.2/gui/src/screen01_screen/Screen01View.o: In function `ZN12Screen01View15SaveCurrentPageEv':
C:.......TouchGFX/gui/src/screen01_screen/Screen01View.cpp:581: undefined reference to `touchgfx::SwipeContainer::getSelectedPage()'
collect2.exe: error: ld returned 1 exit status
generated/simulator/gcc/Makefile:154: recipe for target 'build/bin/simulator.exe' failed
make[2]: *** [build/bin/simulator.exe] Error 1
make[1]: *** [generate_assets] Error 2
generated/simulator/gcc/Makefile:149: recipe for target 'generate_assets' failed
simulator/gcc/Makefile:32: recipe for target 'all' failed
make: *** [all] Error 2
Failed
I will be glad if someone could help me,
Thanks
