How to update a flexbutton wildcard text nested within a custom container
I have created a custom container available in multiple screens that can be used for adjusting a selected menu value.
Each screen has a number of selectable parameters and when the parameter is selected a custom container becomes visible containing a flexbutton bearing the selected parameter title along with a scroll wheel to adjust the value, and a simple text box containing a wildcard text to show the units of the parameter (like ppm for instance) . The flexbutton is used to lock in the adjusted value and make the container invisible again.
I have created a routine called 'setText' within 'customcontainer1.cpp' which sets the two wildcard texts depending upon the index of the parameter selected in the main screens.
I know this routine works if i call it when the screen is first accessed I.E when 'customcontainer11' is created when i first access screen 1 or 'customcontainer12' is created when i first access screen 2. I checked this by temporarily putting the 'setText' inside the routine 'CustomContainer1::CustomContainer1()' routine.
My issue is that when i select a parameter in a certain screen the container always pops up with the originally set default text values. It does not access the 'setText routine or if it does then it does not affect the content of the wildcards.
In my ScreenView1.cpp module when i select a parameter that needs to be changed an index and a flag is set (both global variables) and then on the next tick my 'cursorcheck' routine (which runs every tick) checks the flags and if required calls the following:
customContainer11.setText();
customContainer11.setVisible(true);
customContainer11.invalidate();
On the next tick the container becomes visible but it seems if it actually accesses and runs the setText routine it does not affect the content of the wildcards.
What am I doing wrong? Should i be nesting the setText routine within another routine that is accessed to redraw the container to make it visible when the 'invalidate' command is run? if so what is that routine?
any advice would be much appreciated.
