Skip to main content
Giovanni Cambareri
Associate II
December 21, 2020
Solved

Is there a simple way, without creating a custom Swipe container, to get the page of the Swipe Container?

  • December 21, 2020
  • 5 replies
  • 1646 views

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

This topic has been closed for replies.
Best answer by Alexandre RENOUX

Hello GC2,

A new version of TouchGFX is available (4.16). In this version, the getSelectedPage() is implemented. You can download it from this link : https://my.st.com/content/my_st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-configurators-and-code-generators/touchgfxdesigner.html

When your question is answered, please close this topic by choosing Select as Best.

/Alexandre

5 replies

Alexandre RENOUX
Alexandre RENOUXBest answer
Visitor II
December 22, 2020

Hello GC2,

A new version of TouchGFX is available (4.16). In this version, the getSelectedPage() is implemented. You can download it from this link : https://my.st.com/content/my_st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-configurators-and-code-generators/touchgfxdesigner.html

When your question is answered, please close this topic by choosing Select as Best.

/Alexandre

Giovanni Cambareri
Associate II
December 22, 2020

Anyway, the getSelectedPage works! Thanks a lot.

I wait for the answer of the other problem and then I will close the topic by choosing Select as best!

Giovanni Cambareri
Associate II
December 22, 2020

Hi, thanks for the informations. I've just updated my touchGFX version and try to compile it....if I run target from the designer is ok, but if i try to build from the IDE I got this error:

arm-none-eabi-g++ -o "STM32H735G-DK.elf" @"objects.list" -l:libtouchgfx-float-abi-hard.a -mcpu=cortex-m7 -T"C:\.........\STM32H735IGKX_FLASH.ld" --specs=nosys.specs -Wl,-Map="STM32H735G-DK.map" -Wl,--gc-sections -static -LC:/........../Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc -LC:/.........../Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc -LC:/................../Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc -LC:/.........../Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc -LC:.........../Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc -LC:/.............../Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc -LC:/............./Middlewares/ST/touchgfx/lib/core/cortex_m7/gcc --specs=nano.specs -mfpu=fpv5-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -lstdc++ -lsupc++ -Wl,--end-group

Application/User/generated/Screen00ViewBase.o:(.rodata._ZTVN8touchgfx12MoveAnimatorINS_11AnalogClockEEE[_ZTVN8touchgfx12MoveAnimatorINS_11AnalogClockEEE]+0xcc): undefined reference to `touchgfx::AnalogClock::setAlpha(unsigned char)'

Application/User/generated/Screen00ViewBase.o:(.rodata._ZTVN8touchgfx12MoveAnimatorINS_11AnalogClockEEE[_ZTVN8touchgfx12MoveAnimatorINS_11AnalogClockEEE]+0xd0): undefined reference to `touchgfx::AnalogClock::getAlpha() const'

collect2.exe: error: ld returned 1 exit status

make: *** [makefile:77: STM32H735G-DK.elf] Error 1

"make -j8 all" terminated with exit code 2. Build might be incomplete.

08:48:31 Build Failed. 1 errors, 0 warnings. (took 19s.738ms)

I'm using:

touchGFX 4.16.0 (just updated)

CubeProgrammer 2.5.0

STM32CubeMx 6.1.0

STM32CubeIDE 1.4.0

Alexandre RENOUX
Visitor II
December 23, 2020

Hello GC2,

It says setAlpha() and getAlpha() are undefined. These 2 functions were added to the AnalogClock in 4.16. In 4.15 they didn't exist.

You updated TouchGFX Designer to 4.16 but have you also updated TouchGFX Generator in CubeMX ? The version must be also 4.16 in CubeMX otherwise you will have incompatibilities.

/Alexandre

Giovanni Cambareri
Associate II
December 23, 2020

Hi,

yes I've already done it before the last message.

The steps I've done were:

  1. Update touchGFX version to 4.16
  2. Try to run target from the desginer (it worked)
  3. Open CubeMX , update touchGFX, generate code
  4. Try to compile from IDE (got errors)