cancel
Showing results for 
Search instead for 
Did you mean: 

How do I display a Text on TouchGFX?

PKunK.1
Associate III

Stm32f469i_Discovery uses TouchFGX to create a reservation program.

I want to show the reservation details on the screen according to the date.

The variable for the day of the week is day_value. 

Mon : 0x01

Tue : 0x02

Wed : 0x04

Thu : 0x08

Fri : 0x10

Sat : 0x20

Sun : 0x40 

user A is day_value = 0x15(Mon, Wed, Fri )

user B is day_value = 0x70 (Fir, Sat, Sun )

According to the entered day_Value 

uesr A : Mon, Wed, Fri

user B : Fir, Sat, Sun  

I want to display it on the TouchGFX screen like this way.

cstring Tdata1, Tdata2, Tdata3;

if(day_value & Mon ){

  Tdata1 = "Mon";

}

if(day_value & Wed){

 Tdata2 = "Tue";

}

if(day_Value & Fri){

Tdata3 = "Fri";

}

It is not known how to store each variable and mark it as TouchGFX Text.

1 REPLY 1
MM..1
Chief II

I see your idea as no complex, what when user reserve week plus one day ...?

And for your text problem, touchgfx use different idea as your cstring, but important is how you plan deal with reservation data C or C++?

My example for you is C global array your day_values

uint8_t day_values[MAXRES];

and for show your data in one wildcard textarea:

     Unicode::snprintf(textAreaBuffer, TEXTAREA_SIZE, "User %d > %s", foriuser, getstrdays(day_values[foriuser]) );
     textArea.setWildcard(textAreaBuffer);
     textArea.invalidate();
     textArea.resizeToCurrentText();
     textArea.invalidate();

function getstrdays you need write and return string for show. Size you need define in designer when create wildcard.