cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX designer Slider value changed interaction - set wildcard

COSEBE
Senior

I made a simple project with slider and wildcard.

Why do I have a "?" instead of the value, even with wildcard range with 0-9

Any idea ?

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

Hi @COSEBE​,

I've just verified that you cannot do what you want. There's no way to get the value of the slider into the wildcard buffer automatically (yet) - It's bad UI design that makes you think you can.

So instead you will, in your action, use "call virtual function" (in this case i've named it "setValue" which will have the int value as a parameter - You can then copy this to your buffer manually and invalidate the textarea.

void Screen1ViewBase::sliderValueChangedCallbackHandler(const touchgfx::Slider& src, int value)
{
    if (&src == &slider1)
    {
        //Interaction1
        //When slider1 value changed call virtual function
        //Call setValue
        setValue(value);
    }
}

Now just override the setValue() function in your concrete view.

/Martin

View solution in original post

8 REPLIES 8
Martin KJELDSEN
Chief III

Check your generated/fonts/src folder for the typography you're using. You can see if your unicodes have been generated properly.

One option is that they're not a part of the font you're using (although unlikely). Maybe you didn't specify the range in the range field, but in the "characters" field which does not accept ranges. Then you would probably see a properly rendered text for "0" and "9" and "-" since those are the only characters generated.

/Martin

COSEBE
Senior

Martin,

I confirm the source code is generated for 0x30 to 0x39 for the only font I use for this demo.

Did you try to simulate the attached project ?

Regards,

Martin KJELDSEN
Chief III

I'll try it out as soon as possible.

/Martin

COSEBE
Senior

Hi,

Does someone test my simple project and have the same problem ?

COSEBE
Senior

Martin,

Can you please give me some feedback about this.

I turn around for more than 2 weeks on this

Sébastien

Martin KJELDSEN
Chief III

Hi Sébastien,

I'll try it out after lunch. I really can't guarantee turn around times - Really sorry about that. My priorities shift constantly and sometime i "forget" the tens of threads that i have "pending" :) I need to come up with some system - I was hoping you'd solved it in the meantime with the hints i gave.

I'll try in half an hour or so!

/Martin

Martin KJELDSEN
Chief III

Okay, so i had actually already downloaded the project and begun to take a look - I remember now. I saw the same thing you say, and have debugged on it to reveal that the buffer contains the right values set by the slider, but the TextArea still thinks the characters do not exist - REGARDLESS - of them actually being generated properly. So that's step 1. Now i need to figure out why that's happening.

/Martin

Martin KJELDSEN
Chief III

Hi @COSEBE​,

I've just verified that you cannot do what you want. There's no way to get the value of the slider into the wildcard buffer automatically (yet) - It's bad UI design that makes you think you can.

So instead you will, in your action, use "call virtual function" (in this case i've named it "setValue" which will have the int value as a parameter - You can then copy this to your buffer manually and invalidate the textarea.

void Screen1ViewBase::sliderValueChangedCallbackHandler(const touchgfx::Slider& src, int value)
{
    if (&src == &slider1)
    {
        //Interaction1
        //When slider1 value changed call virtual function
        //Call setValue
        setValue(value);
    }
}

Now just override the setValue() function in your concrete view.

/Martin