2024-05-01 03:22 PM - edited 2024-05-01 03:36 PM
Hello, I try to do my own keyboard.
My idea: when click on shift button (red a, btnShift) i want replace big letters with small. All buttons are FlexButton
Can I use the Action Execute C++ code ?
like this:
btnA.setText(TypedText('a'));
but not woking now :(
Solved! Go to Solution.
2024-05-01 09:17 PM
Hello, Schamann.
To change the button text, you can use text resources to switch original texts to new texts.
This can be done by setting up wildcards and text resources.
If you want to change your text, you should open up your project and manually change the wildcard content.
In this way you'll be able to fix that bug.
If you find my answer useful, it'll be nice of you to click on "accept as solution".
Good luck.
Nathan Xi
2024-05-01 09:17 PM
Hello, Schamann.
To change the button text, you can use text resources to switch original texts to new texts.
This can be done by setting up wildcards and text resources.
If you want to change your text, you should open up your project and manually change the wildcard content.
In this way you'll be able to fix that bug.
If you find my answer useful, it'll be nice of you to click on "accept as solution".
Good luck.
Nathan Xi
2024-05-02 05:27 AM - edited 2024-05-02 05:30 AM
Hello @Schamann ,
As our friend @Nathan_Xi mentioned, the easiest way would be to define all the texts that you want to use in your GUI inside the TouchGFX Designer -> Texts. And also set the characters you want to use inside the wildcard range.
Afterward, in your code you need to include texts/TextKeysAndLanguages.hpp, then you can use the function you mentioned to change the label of the flex button. Keep in mind that you need to provide the ID that you assigned to your text inside TypedText().
It would look something like this:
//Inside your ScreenView.cpp
#include <texts/TextKeysAndLanguages.hpp>
//An interaction set inside the designer for a button click
void ScreenView::changeLetterToSmall()
{
btnA.setText(TypedText(T_SMALL_A));
btnA.invalidateContent();
}
I hope this helps you, don't hesitate to ask more questions
2024-05-03 04:08 AM
Thank you for your replenish to this topic! @Mohammad MORADI ESFAHANIASL
It's essential to make replies comprehensively, and I'll pay attention to that in future replies;).
It's pretty nice of you!
2024-05-03 07:37 AM
Thank you @Nathan_Xi, for participating in the community to make it better every single day. It's lovely to see individuals like you assisting others in achieving their goals.
Wish you the best!