cancel
Showing results for 
Search instead for 
Did you mean: 

Overwriting of numbers when counter is increment or decrement

DMane
Associate II

Counter is increment or decrement by pressing button the initial value is remain on text​ box and new value is overwrite on previous value. How to solve overwriting issue. 

13 REPLIES 13

Please ensure that you have invalidated the text widget after modifying the content of the buffer.

    // Update tick text and invalidate text area,
    // which will result in it being redrawn.
    Unicode::snprintf(tickTxtBuffer, 5, "%d", tick);
    tickTxt.invalidate();

You could also have a look at our Text Example UI available from the TouchGFX Designer as an UI Template

Thanks for your suggestion but I have already done this process but still I gating the overwriting issue so kindly suggest any other method to solve my issue.

Hi @DMane​,

I understand your issue correct, it is when increasing or decreasing a number on screen, digits some times remain?

It might help by taking a look at the Button Example from the TouchGFX Designer.

/Anders

So which type of button to use increasing and decreasing the number on screen and what type of interaction given to that button please suggest me.

The button used is a normal button in TouchGFX.

In the designer, a "Call new virtual function" is connected to the button as an interaction.

In the screenview.cpp file the following code is executed as a callback when the button is pressed

void MainView::increaseValue()
{
    if (count < 42)
    {
        count++;
        setCount(count);
 
        if (count == 42)
        {
            setLimitEffects(false, true);
        }
        else if (count == 1)
        {
            setLimitEffects(true, true);
        }
    }
}

/Anders

As per your solution I solve that Overwriting issue but I have another issue with my STM32F746G Discovery Board.
when I run my program on Discovery Board display image appears like crashes without colour I attached photo image.
So why this display showing that type of image please guide me about this issue.
please find attachment
.

Hi @DMane​,

It seems that the system did not correctly attach your documents, please reattach than again.

/Anders

Can you please look into attached image on simulator and on hardware.
Thanks,
I have another issue from my STM32F746G Discovery Board
when I run the program the display showing image overwrite on previously run program image .
How to solve that overwriting issue please suggest me