2021-02-12 01:14 PM
Hi All,
is it possibile to change a FlexButton Trigegr from code?
I would like to change from toggle to click and viceversa.
Has someone some hints?
thank's in advance
2021-02-22 12:06 AM
Hello MPast.1,
One idea would be to create your own button widget. Note that this means you will not be able to see it in the Designer.
In the end you would declare your flexButton in your View header file like something as follows
touchgfx::ImageButtonStyle< touchgfx::CustomButtonTrigger > myFlexButton;
You create this CustomButtonTrigger class that will behave like ToggleButtonTrigger or ClickButtonTrigger according to some input. (Your class will inherit AbstractButtonContainer like in the ToggleButtonTrigger and ClickButtonTrigger class).
Or you can completely recreate a Button based on the Button classes to have all the features you want in a single class. Your choice ;)
/Alexandre
2021-02-25 12:51 PM
Hi Alexander,
thank you for the suggestion : , as soon as possibile I will try this mode.
Sometimes is necessary to change by code the trigger mode of a button (or other object).
I will be useful if the new release contain this mode. Can you evaluate to insert this mode in the next revision?
thanks
2021-02-25 11:47 PM
Hi,
Could you add this idea in the Idea Zone of this forum ? This will help us keep track of this. This will unlikely be added to the next release, but we never know for the next one ;).
I can add that another work around would be to have two buttons (same position, looks, ...) and you switch to the one with the trigger you need when needed.
/Romain
2021-02-26 03:21 AM
In effec,t at moment I use this easy/fake solution .
But I would like to try your first solution