Skip to main content
Visitor II
Question

FlexButton with the Radio Button capability

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

This topic has been closed for replies.

5 replies

ST Employee

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,

Louis BOUDOST Software Engineer | TouchGFX
Senior

@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

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


GaetanGodart
ST Employee

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,

Gaetan GodartSoftware engineer at ST (TouchGFX)
Senior

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)