Skip to main content
Visitor II
March 19, 2025
Question

FlexButton with the Radio Button capability

  • March 19, 2025
  • 2 replies
  • 517 views

Would it be possible to add the Radio Button capability to the Flexbutton? 

2 replies

ST Employee
March 20, 2025

Hello @PSpectrum,

It's supported by changing the trigger type to "toggle", please refer to the documentation Flex Button | TouchGFX Documentation.
There's also an example showing that.

Best regards,

Senior
April 16, 2025

@LouisB, I think PSpectrum means to add FlexButtons to radio groups.

Just tried it now.
I can't "RadioButtonGroup::add()" using a toggle FlexButton.

Senior
April 23, 2025

@GaetanGodart, could I suggest to add a radio "trigger" in FlexButtons?
That way it could be managed by the base class generator.


GaetanGodart
Technical Moderator
April 24, 2025

Hello @Marc_LM ,

 

I don't think that adding a radio trigger to the flexButton would be a good thing.

The flexButton is meant to be use as a standard button but with a more customizable appearance while the radio button has to have 4 different images and each radio button is linked to another.

When changing the trigger type of a flexButton, the number of images on the "icon" visual element is always 2 but it should be 4 for a flexButton with radio trigger and then it should also "be linked" to the other "normal" radio buttons so I don't think this is something that we will implement.

 

Do you have a specific case where you need a flexButton and a radioButton as one button?
Maybe we can try to find a solution together with custom code for that specific use.

 

Regards,

Senior
April 24, 2025

I don't have that issue on my end because the current style I use; Pressing is equivalent to Selected.
But I do see the point that full implementation would require *RadioStyle for Text, Image and Icons.

I added my modifications to the library here for posterity.

""
Do you have a specific case where you need a flexButton and a radioButton as one button?
""
I need a radio button with text.

(I can't see the zipfiles I attached)